@@ -131,7 +131,15 @@ pub(crate) struct SwitchOpts {
131
131
132
132
/// Options controlling rollback
133
133
#[ 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
+ }
135
143
136
144
/// Perform an edit operation
137
145
#[ derive( Debug , Parser , PartialEq , Eq ) ]
@@ -905,9 +913,15 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
905
913
906
914
/// Implementation of the `bootc rollback` CLI command.
907
915
#[ context( "Rollback" ) ]
908
- async fn rollback ( _opts : RollbackOpts ) -> Result < ( ) > {
916
+ async fn rollback ( opts : RollbackOpts ) -> Result < ( ) > {
909
917
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 ( ( ) )
911
925
}
912
926
913
927
/// Implementation of the `bootc edit` CLI command.
0 commit comments