@@ -1642,6 +1642,13 @@ pub(crate) async fn install_to_filesystem(
1642
1642
opts : InstallToFilesystemOpts ,
1643
1643
targeting_host_root : bool ,
1644
1644
) -> Result < ( ) > {
1645
+ // Gather global state, destructuring the provided options.
1646
+ // IMPORTANT: We might re-execute the current process in this function (for SELinux among other things)
1647
+ // IMPORTANT: and hence anything that is done before MUST BE IDEMPOTENT.
1648
+ // IMPORTANT: In practice, we should only be gathering information before this point,
1649
+ // IMPORTANT: and not performing any mutations at all.
1650
+ let state = prepare_install ( opts. config_opts , opts. source_opts , opts. target_opts ) . await ?;
1651
+ // And the last bit of state here is the fsopts, which we also destructure now.
1645
1652
let mut fsopts = opts. filesystem_opts ;
1646
1653
1647
1654
// Check that the target is a directory
@@ -1680,13 +1687,6 @@ pub(crate) async fn install_to_filesystem(
1680
1687
rootfs_fd
1681
1688
} ;
1682
1689
1683
- // Gather global state, destructuring the provided options.
1684
- // IMPORTANT: We might re-execute the current process in this function (for SELinux among other things)
1685
- // IMPORTANT: and hence anything that is done before MUST BE IDEMPOTENT.
1686
- // IMPORTANT: In practice, we should only be gathering information before this point,
1687
- // IMPORTANT: and not performing any mutations at all.
1688
- let state = prepare_install ( opts. config_opts , opts. source_opts , opts. target_opts ) . await ?;
1689
-
1690
1690
// Check to see if this happens to be the real host root
1691
1691
if !fsopts. acknowledge_destructive {
1692
1692
warn_on_host_root ( & rootfs_fd) ?;
0 commit comments