@@ -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,13 @@ 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 ( & sysroot, & composefs_info . digest ( ) . to_hex ( ) , composefs_info . is_insecure ( ) ) ?,
471473 } ;
472474
473475 // we need to clone this before the next step to make sure we get the old one
@@ -497,7 +499,7 @@ pub fn setup_root(args: Args) -> Result<()> {
497499 let transient_overlay_fd: Option < OwnedFd > = if config. root . transient {
498500 let overlay_fd = overlay_transient (
499501 & new_root,
500- & format ! ( "transient:composefs={}" , image . to_hex( ) ) ,
502+ & format ! ( "transient:composefs={}" , composefs_info . digest ( ) . to_hex( ) ) ,
501503 None ,
502504 ) ?;
503505
@@ -533,7 +535,7 @@ pub fn setup_root(args: Args) -> Result<()> {
533535 }
534536
535537 // etc + var
536- let state = open_dir ( open_dir ( & sysroot, "state/deploy" ) ?, image . to_hex ( ) ) ?;
538+ let state = open_dir ( open_dir ( & sysroot, "state/deploy" ) ?, composefs_info . digest ( ) . to_hex ( ) ) ?;
537539 mount_subdir ( visible_root, & state, "etc" , config. etc , MountType :: Bind ) ?;
538540 // /var is bind-mounted from the deployment state directory by default.
539541 // The systemd.volatile=state cmdline detection above (or an explicit
0 commit comments