Skip to content

Commit 1579c7d

Browse files
Johan-Liebert1cgwalters
authored andcommitted
composese-backend: Implement install to filesystem
Signed-off-by: Pragyan Poudyal <[email protected]> Signed-off-by: Colin Walters <[email protected]>
1 parent f4c678e commit 1579c7d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

crates/lib/src/bootc_composefs/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub(crate) async fn pull_composefs_repo(
8181
)> {
8282
let rootfs_dir = Dir::open_ambient_dir("/sysroot", ambient_authority())?;
8383

84-
let repo = open_composefs_repo(&rootfs_dir).context("Opening compoesfs repo")?;
84+
let repo = open_composefs_repo(&rootfs_dir).context("Opening composefs repo")?;
8585

8686
let final_imgref = get_imgref(transport, image);
8787

crates/lib/src/install.rs

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

371371
#[clap(flatten)]
372372
pub(crate) config_opts: InstallConfigOpts,
373+
374+
#[clap(long)]
375+
#[cfg(feature = "composefs-backend")]
376+
pub(crate) composefs_native: bool,
377+
378+
#[cfg(feature = "composefs-backend")]
379+
#[clap(flatten)]
380+
pub(crate) composefs_opts: InstallComposefsOpts,
373381
}
374382

375383
#[derive(Debug, Clone, clap::Parser, PartialEq, Eq)]
@@ -1916,7 +1924,17 @@ pub(crate) async fn install_to_filesystem(
19161924
// IMPORTANT: and hence anything that is done before MUST BE IDEMPOTENT.
19171925
// IMPORTANT: In practice, we should only be gathering information before this point,
19181926
// IMPORTANT: and not performing any mutations at all.
1919-
let state = prepare_install(opts.config_opts, opts.source_opts, opts.target_opts, None).await?;
1927+
let state = prepare_install(
1928+
opts.config_opts,
1929+
opts.source_opts,
1930+
opts.target_opts,
1931+
#[cfg(feature = "composefs-backend")]
1932+
opts.composefs_native.then_some(opts.composefs_opts),
1933+
#[cfg(not(feature = "composefs-backend"))]
1934+
None,
1935+
)
1936+
.await?;
1937+
19201938
// And the last bit of state here is the fsopts, which we also destructure now.
19211939
let mut fsopts = opts.filesystem_opts;
19221940

@@ -2184,6 +2202,14 @@ pub(crate) async fn install_to_existing_root(opts: InstallToExistingRootOpts) ->
21842202
source_opts: opts.source_opts,
21852203
target_opts: opts.target_opts,
21862204
config_opts: opts.config_opts,
2205+
#[cfg(feature = "composefs-backend")]
2206+
composefs_native: false,
2207+
#[cfg(feature = "composefs-backend")]
2208+
composefs_opts: InstallComposefsOpts {
2209+
insecure: false,
2210+
bootloader: Bootloader::Grub,
2211+
uki_addon: None,
2212+
},
21872213
};
21882214

21892215
install_to_filesystem(opts, true, cleanup).await

0 commit comments

Comments
 (0)