@@ -14,6 +14,7 @@ use ostree_ext::container as ostree_container;
14
14
use ostree_ext:: container:: SignatureSource ;
15
15
use ostree_ext:: keyfileext:: KeyFileExt ;
16
16
use ostree_ext:: ostree;
17
+ use ostree_ext:: sysroot:: SysrootLock ;
17
18
use std:: ffi:: OsString ;
18
19
use std:: io:: Seek ;
19
20
use std:: os:: unix:: process:: CommandExt ;
@@ -129,6 +130,9 @@ pub(crate) enum Opt {
129
130
/// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
130
131
#[ clap( alias = "usroverlay" ) ]
131
132
UsrOverlay ,
133
+ /// Manipulate configuration
134
+ #[ clap( subcommand) ]
135
+ Config ( crate :: config:: ConfigOpts ) ,
132
136
/// Install to the target block device
133
137
#[ cfg( feature = "install" ) ]
134
138
Install ( crate :: install:: InstallOpts ) ,
@@ -254,6 +258,11 @@ pub(crate) async fn prepare_for_write() -> Result<()> {
254
258
Ok ( ( ) )
255
259
}
256
260
261
+ pub ( crate ) fn target_deployment ( sysroot : & SysrootLock ) -> Result < ostree:: Deployment > {
262
+ let booted_deployment = sysroot. require_booted_deployment ( ) ?;
263
+ Ok ( sysroot. staged_deployment ( ) . unwrap_or ( booted_deployment) )
264
+ }
265
+
257
266
/// Implementation of the `bootc upgrade` CLI command.
258
267
#[ context( "Upgrading" ) ]
259
268
async fn upgrade ( opts : UpgradeOpts ) -> Result < ( ) > {
@@ -435,6 +444,7 @@ where
435
444
Opt :: Switch ( opts) => switch ( opts) . await ,
436
445
Opt :: Edit ( opts) => edit ( opts) . await ,
437
446
Opt :: UsrOverlay => usroverlay ( ) . await ,
447
+ Opt :: Config ( opts) => crate :: config:: run ( opts) . await ,
438
448
#[ cfg( feature = "install" ) ]
439
449
Opt :: Install ( opts) => crate :: install:: install ( opts) . await ,
440
450
#[ cfg( feature = "install" ) ]
0 commit comments