@@ -182,6 +182,15 @@ pub(crate) enum InstallOpts {
182182 /// will be wiped, but the content of the existing root will otherwise be retained, and will
183183 /// need to be cleaned up if desired when rebooted into the new root.
184184 ToExistingRoot ( crate :: install:: InstallToExistingRootOpts ) ,
185+ /// Intended for use in environments that are performing an ostree-based installation, not bootc.
186+ ///
187+ /// In this scenario the installation may be missing bootc specific features such as
188+ /// kernel arguments, logically bound images and more. This command can be used to attempt
189+ /// to reconcile. At the current time, the only tested environment is Anaconda using `ostreecontainer`
190+ /// and it is recommended to avoid usage outside of that environment. Instead, ensure your
191+ /// code is using `bootc install to-filesystem` from the start.
192+ #[ clap( hide = true ) ]
193+ EnsureCompletion { } ,
185194 /// Output JSON to stdout that contains the merged installation configuration
186195 /// as it may be relevant to calling processes using `install to-filesystem`
187196 /// that in particular want to discover the desired root filesystem type from the container image.
@@ -346,6 +355,15 @@ pub(crate) enum InternalsOpts {
346355 #[ clap( allow_hyphen_values = true ) ]
347356 args : Vec < OsString > ,
348357 } ,
358+ #[ cfg( feature = "install" ) ]
359+ /// Invoked from ostree-ext to complete an installation.
360+ BootcInstallCompletion {
361+ /// Path to the sysroot
362+ sysroot : Utf8PathBuf ,
363+
364+ // The stateroot
365+ stateroot : String ,
366+ } ,
349367}
350368
351369#[ derive( Debug , clap:: Subcommand , PartialEq , Eq ) ]
@@ -989,6 +1007,10 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
9891007 crate :: install:: install_to_existing_root ( opts) . await
9901008 }
9911009 InstallOpts :: PrintConfiguration => crate :: install:: print_configuration ( ) ,
1010+ InstallOpts :: EnsureCompletion { } => {
1011+ let rootfs = & Dir :: open_ambient_dir ( "/" , cap_std:: ambient_authority ( ) ) ?;
1012+ crate :: install:: completion:: run_from_anaconda ( rootfs) . await
1013+ }
9921014 } ,
9931015 #[ cfg( feature = "install" ) ]
9941016 Opt :: ExecInHostMountNamespace { args } => {
@@ -1026,6 +1048,11 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
10261048 let sysroot = get_storage ( ) . await ?;
10271049 crate :: deploy:: cleanup ( & sysroot) . await
10281050 }
1051+ #[ cfg( feature = "install" ) ]
1052+ InternalsOpts :: BootcInstallCompletion { sysroot, stateroot } => {
1053+ let rootfs = & Dir :: open_ambient_dir ( "/" , cap_std:: ambient_authority ( ) ) ?;
1054+ crate :: install:: completion:: run_from_ostree ( rootfs, & sysroot, & stateroot) . await
1055+ }
10291056 } ,
10301057 #[ cfg( feature = "docgen" ) ]
10311058 Opt :: Man ( manopts) => crate :: docgen:: generate_manpages ( & manopts. directory ) ,
0 commit comments