@@ -630,10 +630,7 @@ pub(crate) fn print_configuration() -> Result<()> {
630
630
}
631
631
632
632
#[ context( "Creating ostree deployment" ) ]
633
- async fn initialize_ostree_root (
634
- state : & State ,
635
- root_setup : & RootSetup ,
636
- ) -> Result < ( Storage , bool , crate :: imgstorage:: Storage ) > {
633
+ async fn initialize_ostree_root ( state : & State , root_setup : & RootSetup ) -> Result < ( Storage , bool ) > {
637
634
let sepolicy = state. load_policy ( ) ?;
638
635
let sepolicy = sepolicy. as_ref ( ) ;
639
636
// Load a fd for the mounted target physical root
@@ -727,11 +724,11 @@ async fn initialize_ostree_root(
727
724
) ?;
728
725
}
729
726
730
- let imgstore = crate :: imgstorage:: Storage :: create ( & sysroot_dir, & temp_run, sepolicy) ?;
731
-
732
727
sysroot. load ( cancellable) ?;
733
728
let sysroot = SysrootLock :: new_from_sysroot ( & sysroot) . await ?;
734
- Ok ( ( Storage :: new ( sysroot, & temp_run) ?, has_ostree, imgstore) )
729
+ let storage = Storage :: new ( sysroot, & temp_run) ?;
730
+
731
+ Ok ( ( storage, has_ostree) )
735
732
}
736
733
737
734
fn check_disk_space (
@@ -1336,13 +1333,14 @@ async fn prepare_install(
1336
1333
async fn install_with_sysroot (
1337
1334
state : & State ,
1338
1335
rootfs : & RootSetup ,
1339
- sysroot : & Storage ,
1336
+ storage : & Storage ,
1340
1337
boot_uuid : & str ,
1341
1338
bound_images : BoundImages ,
1342
1339
has_ostree : bool ,
1343
- imgstore : & crate :: imgstorage:: Storage ,
1344
1340
) -> Result < ( ) > {
1345
- let ostree = sysroot. get_ostree ( ) ?;
1341
+ let ostree = storage. get_ostree ( ) ?;
1342
+ let c_storage = storage. get_ensure_imgstore ( ) ?;
1343
+
1346
1344
// And actually set up the container in that root, returning a deployment and
1347
1345
// the aleph state (see below).
1348
1346
let ( deployment, aleph) = install_container ( state, rootfs, ostree, has_ostree) . await ?;
@@ -1377,11 +1375,11 @@ async fn install_with_sysroot(
1377
1375
// Now copy each bound image from the host's container storage into the target.
1378
1376
for image in resolved_bound_images {
1379
1377
let image = image. image . as_str ( ) ;
1380
- imgstore . pull_from_host_storage ( image) . await ?;
1378
+ c_storage . pull_from_host_storage ( image) . await ?;
1381
1379
}
1382
1380
}
1383
1381
BoundImages :: Unresolved ( bound_images) => {
1384
- crate :: boundimage:: pull_images_impl ( imgstore , bound_images)
1382
+ crate :: boundimage:: pull_images_impl ( c_storage , bound_images)
1385
1383
. await
1386
1384
. context ( "pulling bound images" ) ?;
1387
1385
}
@@ -1461,7 +1459,7 @@ async fn install_to_filesystem_impl(
1461
1459
// Initialize the ostree sysroot (repo, stateroot, etc.)
1462
1460
1463
1461
{
1464
- let ( sysroot, has_ostree, imgstore ) = initialize_ostree_root ( state, rootfs) . await ?;
1462
+ let ( sysroot, has_ostree) = initialize_ostree_root ( state, rootfs) . await ?;
1465
1463
1466
1464
install_with_sysroot (
1467
1465
state,
@@ -1470,7 +1468,6 @@ async fn install_to_filesystem_impl(
1470
1468
& boot_uuid,
1471
1469
bound_images,
1472
1470
has_ostree,
1473
- & imgstore,
1474
1471
)
1475
1472
. await ?;
1476
1473
let ostree = sysroot. get_ostree ( ) ?;
0 commit comments