@@ -1073,6 +1073,7 @@ pub(crate) struct RootSetup {
10731073 pub ( crate ) physical_root_path : Utf8PathBuf ,
10741074 /// Directory file descriptor for the above physical root.
10751075 pub ( crate ) physical_root : Dir ,
1076+ pub ( crate ) root_path : Option < Utf8PathBuf > ,
10761077 pub ( crate ) rootfs_uuid : Option < String > ,
10771078 /// True if we should skip finalizing
10781079 skip_finalize : bool ,
@@ -1514,7 +1515,7 @@ async fn install_with_sysroot(
15141515 Bootloader :: Grub => {
15151516 crate :: bootloader:: install_via_bootupd (
15161517 & rootfs. device_info ,
1517- & rootfs. physical_root_path ,
1518+ & rootfs. root_path ,
15181519 & state. config_opts ,
15191520 Some ( & deployment_path. as_str ( ) ) ,
15201521 ) ?;
@@ -1986,9 +1987,9 @@ pub(crate) async fn install_to_filesystem(
19861987 . context ( "Mounting host / to {ALONGSIDE_ROOT_MOUNT}" ) ?;
19871988 }
19881989
1990+ let root_path = & fsopts. root_path ;
19891991 // Check that the target is a directory
19901992 {
1991- let root_path = & fsopts. root_path ;
19921993 let st = root_path
19931994 . symlink_metadata ( )
19941995 . with_context ( || format ! ( "Querying target filesystem {root_path}" ) ) ?;
@@ -1999,7 +2000,6 @@ pub(crate) async fn install_to_filesystem(
19992000
20002001 // Check to see if this happens to be the real host root
20012002 if !fsopts. acknowledge_destructive {
2002- let root_path = & fsopts. root_path ;
20032003 let rootfs_fd = Dir :: open_ambient_dir ( root_path, cap_std:: ambient_authority ( ) )
20042004 . with_context ( || format ! ( "Opening target root directory {root_path}" ) ) ?;
20052005 warn_on_host_root ( & rootfs_fd) ?;
@@ -2019,7 +2019,6 @@ pub(crate) async fn install_to_filesystem(
20192019
20202020 // Get a file descriptor for the root path
20212021 let rootfs_fd = {
2022- let root_path = & fsopts. root_path ;
20232022 let rootfs_fd = Dir :: open_ambient_dir ( & fsopts. root_path , cap_std:: ambient_authority ( ) )
20242023 . with_context ( || format ! ( "Opening target root directory {root_path}" ) ) ?;
20252024
@@ -2175,6 +2174,7 @@ pub(crate) async fn install_to_filesystem(
21752174 device_info,
21762175 physical_root_path : fsopts. root_path ,
21772176 physical_root : rootfs_fd,
2177+ root_path : Some ( root_path. clone ( ) ) ,
21782178 rootfs_uuid : inspect. uuid . clone ( ) ,
21792179 boot,
21802180 kargs,
0 commit comments