File tree Expand file tree Collapse file tree
crates/composefs-setup-root/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,9 +179,19 @@ fn open_root_fs(path: &Path) -> Result<OwnedFd> {
179179}
180180
181181fn mount_composefs_image ( sysroot : & OwnedFd , name : & str , insecure : bool ) -> Result < OwnedFd > {
182- let mut repo = Repository :: < Sha256HashValue > :: open_path ( sysroot, "composefs" ) ?;
183- repo. set_insecure ( insecure) ;
184- repo. mount ( name) . context ( "Failed to mount composefs image" )
182+ match name. len ( ) {
183+ 128 => {
184+ let mut repo = Repository :: < Sha512HashValue > :: open_path ( sysroot, "composefs" ) ?;
185+ repo. set_insecure ( insecure) ;
186+ repo. mount ( name) . context ( "Failed to mount composefs image" )
187+ }
188+ 64 => {
189+ let mut repo = Repository :: < Sha256HashValue > :: open_path ( sysroot, "composefs" ) ?;
190+ repo. set_insecure ( insecure) ;
191+ repo. mount ( name) . context ( "Failed to mount composefs image" )
192+ }
193+ _ => anyhow:: bail!( "Invalid composefs digest length: {}" , name. len( ) ) ,
194+ }
185195}
186196
187197fn mount_subdir (
You can’t perform that action at this time.
0 commit comments