@@ -14,6 +14,7 @@ use ostree_ext::container as ostree_container;
1414use ostree_ext:: container:: SignatureSource ;
1515use ostree_ext:: keyfileext:: KeyFileExt ;
1616use ostree_ext:: ostree;
17+ use ostree_ext:: sysroot:: SysrootLock ;
1718use std:: ffi:: OsString ;
1819use std:: io:: Seek ;
1920use std:: os:: unix:: process:: CommandExt ;
@@ -129,6 +130,9 @@ pub(crate) enum Opt {
129130 /// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
130131 #[ clap( alias = "usroverlay" ) ]
131132 UsrOverlay ,
133+ /// Manipulate configuration
134+ #[ clap( subcommand) ]
135+ Config ( crate :: config:: ConfigOpts ) ,
132136 /// Install to the target block device
133137 #[ cfg( feature = "install" ) ]
134138 Install ( crate :: install:: InstallOpts ) ,
@@ -254,6 +258,11 @@ pub(crate) async fn prepare_for_write() -> Result<()> {
254258 Ok ( ( ) )
255259}
256260
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+
257266/// Implementation of the `bootc upgrade` CLI command.
258267#[ context( "Upgrading" ) ]
259268async fn upgrade ( opts : UpgradeOpts ) -> Result < ( ) > {
@@ -435,6 +444,7 @@ where
435444 Opt :: Switch ( opts) => switch ( opts) . await ,
436445 Opt :: Edit ( opts) => edit ( opts) . await ,
437446 Opt :: UsrOverlay => usroverlay ( ) . await ,
447+ Opt :: Config ( opts) => crate :: config:: run ( opts) . await ,
438448 #[ cfg( feature = "install" ) ]
439449 Opt :: Install ( opts) => crate :: install:: install ( opts) . await ,
440450 #[ cfg( feature = "install" ) ]
0 commit comments