@@ -258,6 +258,12 @@ pub(crate) async fn get_composefs_status(
258258 composefs_deployment_status_from ( & storage, booted_cfs. cmdline ) . await
259259}
260260
261+ fn set_reboot_capable ( deployment : & mut BootEntry , booted_boot_digest : & String ) -> Result < ( ) > {
262+ let boot_digest = deployment. composefs_boot_digest ( ) ?;
263+ deployment. soft_reboot_capable = boot_digest == booted_boot_digest;
264+ Ok ( ( ) )
265+ }
266+
261267#[ context( "Getting composefs deployment status" ) ]
262268pub ( crate ) async fn composefs_deployment_status_from (
263269 storage : & Storage ,
@@ -350,9 +356,9 @@ pub(crate) async fn composefs_deployment_status_from(
350356 anyhow:: bail!( "Could not determine boot type" ) ;
351357 } ;
352358
353- let booted = host. require_composefs_booted ( ) ?;
359+ let booted_cfs = host. require_composefs_booted ( ) ?;
354360
355- let is_rollback_queued = match booted . bootloader {
361+ let is_rollback_queued = match booted_cfs . bootloader {
356362 Bootloader :: Grub => match boot_type {
357363 BootType :: Bls => {
358364 let bls_config = get_sorted_type1_boot_entries ( boot_dir, false ) ?;
@@ -413,6 +419,29 @@ pub(crate) async fn composefs_deployment_status_from(
413419 host. spec . boot_order = BootOrder :: Rollback
414420 } ;
415421
422+ // Can only soft reboot non UKI boot entries
423+ if !matches ! ( boot_type, BootType :: Uki ) {
424+ let booted_mut = host
425+ . status
426+ . booted
427+ . as_mut ( )
428+ . ok_or_else ( || anyhow:: anyhow!( "Failed to find booted entry" ) ) ?;
429+
430+ let booted_boot_digest = booted_mut. composefs_boot_digest ( ) ?;
431+
432+ if let Some ( staged) = host. status . staged . as_mut ( ) {
433+ set_reboot_capable ( staged, booted_boot_digest) ?;
434+ }
435+
436+ if let Some ( rollback) = host. status . rollback . as_mut ( ) {
437+ set_reboot_capable ( rollback, booted_boot_digest) ?;
438+ }
439+
440+ for deployment in & mut host. status . other_deployments {
441+ set_reboot_capable ( deployment, booted_boot_digest) ?;
442+ }
443+ }
444+
416445 Ok ( host)
417446}
418447
0 commit comments