Skip to content

Commit b4cd3c2

Browse files
composese-backend: Implement install to filesystem
Signed-off-by: Pragyan Poudyal <[email protected]>
1 parent b010983 commit b4cd3c2

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

crates/lib/src/install.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ pub(crate) struct InstallToFilesystemOpts {
366366

367367
#[clap(flatten)]
368368
pub(crate) config_opts: InstallConfigOpts,
369+
370+
#[clap(long)]
371+
#[cfg(feature = "composefs-backend")]
372+
pub(crate) composefs_native: bool,
373+
374+
#[cfg(feature = "composefs-backend")]
375+
#[clap(flatten)]
376+
pub(crate) compoesfs_opts: InstallComposefsOpts,
369377
}
370378

371379
#[derive(Debug, Clone, clap::Parser, PartialEq, Eq)]
@@ -1855,7 +1863,17 @@ pub(crate) async fn install_to_filesystem(
18551863
// IMPORTANT: and hence anything that is done before MUST BE IDEMPOTENT.
18561864
// IMPORTANT: In practice, we should only be gathering information before this point,
18571865
// IMPORTANT: and not performing any mutations at all.
1858-
let state = prepare_install(opts.config_opts, opts.source_opts, opts.target_opts, None).await?;
1866+
let state = prepare_install(
1867+
opts.config_opts,
1868+
opts.source_opts,
1869+
opts.target_opts,
1870+
#[cfg(feature = "composefs-backend")]
1871+
opts.composefs_native.then_some(opts.compoesfs_opts),
1872+
#[cfg(not(feature = "composefs-backend"))]
1873+
None,
1874+
)
1875+
.await?;
1876+
18591877
// And the last bit of state here is the fsopts, which we also destructure now.
18601878
let mut fsopts = opts.filesystem_opts;
18611879

@@ -2123,6 +2141,13 @@ pub(crate) async fn install_to_existing_root(opts: InstallToExistingRootOpts) ->
21232141
source_opts: opts.source_opts,
21242142
target_opts: opts.target_opts,
21252143
config_opts: opts.config_opts,
2144+
#[cfg(feature = "composefs-backend")]
2145+
composefs_native: false,
2146+
#[cfg(feature = "composefs-backend")]
2147+
compoesfs_opts: InstallComposefsOpts {
2148+
insecure: false,
2149+
bootloader: Bootloader::Grub,
2150+
},
21262151
};
21272152

21282153
install_to_filesystem(opts, true, cleanup).await

0 commit comments

Comments
 (0)