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> {
7575 ) ?)
7676}
7777
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 > {
7984 let erofs_mnt = prepare_mount ( erofs_mount ( image) ?) ?;
8085
8186 let overlayfs = FsHandle :: open ( "overlay" ) ?;
8287 fsconfig_set_string ( overlayfs. as_fd ( ) , "source" , format ! ( "composefs:{name}" ) ) ?;
8388 fsconfig_set_string ( overlayfs. as_fd ( ) , "metacopy" , "on" ) ?;
8489 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+ }
8693 overlayfs_set_lower_and_data_fds ( & overlayfs, & erofs_mnt, Some ( & basedir) ) ?;
8794 fsconfig_create ( overlayfs. as_fd ( ) ) ?;
8895
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ impl<ObjectID: FsVerityHashValue> Repository<ObjectID> {
396396
397397 pub fn mount ( & self , name : & str ) -> Result < OwnedFd > {
398398 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 ) ?)
400400 }
401401
402402 pub fn mount_at ( & self , name : & str , mountpoint : impl AsRef < Path > ) -> Result < ( ) > {
You can’t perform that action at this time.
0 commit comments