@@ -17,6 +17,8 @@ use ostree_ext::keyfileext::KeyFileExt;
17
17
use ostree_ext:: ostree;
18
18
use ostree_ext:: sysroot:: SysrootLock ;
19
19
use std:: ffi:: OsString ;
20
+ use std:: os:: unix:: process:: CommandExt ;
21
+ use std:: process:: Command ;
20
22
21
23
/// Perform an upgrade operation
22
24
#[ derive( Debug , Parser ) ]
@@ -104,6 +106,9 @@ pub(crate) enum Opt {
104
106
Switch ( SwitchOpts ) ,
105
107
/// Display status
106
108
Status ( StatusOpts ) ,
109
+ /// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
110
+ #[ clap( alias = "usroverlay" ) ]
111
+ UsrOverlay ,
107
112
/// Install to the target block device
108
113
#[ cfg( feature = "install" ) ]
109
114
Install ( crate :: install:: InstallOpts ) ,
@@ -346,6 +351,16 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
346
351
Ok ( ( ) )
347
352
}
348
353
354
+ /// Implementation of `bootc usroverlay`
355
+ async fn usroverlay ( ) -> Result < ( ) > {
356
+ // This is just a pass-through today. At some point we may make this a libostree API
357
+ // or even oxidize it.
358
+ return Err ( Command :: new ( "ostree" )
359
+ . args ( [ "admin" , "unlock" ] )
360
+ . exec ( )
361
+ . into ( ) ) ;
362
+ }
363
+
349
364
/// Parse the provided arguments and execute.
350
365
/// Calls [`structopt::clap::Error::exit`] on failure, printing the error message and aborting the program.
351
366
pub async fn run_from_iter < I > ( args : I ) -> Result < ( ) >
@@ -357,6 +372,7 @@ where
357
372
match opt {
358
373
Opt :: Upgrade ( opts) => upgrade ( opts) . await ,
359
374
Opt :: Switch ( opts) => switch ( opts) . await ,
375
+ Opt :: UsrOverlay => usroverlay ( ) . await ,
360
376
#[ cfg( feature = "install" ) ]
361
377
Opt :: Install ( opts) => crate :: install:: install ( opts) . await ,
362
378
#[ cfg( feature = "install" ) ]
0 commit comments