@@ -28,7 +28,7 @@ use composefs::{
2828 mountcompat:: { overlayfs_set_fd, overlayfs_set_lower_and_data_fds, prepare_mount} ,
2929 repository:: Repository ,
3030} ;
31- use composefs_boot:: cmdline:: get_cmdline_composefs ;
31+ use composefs_boot:: cmdline:: ComposefsCmdline ;
3232use composefs_ctl:: composefs;
3333use composefs_ctl:: composefs_boot;
3434
@@ -463,11 +463,17 @@ pub fn setup_root(args: Args) -> Result<()> {
463463 config
464464 } ;
465465
466- let ( image, insecure) = get_cmdline_composefs :: < Sha512HashValue > ( & cmdline) ?;
466+ let composefs_info = ComposefsCmdline :: < Sha512HashValue > :: from_cmdline ( & cmdline)
467+ . context ( "Failed to parse composefs cmdline" ) ?
468+ . ok_or_else ( || anyhow:: anyhow!( "No composefs image in cmdline" ) ) ?;
467469
468470 let new_root = match & args. root_fs {
469471 Some ( path) => open_root_fs ( path) . context ( "Failed to clone specified root fs" ) ?,
470- None => mount_composefs_image ( & sysroot, & image. to_hex ( ) , insecure) ?,
472+ None => mount_composefs_image (
473+ & sysroot,
474+ & composefs_info. digest ( ) . to_hex ( ) ,
475+ composefs_info. is_insecure ( ) ,
476+ ) ?,
471477 } ;
472478
473479 // we need to clone this before the next step to make sure we get the old one
@@ -497,7 +503,7 @@ pub fn setup_root(args: Args) -> Result<()> {
497503 let transient_overlay_fd: Option < OwnedFd > = if config. root . transient {
498504 let overlay_fd = overlay_transient (
499505 & new_root,
500- & format ! ( "transient:composefs={}" , image . to_hex( ) ) ,
506+ & format ! ( "transient:composefs={}" , composefs_info . digest ( ) . to_hex( ) ) ,
501507 None ,
502508 ) ?;
503509
@@ -533,7 +539,10 @@ pub fn setup_root(args: Args) -> Result<()> {
533539 }
534540
535541 // etc + var
536- let state = open_dir ( open_dir ( & sysroot, "state/deploy" ) ?, image. to_hex ( ) ) ?;
542+ let state = open_dir (
543+ open_dir ( & sysroot, "state/deploy" ) ?,
544+ composefs_info. digest ( ) . to_hex ( ) ,
545+ ) ?;
537546 mount_subdir ( visible_root, & state, "etc" , config. etc , MountType :: Bind ) ?;
538547 // /var is bind-mounted from the deployment state directory by default.
539548 // The systemd.volatile=state cmdline detection above (or an explicit
0 commit comments