From 26619ee4e3a13ade310e99360fe4e65fb6616b53 Mon Sep 17 00:00:00 2001 From: Pragyan Poudyal Date: Wed, 8 Oct 2025 13:54:25 +0530 Subject: [PATCH] composefs-backend: Add composefs opts to install-to-existing-root Signed-off-by: Pragyan Poudyal Signed-off-by: Colin Walters --- crates/lib/src/install.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs index 0648fab9..5706aad3 100644 --- a/crates/lib/src/install.rs +++ b/crates/lib/src/install.rs @@ -407,6 +407,10 @@ pub(crate) struct InstallToExistingRootOpts { /// via e.g. `-v /:/target`. #[clap(default_value = ALONGSIDE_ROOT_MOUNT)] pub(crate) root_path: Utf8PathBuf, + + #[cfg(feature = "composefs-backend")] + #[clap(flatten)] + pub(crate) composefs_opts: InstallComposefsOpts, } /// Global state captured from the container. @@ -1246,7 +1250,7 @@ async fn prepare_install( config_opts: InstallConfigOpts, source_opts: InstallSourceOpts, target_opts: InstallTargetOpts, - #[cfg(feature = "composefs-backend")] composefs_options: InstallComposefsOpts, + #[cfg(feature = "composefs-backend")] mut composefs_options: InstallComposefsOpts, ) -> Result> { tracing::trace!("Preparing install"); let rootfs = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority()) @@ -1319,6 +1323,9 @@ async fn prepare_install( false }; tracing::debug!("Composefs required: {composefs_required}"); + if composefs_required { + composefs_options.composefs_backend = true; + } // We need to access devices that are set up by the host udev bootc_mount::ensure_mirrored_host_mount("/dev")?; @@ -2185,12 +2192,7 @@ pub(crate) async fn install_to_existing_root(opts: InstallToExistingRootOpts) -> target_opts: opts.target_opts, config_opts: opts.config_opts, #[cfg(feature = "composefs-backend")] - composefs_opts: InstallComposefsOpts { - composefs_backend: true, - insecure: false, - uki_addon: None, - bootloader: None, - }, + composefs_opts: opts.composefs_opts, }; install_to_filesystem(opts, true, cleanup).await