File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,21 @@ pub fn erofs_mount(image: OwnedFd) -> Result<OwnedFd> {
75
75
) ?)
76
76
}
77
77
78
- pub fn composefs_fsmount ( image : OwnedFd , name : & str , basedir : impl AsFd ) -> Result < OwnedFd > {
78
+ pub fn composefs_fsmount (
79
+ image : OwnedFd ,
80
+ name : & str ,
81
+ basedir : impl AsFd ,
82
+ enable_verity : bool ,
83
+ ) -> Result < OwnedFd > {
79
84
let erofs_mnt = prepare_mount ( erofs_mount ( image) ?) ?;
80
85
81
86
let overlayfs = FsHandle :: open ( "overlay" ) ?;
82
87
fsconfig_set_string ( overlayfs. as_fd ( ) , "source" , format ! ( "composefs:{name}" ) ) ?;
83
88
fsconfig_set_string ( overlayfs. as_fd ( ) , "metacopy" , "on" ) ?;
84
89
fsconfig_set_string ( overlayfs. as_fd ( ) , "redirect_dir" , "on" ) ?;
85
- fsconfig_set_string ( overlayfs. as_fd ( ) , "verity" , "require" ) ?;
90
+ if enable_verity {
91
+ fsconfig_set_string ( overlayfs. as_fd ( ) , "verity" , "require" ) ?;
92
+ }
86
93
overlayfs_set_lower_and_data_fds ( & overlayfs, & erofs_mnt, Some ( & basedir) ) ?;
87
94
fsconfig_create ( overlayfs. as_fd ( ) ) ?;
88
95
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ impl<ObjectID: FsVerityHashValue> Repository<ObjectID> {
396
396
397
397
pub fn mount ( & self , name : & str ) -> Result < OwnedFd > {
398
398
let image = self . open_image ( name) ?;
399
- Ok ( composefs_fsmount ( image, name, self . objects_dir ( ) ?) ?)
399
+ Ok ( composefs_fsmount ( image, name, self . objects_dir ( ) ?, true ) ?)
400
400
}
401
401
402
402
pub fn mount_at ( & self , name : & str , mountpoint : impl AsRef < Path > ) -> Result < ( ) > {
You can’t perform that action at this time.
0 commit comments