]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Canonicalise image type configuration
authorMichael Brown <mcb30@ipxe.org>
Thu, 15 Jan 2026 16:14:19 +0000 (16:14 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 15 Jan 2026 16:46:38 +0000 (16:46 +0000)
Move all image type selection from config/defaults/<platform>.h to the
top-level config/general.h, using indented conditional blocks to
clarify which image types are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/config/defaults/efi.h
src/config/defaults/linux.h
src/config/defaults/pcbios.h
src/config/defaults/sbi.h
src/config/general.h

index 524b2b0ea069d31d7d4fcf5de93f95a8a1e65b4d..898e3194da7e55f3737a28593a42babf211ebe46 100644 (file)
@@ -36,10 +36,6 @@ FILE_SECBOOT ( PERMITTED );
 
 #define DOWNLOAD_PROTO_FILE    /* Local filesystem access */
 
-#define        IMAGE_EFI               /* EFI image support */
-#define        IMAGE_SCRIPT            /* iPXE script image support */
-#define IMAGE_EFISIG           /* EFI signature list support */
-
 #define        SANBOOT_PROTO_ISCSI     /* iSCSI protocol */
 #define        SANBOOT_PROTO_AOE       /* AoE protocol */
 #define        SANBOOT_PROTO_IB_SRP    /* Infiniband SCSI RDMA protocol */
@@ -71,7 +67,6 @@ FILE_SECBOOT ( PERMITTED );
 #endif
 
 #if defined ( __aarch64__ )
-#define        IMAGE_GZIP              /* GZIP image support */
 #define FDT_CMD
 #endif
 
index 4fb9ad6f39e4ec02a53a54771bda85fd0148fba2..28d9812398bca00f829c6cc1e8a77a078050380a 100644 (file)
@@ -28,8 +28,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 #define DRIVERS_LINUX
 
-#define IMAGE_SCRIPT
-
 #define SANBOOT_PROTO_ISCSI
 #define SANBOOT_PROTO_AOE
 #define SANBOOT_PROTO_IB_SRP
index 3f24f1b7b6da807a5b5c080b16a39759b9ed4778..f7515b51a3be79db284c5ced402f7055455c7191 100644 (file)
@@ -34,12 +34,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #define IOMAP_VIRT
 #endif
 
-#define        IMAGE_ELF               /* ELF image support */
-#define        IMAGE_MULTIBOOT         /* MultiBoot image support */
-#define        IMAGE_PXE               /* PXE image support */
-#define IMAGE_SCRIPT           /* iPXE script image support */
-#define IMAGE_BZIMAGE          /* Linux bzImage image support */
-
 #define PXE_STACK              /* PXE stack in iPXE - required for PXELINUX */
 #define PXE_MENU               /* PXE menu booting */
 
index de3c9ca790c0bba8ef09f2016cca8d7e22c1c7aa..93d2f44577fc19ebc75ed71e203edb0bdc9a8eb3 100644 (file)
@@ -37,10 +37,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #define SMBIOS_NULL
 #define TIME_NULL
 
-#define IMAGE_SCRIPT
-#define IMAGE_LKRN
-#define IMAGE_GZIP
-
 #define REBOOT_CMD
 #define POWEROFF_CMD
 #define FDT_CMD
index f7724883665ee454b95d2483d8b3354a6ffa0df5..e907074cd1218aa405a08b3b2014f1132ab1b94f 100644 (file)
@@ -106,30 +106,58 @@ FILE_SECBOOT ( PERMITTED );
 
 #define        DNS_RESOLVER            /* DNS resolver */
 
-/*
+/*****************************************************************************
+ *
  * Image types
  *
- * Etherboot supports various image formats.  Select whichever ones
- * you want to use.
- *
- */
-//#define      IMAGE_NBI               /* NBI image support */
-//#define      IMAGE_ELF               /* ELF image support */
-//#define      IMAGE_MULTIBOOT         /* MultiBoot image support */
-//#define      IMAGE_PXE               /* PXE image support */
-//#define      IMAGE_SCRIPT            /* iPXE script image support */
-//#define      IMAGE_LKRN              /* Linux kernel image support */
-//#define      IMAGE_COMBOOT           /* SYSLINUX COMBOOT image support */
-//#define      IMAGE_EFI               /* EFI image support */
-//#define      IMAGE_SDI               /* SDI image support */
-//#define      IMAGE_PNM               /* PNM image support */
-#define        IMAGE_PNG               /* PNG image support */
-#define        IMAGE_DER               /* DER image support */
-#define        IMAGE_PEM               /* PEM image support */
-//#define      IMAGE_EFISIG            /* EFI signature list image support */
-//#define      IMAGE_ZLIB              /* ZLIB image support */
-//#define      IMAGE_GZIP              /* GZIP image support */
-//#define      IMAGE_UCODE             /* Microcode update image support */
+ * iPXE supports various image formats.  Select whichever ones you
+ * want to use.
+ *
+ */
+
+/* Image types supported on all platforms */
+#define IMAGE_DER              /* ASN.1 DER-encoded image support */
+//#define IMAGE_GZIP           /* GZIP compressed image support */
+#define IMAGE_PEM              /* ASN.1 PEM-encoded image support */
+//#define IMAGE_PNM            /* PNM graphical image support */
+#define IMAGE_PNG              /* PNG graphical image support */
+#define IMAGE_SCRIPT           /* iPXE script image support */
+//#define IMAGE_ZLIB           /* ZLIB compressed image support */
+
+/* Image types supported only on BIOS platforms */
+#if defined ( PLATFORM_pcbios )
+  #define IMAGE_BZIMAGE                /* Linux bzImage image support */
+  //#define IMAGE_COMBOOT      /* SYSLINUX COMBOOT image support */
+  #define IMAGE_ELF            /* ELF image support */
+  #define IMAGE_MULTIBOOT      /* MultiBoot image support */
+  //#define IMAGE_NBI          /* NBI image support */
+  #define IMAGE_PXE            /* PXE image support */
+  //#define IMAGE_SDI          /* SDI image support */
+#endif
+
+/* Image types supported only on EFI platforms */
+#if defined ( PLATFORM_efi )
+  #define IMAGE_EFI            /* EFI image support */
+  #define IMAGE_EFISIG         /* EFI signature list image support */
+#endif
+
+/* Image types supported only on RISC-V SBI platforms */
+#if defined ( PLATFORM_sbi )
+  #define IMAGE_LKRN           /* Linux kernel image support */
+#endif
+
+/* Image types supported only on x86 CPUs */
+#if defined ( __i386__ ) || defined ( __x86_64__ )
+  //#define IMAGE_UCODE                /* Microcode update image support */
+#endif
+
+/* Enable commonly encountered compressed versions of some image types */
+#if defined ( IMAGE_EFI ) && defined ( __aarch64__ )
+  #define IMAGE_GZIP
+#endif
+#if defined ( IMAGE_LKRN ) && defined ( __riscv )
+  #define IMAGE_GZIP
+#endif
 
 /*
  * Command-line commands to include