Skip to content

Commit 3b9cd28

Browse files
committed
install: Rework to use Storage
Prep for #721 Signed-off-by: Colin Walters <[email protected]>
1 parent 45178c3 commit 3b9cd28

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/src/install.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use self::baseline::InstallBlockDeviceOpts;
4444
use crate::containerenv::ContainerExecutionInfo;
4545
use crate::mount::Filesystem;
4646
use crate::spec::ImageReference;
47+
use crate::store::Storage;
4748
use crate::task::Task;
4849
use crate::utils::sigpolicy_from_opts;
4950

@@ -549,7 +550,7 @@ pub(crate) fn print_configuration() -> Result<()> {
549550
}
550551

551552
#[context("Creating ostree deployment")]
552-
async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result<ostree::Sysroot> {
553+
async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result<Storage> {
553554
let sepolicy = state.load_policy()?;
554555
let sepolicy = sepolicy.as_ref();
555556
// Load a fd for the mounted target physical root
@@ -608,7 +609,8 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
608609

609610
let sysroot = ostree::Sysroot::new(Some(&gio::File::for_path(rootfs)));
610611
sysroot.load(cancellable)?;
611-
Ok(sysroot)
612+
let sysroot = SysrootLock::new_from_sysroot(&sysroot).await?;
613+
Ok(Storage::new(sysroot))
612614
}
613615

614616
#[context("Creating ostree deployment")]
@@ -1270,11 +1272,10 @@ async fn prepare_install(
12701272
async fn install_with_sysroot(
12711273
state: &State,
12721274
rootfs: &RootSetup,
1273-
sysroot: &ostree::Sysroot,
1275+
sysroot: &Storage,
12741276
boot_uuid: &str,
12751277
bound_images: &[crate::boundimage::ResolvedBoundImage],
12761278
) -> Result<()> {
1277-
let sysroot = SysrootLock::new_from_sysroot(&sysroot).await?;
12781279
// And actually set up the container in that root, returning a deployment and
12791280
// the aleph state (see below).
12801281
let (deployment, aleph) = install_container(state, rootfs, &sysroot).await?;

0 commit comments

Comments
 (0)