File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ pub const COMPOSEFS_MODE: Mode = Mode::from_raw_mode(0o700);
4949/// system root
5050pub ( crate ) const BOOTC_ROOT : & str = "ostree/bootc" ;
5151
52+ /// The path for the reboot-required file, relative to the system
53+ /// root
54+ pub ( crate ) const REBOOT_REQUIRED : & str = "run/reboot-required" ;
55+
56+ /// Reboot required message that will appear in /run/reboot-required
57+ pub ( crate ) const REBOOT_REQUIRED_MESSAGE : & [ u8 ] = b"Reboot required to complete bootc operation" ;
58+
5259/// A reference to a physical filesystem root, plus
5360/// accessors for the different types of container storage.
5461pub ( crate ) struct Storage {
@@ -175,4 +182,18 @@ impl Storage {
175182 . update_timestamps ( std:: path:: Path :: new ( BOOTC_ROOT ) )
176183 . context ( "update_timestamps" )
177184 }
185+
186+ #[ context( "Updating the reboot-required file" ) ]
187+ pub ( crate ) fn update_reboot_file ( & self ) -> Result < ( ) > {
188+ let sysroot_dir =
189+ crate :: utils:: sysroot_dir ( & self . ostree ) . context ( "Reopen sysroot directory" ) ?;
190+
191+ sysroot_dir
192+ . write (
193+ std:: path:: Path :: new ( REBOOT_REQUIRED ) ,
194+ REBOOT_REQUIRED_MESSAGE ,
195+ )
196+ . context ( "Bootc reboot required" )
197+ . map_err ( Into :: into)
198+ }
178199}
You can’t perform that action at this time.
0 commit comments