@@ -580,7 +580,7 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
580
580
let sepolicy = state. load_policy ( ) ?;
581
581
let sepolicy = sepolicy. as_ref ( ) ;
582
582
// Load a fd for the mounted target physical root
583
- let rootfs_dir = & root_setup. rootfs_fd ;
583
+ let rootfs_dir = & root_setup. physical_root ;
584
584
let cancellable = gio:: Cancellable :: NONE ;
585
585
586
586
let stateroot = state. stateroot ( ) ;
@@ -779,7 +779,7 @@ async fn install_container(
779
779
// SAFETY: There must be a path
780
780
let path = sysroot. deployment_dirpath ( & deployment) ;
781
781
let root = root_setup
782
- . rootfs_fd
782
+ . physical_root
783
783
. open_dir ( path. as_str ( ) )
784
784
. context ( "Opening deployment dir" ) ?;
785
785
@@ -792,7 +792,7 @@ async fn install_container(
792
792
for d in [ "ostree" , "boot" ] {
793
793
let mut pathbuf = Utf8PathBuf :: from ( d) ;
794
794
crate :: lsm:: ensure_dir_labeled_recurse (
795
- & root_setup. rootfs_fd ,
795
+ & root_setup. physical_root ,
796
796
& mut pathbuf,
797
797
policy,
798
798
Some ( deployment_root_devino) ,
@@ -902,8 +902,11 @@ fn require_skopeo_with_containers_storage() -> Result<()> {
902
902
pub ( crate ) struct RootSetup {
903
903
luks_device : Option < String > ,
904
904
device_info : crate :: blockdev:: PartitionTable ,
905
- rootfs : Utf8PathBuf ,
906
- rootfs_fd : Dir ,
905
+ /// Absolute path to the location where we've mounted the physical
906
+ /// root filesystem for the system we're installing.
907
+ physical_root_path : Utf8PathBuf ,
908
+ /// Directory file descriptor for the above physical root.
909
+ physical_root : Dir ,
907
910
rootfs_uuid : Option < String > ,
908
911
/// True if we should skip finalizing
909
912
skip_finalize : bool ,
@@ -925,7 +928,7 @@ impl RootSetup {
925
928
926
929
// Drop any open file descriptors and return just the mount path and backing luks device, if any
927
930
fn into_storage ( self ) -> ( Utf8PathBuf , Option < String > ) {
928
- ( self . rootfs , self . luks_device )
931
+ ( self . physical_root_path , self . luks_device )
929
932
}
930
933
}
931
934
@@ -1323,7 +1326,7 @@ async fn install_with_sysroot(
1323
1326
let ( _deployment, aleph) = install_container ( state, rootfs, & sysroot, has_ostree) . await ?;
1324
1327
// Write the aleph data that captures the system state at the time of provisioning for aid in future debugging.
1325
1328
rootfs
1326
- . rootfs_fd
1329
+ . physical_root
1327
1330
. atomic_replace_with ( BOOTC_ALEPH_PATH , |f| {
1328
1331
serde_json:: to_writer ( f, & aleph) ?;
1329
1332
anyhow:: Ok ( ( ) )
@@ -1336,7 +1339,7 @@ async fn install_with_sysroot(
1336
1339
} else {
1337
1340
crate :: bootloader:: install_via_bootupd (
1338
1341
& rootfs. device_info ,
1339
- & rootfs. rootfs ,
1342
+ & rootfs. physical_root_path ,
1340
1343
& state. config_opts ,
1341
1344
) ?;
1342
1345
}
@@ -1425,7 +1428,7 @@ async fn install_to_filesystem_impl(state: &State, rootfs: &mut RootSetup) -> Re
1425
1428
if !rootfs. skip_finalize {
1426
1429
let bootfs = rootfs. boot . as_ref ( ) . map ( |_| ( "boot" , "boot" ) ) ;
1427
1430
for ( fsname, fs) in std:: iter:: once ( ( "root" , "." ) ) . chain ( bootfs) {
1428
- finalize_filesystem ( fsname, & rootfs. rootfs_fd , fs) ?;
1431
+ finalize_filesystem ( fsname, & rootfs. physical_root , fs) ?;
1429
1432
}
1430
1433
}
1431
1434
@@ -1819,8 +1822,8 @@ pub(crate) async fn install_to_filesystem(
1819
1822
let mut rootfs = RootSetup {
1820
1823
luks_device : None ,
1821
1824
device_info,
1822
- rootfs : fsopts. root_path ,
1823
- rootfs_fd,
1825
+ physical_root_path : fsopts. root_path ,
1826
+ physical_root : rootfs_fd,
1824
1827
rootfs_uuid : inspect. uuid . clone ( ) ,
1825
1828
boot,
1826
1829
kargs,
0 commit comments