Skip to content

Commit 193fd3b

Browse files
committed
kargs: correctly split kernel command-line string with quoted arguments
Splitting the kernel command-line on whitespace breaks quoted arguments, e.g., "dyndbg=\"file drivers/base/firmware_loader/main.c +fmp\"". Use the bootc_kernel_cmdline crate to parse and split kernel arguments, which unbreaks deployment when a quoted kernel argument is present. Closes: ostreedev/ostree#3544 Signed-off-by: Peter Colberg <[email protected]>
1 parent 706ff86 commit 193fd3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/lib/src/bootc_kargs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ pub(crate) fn get_kargs(
124124
// Get the kargs used for the merge in the bootloader config
125125
if let Some(bootconfig) = ostree::Deployment::bootconfig(merge_deployment) {
126126
if let Some(options) = ostree::BootconfigParser::get(&bootconfig, "options") {
127-
let options = options.split_whitespace().map(|s| s.to_owned());
127+
let options = bootc_kernel_cmdline::utf8::Cmdline::from(options.as_str())
128+
.iter()
129+
.map(|s| s.to_string())
130+
.collect::<Vec<String>>();
128131
kargs.extend(options);
129132
}
130133
};

0 commit comments

Comments
 (0)