Skip to content

Commit 1d384c4

Browse files
Johan-Liebert1cgwalters
authored andcommitted
composefs-backend: Add composefs opts to install-to-existing-root
Signed-off-by: Pragyan Poudyal <[email protected]> Signed-off-by: Colin Walters <[email protected]>
1 parent f7ccb55 commit 1d384c4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

crates/lib/src/install.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ pub(crate) struct InstallToExistingRootOpts {
407407
/// via e.g. `-v /:/target`.
408408
#[clap(default_value = ALONGSIDE_ROOT_MOUNT)]
409409
pub(crate) root_path: Utf8PathBuf,
410+
411+
#[cfg(feature = "composefs-backend")]
412+
#[clap(flatten)]
413+
pub(crate) composefs_opts: InstallComposefsOpts,
410414
}
411415

412416
/// Global state captured from the container.
@@ -1246,7 +1250,7 @@ async fn prepare_install(
12461250
config_opts: InstallConfigOpts,
12471251
source_opts: InstallSourceOpts,
12481252
target_opts: InstallTargetOpts,
1249-
#[cfg(feature = "composefs-backend")] composefs_options: InstallComposefsOpts,
1253+
#[cfg(feature = "composefs-backend")] mut composefs_options: InstallComposefsOpts,
12501254
) -> Result<Arc<State>> {
12511255
tracing::trace!("Preparing install");
12521256
let rootfs = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())
@@ -1319,6 +1323,9 @@ async fn prepare_install(
13191323
false
13201324
};
13211325
tracing::debug!("Composefs required: {composefs_required}");
1326+
if composefs_required {
1327+
composefs_options.composefs_backend = true;
1328+
}
13221329

13231330
// We need to access devices that are set up by the host udev
13241331
bootc_mount::ensure_mirrored_host_mount("/dev")?;
@@ -2185,12 +2192,7 @@ pub(crate) async fn install_to_existing_root(opts: InstallToExistingRootOpts) ->
21852192
target_opts: opts.target_opts,
21862193
config_opts: opts.config_opts,
21872194
#[cfg(feature = "composefs-backend")]
2188-
composefs_opts: InstallComposefsOpts {
2189-
composefs_backend: true,
2190-
insecure: false,
2191-
uki_addon: None,
2192-
bootloader: None,
2193-
},
2195+
composefs_opts: opts.composefs_opts,
21942196
};
21952197

21962198
install_to_filesystem(opts, true, cleanup).await

0 commit comments

Comments
 (0)