@@ -131,7 +131,15 @@ pub(crate) struct SwitchOpts {
131131
132132/// Options controlling rollback
133133#[ derive( Debug , Parser , PartialEq , Eq ) ]
134- pub ( crate ) struct RollbackOpts { }
134+ pub ( crate ) struct RollbackOpts {
135+ /// Restart or reboot into the rollback image.
136+ ///
137+ /// Currently, this option always reboots. In the future this command
138+ /// will detect the case where no kernel changes are queued, and perform
139+ /// a userspace-only restart.
140+ #[ clap( long) ]
141+ pub ( crate ) apply : bool ,
142+ }
135143
136144/// Perform an edit operation
137145#[ derive( Debug , Parser , PartialEq , Eq ) ]
@@ -905,9 +913,15 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
905913
906914/// Implementation of the `bootc rollback` CLI command.
907915#[ context( "Rollback" ) ]
908- async fn rollback ( _opts : RollbackOpts ) -> Result < ( ) > {
916+ async fn rollback ( opts : RollbackOpts ) -> Result < ( ) > {
909917 let sysroot = & get_storage ( ) . await ?;
910- crate :: deploy:: rollback ( sysroot) . await
918+ crate :: deploy:: rollback ( sysroot) . await ?;
919+
920+ if opts. apply {
921+ crate :: reboot:: reboot ( ) ?;
922+ }
923+
924+ Ok ( ( ) )
911925}
912926
913927/// Implementation of the `bootc edit` CLI command.
0 commit comments