Skip to content

Commit 1f8dae1

Browse files
committed
install: Actually honor provided kargs
Oops. Seems like clap's attribute stuff suppresses unused variable warnings. Signed-off-by: Colin Walters <[email protected]>
1 parent 436791e commit 1f8dae1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/src/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ fn install_create_rootfs(state: &State) -> Result<RootSetup> {
611611
let root_uuid = mkfs(rootdev, opts.filesystem, Some("root"), [])?;
612612
let rootarg = format!("root=UUID={root_uuid}");
613613
let bootarg = format!("boot=UUID={boot_uuid}");
614-
let kargs = vec![rootarg, RW_KARG.to_string(), bootarg];
614+
let mut kargs = opts.config_opts.karg.clone().unwrap_or_default();
615+
kargs.extend([rootarg, RW_KARG.to_string(), bootarg]);
615616

616617
mount(rootdev, &rootfs)?;
617618
lsm_label(&rootfs, "/".into(), false)?;

tests/kolainst/install

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ set -xeuo pipefail
1212

1313
# See https://github.com/cgwalters/bootc-base-images
1414
IMAGE=quay.io/cgwalters/fedora-oscore:latest
15+
# TODO: better detect this, e.g. look for an empty device
16+
DEV=/dev/vda
1517

1618
# Always work out of a temporary directory
1719
cd $(mktemp -d)
1820

1921
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
2022
"")
21-
podman run --rm -ti --privileged --pid=host --net=none -v /usr/bin/bootc:/usr/bin/bootc ${IMAGE} bootc install /dev/vda
23+
podman run --rm -ti --privileged --pid=host --net=none -v /usr/bin/bootc:/usr/bin/bootc ${IMAGE} bootc install --karg=foo=bar ${DEV}
2224
# In theory we could e.g. wipe the bootloader setup on the primary disk, then reboot;
2325
# but for now let's just sanity test that the install command executes.
26+
partprobe ${DEV}
27+
lsblk ${DEV}
2428
echo "ok install"
2529
;;
2630
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;;

0 commit comments

Comments
 (0)