Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kargs: keep spaces in double quotes #4915

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading