@@ -580,7 +580,7 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
580580 let sepolicy = state. load_policy ( ) ?;
581581 let sepolicy = sepolicy. as_ref ( ) ;
582582 // 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 ;
584584 let cancellable = gio:: Cancellable :: NONE ;
585585
586586 let stateroot = state. stateroot ( ) ;
@@ -779,7 +779,7 @@ async fn install_container(
779779 // SAFETY: There must be a path
780780 let path = sysroot. deployment_dirpath ( & deployment) ;
781781 let root = root_setup
782- . rootfs_fd
782+ . physical_root
783783 . open_dir ( path. as_str ( ) )
784784 . context ( "Opening deployment dir" ) ?;
785785
@@ -792,7 +792,7 @@ async fn install_container(
792792 for d in [ "ostree" , "boot" ] {
793793 let mut pathbuf = Utf8PathBuf :: from ( d) ;
794794 crate :: lsm:: ensure_dir_labeled_recurse (
795- & root_setup. rootfs_fd ,
795+ & root_setup. physical_root ,
796796 & mut pathbuf,
797797 policy,
798798 Some ( deployment_root_devino) ,
@@ -902,8 +902,11 @@ fn require_skopeo_with_containers_storage() -> Result<()> {
902902pub ( crate ) struct RootSetup {
903903 luks_device : Option < String > ,
904904 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 ,
907910 rootfs_uuid : Option < String > ,
908911 /// True if we should skip finalizing
909912 skip_finalize : bool ,
@@ -925,7 +928,7 @@ impl RootSetup {
925928
926929 // Drop any open file descriptors and return just the mount path and backing luks device, if any
927930 fn into_storage ( self ) -> ( Utf8PathBuf , Option < String > ) {
928- ( self . rootfs , self . luks_device )
931+ ( self . physical_root_path , self . luks_device )
929932 }
930933}
931934
@@ -1323,7 +1326,7 @@ async fn install_with_sysroot(
13231326 let ( _deployment, aleph) = install_container ( state, rootfs, & sysroot, has_ostree) . await ?;
13241327 // Write the aleph data that captures the system state at the time of provisioning for aid in future debugging.
13251328 rootfs
1326- . rootfs_fd
1329+ . physical_root
13271330 . atomic_replace_with ( BOOTC_ALEPH_PATH , |f| {
13281331 serde_json:: to_writer ( f, & aleph) ?;
13291332 anyhow:: Ok ( ( ) )
@@ -1336,7 +1339,7 @@ async fn install_with_sysroot(
13361339 } else {
13371340 crate :: bootloader:: install_via_bootupd (
13381341 & rootfs. device_info ,
1339- & rootfs. rootfs ,
1342+ & rootfs. physical_root_path ,
13401343 & state. config_opts ,
13411344 ) ?;
13421345 }
@@ -1425,7 +1428,7 @@ async fn install_to_filesystem_impl(state: &State, rootfs: &mut RootSetup) -> Re
14251428 if !rootfs. skip_finalize {
14261429 let bootfs = rootfs. boot . as_ref ( ) . map ( |_| ( "boot" , "boot" ) ) ;
14271430 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) ?;
14291432 }
14301433 }
14311434
@@ -1819,8 +1822,8 @@ pub(crate) async fn install_to_filesystem(
18191822 let mut rootfs = RootSetup {
18201823 luks_device : None ,
18211824 device_info,
1822- rootfs : fsopts. root_path ,
1823- rootfs_fd,
1825+ physical_root_path : fsopts. root_path ,
1826+ physical_root : rootfs_fd,
18241827 rootfs_uuid : inspect. uuid . clone ( ) ,
18251828 boot,
18261829 kargs,
0 commit comments