Skip to content

Commit

Permalink
kargs: keep spaces in double quotes
Browse files Browse the repository at this point in the history
Related change in ostree is ostreedev/ostree#3208.

Fixes: ostreedev/ostree#3228
  • Loading branch information
HuijingHei authored and lukewarmtemp committed Apr 22, 2024
1 parent ef3bb4c commit b2cffd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/daemon/rpmostree-sysroot-upgrader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,11 @@ rpmostree_sysroot_upgrader_deploy (RpmOstreeSysrootUpgrader *self,
OstreeBootconfigParser *bootconfig
= ostree_deployment_get_bootconfig (self->origin_merge_deployment);
const char *options = ostree_bootconfig_parser_get (bootconfig, "options");
self->kargs_strv = g_strsplit (options, " ", -1);
/* Fix for https://github.com/ostreedev/ostree/issues/3228,
* should keep spaces in quotes as single parameter, related
* change in ostree is https://github.com/ostreedev/ostree/pull/3208.
*/
self->kargs_strv = ostree_kernel_args_to_strv (ostree_kernel_args_from_string (options));
}

// Note that most of the code here operates on ->computed_origin except this.
Expand Down
4 changes: 4 additions & 0 deletions tests/kolainst/destructive/container-rebase-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ image=quay.io/fedora/fedora-coreos:stable
image_pull=ostree-remote-registry:fedora:$image

systemctl mask --now zincati
# Test for https://github.com/ostreedev/ostree/issues/3228
rpm-ostree kargs --append "foo=\"a b c\""
rpm-ostree kargs > kargs.txt
assert_file_has_content_literal kargs.txt "foo=\"a b c\""
rpm-ostree rebase --experimental ${image_pull}
rpm-ostree upgrade
# This provokes
Expand Down

0 comments on commit b2cffd8

Please sign in to comment.