@@ -182,6 +182,15 @@ pub(crate) enum InstallOpts {
182
182
/// will be wiped, but the content of the existing root will otherwise be retained, and will
183
183
/// need to be cleaned up if desired when rebooted into the new root.
184
184
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 { } ,
185
194
/// Output JSON to stdout that contains the merged installation configuration
186
195
/// as it may be relevant to calling processes using `install to-filesystem`
187
196
/// that in particular want to discover the desired root filesystem type from the container image.
@@ -346,6 +355,15 @@ pub(crate) enum InternalsOpts {
346
355
#[ clap( allow_hyphen_values = true ) ]
347
356
args : Vec < OsString > ,
348
357
} ,
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
+ } ,
349
367
}
350
368
351
369
#[ derive( Debug , clap:: Subcommand , PartialEq , Eq ) ]
@@ -989,6 +1007,10 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
989
1007
crate :: install:: install_to_existing_root ( opts) . await
990
1008
}
991
1009
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
+ }
992
1014
} ,
993
1015
#[ cfg( feature = "install" ) ]
994
1016
Opt :: ExecInHostMountNamespace { args } => {
@@ -1026,6 +1048,11 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
1026
1048
let sysroot = get_storage ( ) . await ?;
1027
1049
crate :: deploy:: cleanup ( & sysroot) . await
1028
1050
}
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
+ }
1029
1056
} ,
1030
1057
#[ cfg( feature = "docgen" ) ]
1031
1058
Opt :: Man ( manopts) => crate :: docgen:: generate_manpages ( & manopts. directory ) ,
0 commit comments