Skip to content

Commit

Permalink
fix ostree= present, clean up printfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Fairley committed Apr 10, 2019
1 parent f268595 commit 679bc5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
3 changes: 3 additions & 0 deletions src/libostree/ostree-bootconfig-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ write_key (OstreeBootconfigParser *self,
const char *key,
const char *value)
{
g_print ("write_key: buff %s, key %s\n", buf->str, key);
g_string_append (buf, key);
g_string_append_c (buf, self->separators[0]);
g_string_append (buf, value);
Expand Down Expand Up @@ -185,6 +186,8 @@ ostree_bootconfig_parser_write_at (OstreeBootconfigParser *self,
write_key (self, buf, k, v);
}

g_print("ostree_bootconfig_parser_write_at: path %s, contents %s\n", path, (guint8*)buf->str);

if (!glnx_file_replace_contents_at (dfd, path, (guint8*)buf->str, buf->len,
GLNX_FILE_REPLACE_NODATASYNC,
cancellable, error))
Expand Down
13 changes: 2 additions & 11 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,6 @@ deployment_get_kargs_config_contents (OstreeSysroot *self,
{
glnx_autofd int deployment_dfd = -1;
g_autofree char *deployment_path = ostree_sysroot_get_deployment_dirpath (self, deployment);
g_print ("deployment_path: %s\n", deployment_path);
if (!glnx_opendirat (self->sysroot_fd, deployment_path, TRUE,
&deployment_dfd, error))
return FALSE;
Expand All @@ -2603,7 +2602,6 @@ deployment_get_kargs_config_contents (OstreeSysroot *self,
{
ret_contents = g_strdup ("");
}
ret_contents = g_strstrip (ret_contents);

*contents_out = g_steal_pointer (&ret_contents);

Expand All @@ -2625,9 +2623,8 @@ deployment_merge_opts (OstreeSysroot *self,
&kargs_config_contents,
cancellable, error))
return FALSE;
g_print ("kargs_config_contents: %s\n", kargs_config_contents);
kargs_config_contents = g_strstrip (kargs_config_contents);
g_ptr_array_add (kargs_configs, g_steal_pointer (&kargs_config_contents));
g_print ("revision: %s\n", revision);
g_autoptr(GFile) root = NULL;
if (!ostree_repo_read_commit (ostree_sysroot_repo (self), revision, &root,
NULL, cancellable, error))
Expand All @@ -2647,7 +2644,7 @@ deployment_merge_opts (OstreeSysroot *self,
return FALSE;
}
}
g_print ("kargs_config_contents: %s\n", kargs_config_contents);
kargs_config_contents = g_strstrip (kargs_config_contents);
g_ptr_array_add (kargs_configs, g_steal_pointer (&kargs_config_contents));

g_autoptr(OstreeKernelArgs) kargs = _ostree_kernel_args_new ();
Expand All @@ -2674,15 +2671,12 @@ sysroot_finalize_deployment (OstreeSysroot *self,
glnx_autofd int deployment_dfd = -1;
if (!glnx_opendirat (self->sysroot_fd, deployment_path, TRUE, &deployment_dfd, error))
return FALSE;

g_print ("deployment_path: %s\n", deployment_path);

/* If we didn't get an override in this deployment, decide whether to copy
* kargs directly from the merge deployment, or regenerate kargs from the
* config files present in the merge deployment. */
if (!override_kernel_argv)
{
g_print ("in !override_kernel_argv\n");
OstreeBootconfigParser *merge_bootconfig = NULL;
gboolean kargs_overridden = FALSE;
if (merge_deployment)
Expand All @@ -2695,15 +2689,13 @@ sysroot_finalize_deployment (OstreeSysroot *self,

if (kargs_overridden)
{
g_print ("in kargs_overridden\n");
/* Copy kargs from the merge deployment. */
g_assert (merge_bootconfig);
const char *opts = ostree_bootconfig_parser_get (merge_bootconfig, "options");
ostree_bootconfig_parser_set (ostree_deployment_get_bootconfig (deployment), "options", opts);
}
else
{
g_print ("in !kargs_overridden\n");
/* Regenerate kargs from merge deployment config. */
g_autofree char *opts = NULL;
if (merge_deployment)
Expand Down Expand Up @@ -2796,7 +2788,6 @@ ostree_sysroot_deploy_tree (OstreeSysroot *self,
GCancellable *cancellable,
GError **error)
{
g_print ("in ostree_sysroot_deploy_tree\n");
g_autoptr(OstreeDeployment) deployment = NULL;
if (!sysroot_initialize_deployment (self, osname, revision, origin, override_kernel_argv,
&deployment, cancellable, error))
Expand Down
2 changes: 1 addition & 1 deletion tests/test-admin-deploy-karg-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ assert_has_dir sysroot/boot/ostree/testos-${bootcsum}

# Commit to and deploy a repo that has a default kargs file.
mkdir -p osdata/usr/lib/ostree-boot
os_tree_write_file "usr/lib/ostree-boot/kargs" "FOO=USR_1 MOO=USR_2 WOO=USR_3 ostree=yay"
os_tree_write_file "usr/lib/ostree-boot/kargs" "FOO=USR_1 MOO=USR_2 WOO=USR_3"
os_repository_commit "testos-repo" "1"

${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime
Expand Down

0 comments on commit 679bc5b

Please sign in to comment.