@@ -53,7 +53,6 @@ use serde::{Deserialize, Serialize};
5353
5454#[ cfg( feature = "install-to-disk" ) ]
5555use self :: baseline:: InstallBlockDeviceOpts ;
56- #[ cfg( feature = "composefs-backend" ) ]
5756use crate :: bootc_composefs:: { boot:: setup_composefs_boot, repo:: initialize_composefs_repository} ;
5857use crate :: boundimage:: { BoundImage , ResolvedBoundImage } ;
5958use crate :: containerenv:: ContainerExecutionInfo ;
@@ -66,7 +65,6 @@ use crate::task::Task;
6665use crate :: utils:: sigpolicy_from_opt;
6766use bootc_kernel_cmdline:: { bytes, utf8, INITRD_ARG_PREFIX , ROOTFLAGS } ;
6867use bootc_mount:: Filesystem ;
69- #[ cfg( feature = "composefs-backend" ) ]
7068use composefs:: fsverity:: FsVerityHashValue ;
7169
7270/// The toplevel boot directory
@@ -88,7 +86,6 @@ const SELINUXFS: &str = "/sys/fs/selinux";
8886pub ( crate ) const EFIVARFS : & str = "/sys/firmware/efi/efivars" ;
8987pub ( crate ) const ARCH_USES_EFI : bool = cfg ! ( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ;
9088
91- #[ cfg( feature = "composefs-backend" ) ]
9289pub ( crate ) const EFI_LOADER_INFO : & str = "LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f" ;
9390
9491const DEFAULT_REPO_CONFIG : & [ ( & str , & str ) ] = & [
@@ -278,7 +275,6 @@ pub(crate) struct InstallToDiskOpts {
278275
279276 #[ clap( flatten) ]
280277 #[ serde( flatten) ]
281- #[ cfg( feature = "composefs-backend" ) ]
282278 pub ( crate ) composefs_opts : InstallComposefsOpts ,
283279}
284280
@@ -356,7 +352,6 @@ pub(crate) struct InstallToFilesystemOpts {
356352 #[ clap( flatten) ]
357353 pub ( crate ) config_opts : InstallConfigOpts ,
358354
359- #[ cfg( feature = "composefs-backend" ) ]
360355 #[ clap( flatten) ]
361356 pub ( crate ) composefs_opts : InstallComposefsOpts ,
362357}
@@ -391,7 +386,6 @@ pub(crate) struct InstallToExistingRootOpts {
391386 #[ clap( default_value = ALONGSIDE_ROOT_MOUNT ) ]
392387 pub ( crate ) root_path : Utf8PathBuf ,
393388
394- #[ cfg( feature = "composefs-backend" ) ]
395389 #[ clap( flatten) ]
396390 pub ( crate ) composefs_opts : InstallComposefsOpts ,
397391}
@@ -434,7 +428,6 @@ pub(crate) struct State {
434428 pub ( crate ) composefs_required : bool ,
435429
436430 // If Some, then --composefs_native is passed
437- #[ cfg( feature = "composefs-backend" ) ]
438431 pub ( crate ) composefs_options : InstallComposefsOpts ,
439432
440433 /// Detected bootloader type for the target system
@@ -565,7 +558,7 @@ impl FromStr for MountSpec {
565558 }
566559}
567560
568- #[ cfg( all ( feature = "install-to-disk" , feature = "composefs-backend" ) ) ]
561+ #[ cfg( feature = "install-to-disk" ) ]
569562impl InstallToDiskOpts {
570563 pub ( crate ) fn validate ( & self ) -> Result < ( ) > {
571564 if !self . composefs_opts . composefs_backend {
@@ -1221,19 +1214,15 @@ async fn verify_target_fetch(
12211214}
12221215
12231216fn root_has_uki ( root : & Dir ) -> Result < bool > {
1224- #[ cfg( feature = "composefs-backend" ) ]
1225- return crate :: bootc_composefs:: boot:: container_root_has_uki ( root) ;
1226-
1227- #[ cfg( not( feature = "composefs-backend" ) ) ]
1228- Ok ( false )
1217+ crate :: bootc_composefs:: boot:: container_root_has_uki ( root)
12291218}
12301219
12311220/// Preparation for an install; validates and prepares some (thereafter immutable) global state.
12321221async fn prepare_install (
12331222 config_opts : InstallConfigOpts ,
12341223 source_opts : InstallSourceOpts ,
12351224 target_opts : InstallTargetOpts ,
1236- # [ cfg ( feature = "composefs-backend" ) ] mut composefs_options : InstallComposefsOpts ,
1225+ mut composefs_options : InstallComposefsOpts ,
12371226) -> Result < Arc < State > > {
12381227 tracing:: trace!( "Preparing install" ) ;
12391228 let rootfs = cap_std:: fs:: Dir :: open_ambient_dir ( "/" , cap_std:: ambient_authority ( ) )
@@ -1308,7 +1297,6 @@ async fn prepare_install(
13081297
13091298 tracing:: debug!( "Composefs required: {composefs_required}" ) ;
13101299
1311- #[ cfg( feature = "composefs-backend" ) ]
13121300 if composefs_required {
13131301 composefs_options. composefs_backend = true ;
13141302 }
@@ -1381,7 +1369,6 @@ async fn prepare_install(
13811369
13821370 // Determine bootloader type for the target system
13831371 // Priority: user-specified > bootupd availability > systemd-boot fallback
1384- #[ cfg( feature = "composefs-backend" ) ]
13851372 let detected_bootloader = {
13861373 if let Some ( bootloader) = composefs_options. bootloader . clone ( ) {
13871374 bootloader
@@ -1393,8 +1380,6 @@ async fn prepare_install(
13931380 }
13941381 }
13951382 } ;
1396- #[ cfg( not( feature = "composefs-backend" ) ) ]
1397- let detected_bootloader = crate :: spec:: Bootloader :: Grub ;
13981383 println ! ( "Bootloader: {detected_bootloader}" ) ;
13991384
14001385 // Create our global (read-only) state which gets wrapped in an Arc
@@ -1413,7 +1398,6 @@ async fn prepare_install(
14131398 host_is_container,
14141399 composefs_required,
14151400 detected_bootloader,
1416- #[ cfg( feature = "composefs-backend" ) ]
14171401 composefs_options,
14181402 } ) ;
14191403
@@ -1585,7 +1569,6 @@ async fn install_to_filesystem_impl(
15851569 }
15861570 }
15871571
1588- #[ cfg( feature = "composefs-backend" ) ]
15891572 if state. composefs_options . composefs_backend {
15901573 // Load a fd for the mounted target physical root
15911574
@@ -1596,9 +1579,6 @@ async fn install_to_filesystem_impl(
15961579 ostree_install ( state, rootfs, cleanup) . await ?;
15971580 }
15981581
1599- #[ cfg( not( feature = "composefs-backend" ) ) ]
1600- ostree_install ( state, rootfs, cleanup) . await ?;
1601-
16021582 // Finalize mounted filesystems
16031583 if !rootfs. skip_finalize {
16041584 let bootfs = rootfs. boot . as_ref ( ) . map ( |_| ( "boot" , "boot" ) ) ;
@@ -1618,7 +1598,6 @@ fn installation_complete() {
16181598#[ context( "Installing to disk" ) ]
16191599#[ cfg( feature = "install-to-disk" ) ]
16201600pub ( crate ) async fn install_to_disk ( mut opts : InstallToDiskOpts ) -> Result < ( ) > {
1621- #[ cfg( feature = "composefs-backend" ) ]
16221601 opts. validate ( ) ?;
16231602
16241603 // Log the disk installation operation to systemd journal
@@ -1667,7 +1646,6 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
16671646 opts. config_opts ,
16681647 opts. source_opts ,
16691648 opts. target_opts ,
1670- #[ cfg( feature = "composefs-backend" ) ]
16711649 opts. composefs_opts ,
16721650 )
16731651 . await ?;
@@ -1905,7 +1883,6 @@ pub(crate) async fn install_to_filesystem(
19051883 opts. config_opts ,
19061884 opts. source_opts ,
19071885 opts. target_opts ,
1908- #[ cfg( feature = "composefs-backend" ) ]
19091886 opts. composefs_opts ,
19101887 )
19111888 . await ?;
@@ -2177,7 +2154,6 @@ pub(crate) async fn install_to_existing_root(opts: InstallToExistingRootOpts) ->
21772154 source_opts : opts. source_opts ,
21782155 target_opts : opts. target_opts ,
21792156 config_opts : opts. config_opts ,
2180- #[ cfg( feature = "composefs-backend" ) ]
21812157 composefs_opts : opts. composefs_opts ,
21822158 } ;
21832159
0 commit comments