Skip to content

Commit eac8e4d

Browse files
install/composefs: Handle kargs for BLS
Also exit early if kargs are passed for `--boot=uki` Signed-off-by: Pragyan Poudyal <[email protected]>
1 parent 42632ce commit eac8e4d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lib/src/install.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub(crate) struct InstallConfigOpts {
200200
///
201201
/// Example: --karg=nosmt --karg=console=ttyS0,114800n8
202202
#[clap(long)]
203-
karg: Option<Vec<String>>,
203+
pub(crate) karg: Option<Vec<String>>,
204204

205205
/// The path to an `authorized_keys` that will be injected into the `root` account.
206206
///
@@ -569,6 +569,11 @@ impl InstallToDiskOpts {
569569
}
570570
}
571571

572+
// Can't add kargs to UKI
573+
if self.composefs_opts.boot == BootType::Uki && self.config_opts.karg.is_some() {
574+
anyhow::bail!("Cannot pass kargs to UKI");
575+
}
576+
572577
Ok(())
573578
}
574579
}
@@ -1518,17 +1523,17 @@ fn setup_composefs_bls_boot(
15181523
None => anyhow::bail!("Expected rootfs to have a UUID by now"),
15191524
};
15201525

1521-
let cmdline_refs = [
1522-
"console=ttyS0,115200",
1523-
&format!("root=UUID={rootfs_uuid}"),
1524-
"rw",
1525-
];
1526+
let root_uuid_karg = format!("root=UUID={rootfs_uuid}");
1527+
1528+
let mut cmdline_refs = vec!["console=ttyS0,115200", &root_uuid_karg, "rw"];
1529+
1530+
cmdline_refs.extend(root_setup.kargs.iter().map(String::as_str));
15261531

15271532
composefs_write_boot_simple(
15281533
&repo,
15291534
entry,
15301535
&id,
1531-
root_setup.physical_root_path.as_std_path(), // /run/mounts/bootc/boot
1536+
root_setup.physical_root_path.as_std_path(),
15321537
Some("boot"),
15331538
Some(&format!("{}", id.to_hex())),
15341539
&cmdline_refs,
@@ -1564,8 +1569,6 @@ fn setup_composefs_uki_boot(
15641569
)?;
15651570

15661571
// Add the user grug cfg
1567-
// TODO: We don't need this for BLS. Have a flag for BLS vs UKI, or maybe we can figure it out
1568-
// via the boot entries above
15691572
let grub_user_config = format!(
15701573
r#"
15711574
menuentry "Fedora Bootc UKI" {{

0 commit comments

Comments
 (0)