File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ use ostree_ext::ostree;
40
40
use ostree_ext:: prelude:: Cast ;
41
41
use ostree_ext:: sysroot:: SysrootLock ;
42
42
use rustix:: fs:: { FileTypeExt , MetadataExt as _} ;
43
- use rustix:: thread:: Pid ;
44
43
use serde:: { Deserialize , Serialize } ;
45
44
46
45
use self :: baseline:: InstallBlockDeviceOpts ;
@@ -1641,9 +1640,10 @@ pub(crate) async fn install_to_filesystem(
1641
1640
&& fsopts. root_path . as_str ( ) == ALONGSIDE_ROOT_MOUNT
1642
1641
&& !fsopts. root_path . try_exists ( ) ?
1643
1642
{
1643
+ tracing:: debug!( "Mounting host / to {ALONGSIDE_ROOT_MOUNT}" ) ;
1644
1644
std:: fs:: create_dir ( ALONGSIDE_ROOT_MOUNT ) ?;
1645
1645
crate :: mount:: bind_mount_from_pidns (
1646
- Pid :: from_raw ( 1 ) . unwrap ( ) ,
1646
+ crate :: mount :: PID1 ,
1647
1647
"/" . into ( ) ,
1648
1648
ALONGSIDE_ROOT_MOUNT . into ( ) ,
1649
1649
true ,
Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ use serde::Deserialize;
23
23
24
24
use crate :: task:: Task ;
25
25
26
+ /// Well known identifier for pid 1
27
+ pub ( crate ) const PID1 : Pid = const {
28
+ match Pid :: from_raw ( 1 ) {
29
+ Some ( v) => v,
30
+ None => panic ! ( "Expected to parse pid1" ) ,
31
+ }
32
+ } ;
33
+
26
34
#[ derive( Deserialize , Debug ) ]
27
35
#[ serde( rename_all = "kebab-case" ) ]
28
36
#[ allow( dead_code) ]
@@ -266,5 +274,5 @@ pub(crate) fn ensure_mirrored_host_mount(path: impl AsRef<Utf8Path>) -> Result<(
266
274
return Ok ( ( ) ) ;
267
275
}
268
276
tracing:: debug!( "Propagating host mount: {path}" ) ;
269
- bind_mount_from_pidns ( Pid :: from_raw ( 1 ) . unwrap ( ) , path, path, true )
277
+ bind_mount_from_pidns ( PID1 , path, path, true )
270
278
}
You can’t perform that action at this time.
0 commit comments