Skip to content

Commit 9f4b9f6

Browse files
committed
[build] Canonicalise image type configuration
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>
1 parent c7403e7 commit 9f4b9f6

File tree

5 files changed

+50
-39
lines changed

5 files changed

+50
-39
lines changed

src/config/defaults/efi.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ FILE_SECBOOT ( PERMITTED );
3636

3737
#define DOWNLOAD_PROTO_FILE /* Local filesystem access */
3838

39-
#define IMAGE_EFI /* EFI image support */
40-
#define IMAGE_SCRIPT /* iPXE script image support */
41-
#define IMAGE_EFISIG /* EFI signature list support */
42-
4339
#define SANBOOT_PROTO_ISCSI /* iSCSI protocol */
4440
#define SANBOOT_PROTO_AOE /* AoE protocol */
4541
#define SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */
@@ -71,7 +67,6 @@ FILE_SECBOOT ( PERMITTED );
7167
#endif
7268

7369
#if defined ( __aarch64__ )
74-
#define IMAGE_GZIP /* GZIP image support */
7570
#define FDT_CMD
7671
#endif
7772

src/config/defaults/linux.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
2828

2929
#define DRIVERS_LINUX
3030

31-
#define IMAGE_SCRIPT
32-
3331
#define SANBOOT_PROTO_ISCSI
3432
#define SANBOOT_PROTO_AOE
3533
#define SANBOOT_PROTO_IB_SRP

src/config/defaults/pcbios.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
3434
#define IOMAP_VIRT
3535
#endif
3636

37-
#define IMAGE_ELF /* ELF image support */
38-
#define IMAGE_MULTIBOOT /* MultiBoot image support */
39-
#define IMAGE_PXE /* PXE image support */
40-
#define IMAGE_SCRIPT /* iPXE script image support */
41-
#define IMAGE_BZIMAGE /* Linux bzImage image support */
42-
4337
#define PXE_STACK /* PXE stack in iPXE - required for PXELINUX */
4438
#define PXE_MENU /* PXE menu booting */
4539

src/config/defaults/sbi.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
3737
#define SMBIOS_NULL
3838
#define TIME_NULL
3939

40-
#define IMAGE_SCRIPT
41-
#define IMAGE_LKRN
42-
#define IMAGE_GZIP
43-
4440
#define REBOOT_CMD
4541
#define POWEROFF_CMD
4642
#define FDT_CMD

src/config/general.h

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,58 @@ FILE_SECBOOT ( PERMITTED );
106106

107107
#define DNS_RESOLVER /* DNS resolver */
108108

109-
/*
109+
/*****************************************************************************
110+
*
110111
* Image types
111112
*
112-
* Etherboot supports various image formats. Select whichever ones
113-
* you want to use.
114-
*
115-
*/
116-
//#define IMAGE_NBI /* NBI image support */
117-
//#define IMAGE_ELF /* ELF image support */
118-
//#define IMAGE_MULTIBOOT /* MultiBoot image support */
119-
//#define IMAGE_PXE /* PXE image support */
120-
//#define IMAGE_SCRIPT /* iPXE script image support */
121-
//#define IMAGE_LKRN /* Linux kernel image support */
122-
//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
123-
//#define IMAGE_EFI /* EFI image support */
124-
//#define IMAGE_SDI /* SDI image support */
125-
//#define IMAGE_PNM /* PNM image support */
126-
#define IMAGE_PNG /* PNG image support */
127-
#define IMAGE_DER /* DER image support */
128-
#define IMAGE_PEM /* PEM image support */
129-
//#define IMAGE_EFISIG /* EFI signature list image support */
130-
//#define IMAGE_ZLIB /* ZLIB image support */
131-
//#define IMAGE_GZIP /* GZIP image support */
132-
//#define IMAGE_UCODE /* Microcode update image support */
113+
* iPXE supports various image formats. Select whichever ones you
114+
* want to use.
115+
*
116+
*/
117+
118+
/* Image types supported on all platforms */
119+
#define IMAGE_DER /* ASN.1 DER-encoded image support */
120+
//#define IMAGE_GZIP /* GZIP compressed image support */
121+
#define IMAGE_PEM /* ASN.1 PEM-encoded image support */
122+
//#define IMAGE_PNM /* PNM graphical image support */
123+
#define IMAGE_PNG /* PNG graphical image support */
124+
#define IMAGE_SCRIPT /* iPXE script image support */
125+
//#define IMAGE_ZLIB /* ZLIB compressed image support */
126+
127+
/* Image types supported only on BIOS platforms */
128+
#if defined ( PLATFORM_pcbios )
129+
#define IMAGE_BZIMAGE /* Linux bzImage image support */
130+
//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
131+
#define IMAGE_ELF /* ELF image support */
132+
#define IMAGE_MULTIBOOT /* MultiBoot image support */
133+
//#define IMAGE_NBI /* NBI image support */
134+
#define IMAGE_PXE /* PXE image support */
135+
//#define IMAGE_SDI /* SDI image support */
136+
#endif
137+
138+
/* Image types supported only on EFI platforms */
139+
#if defined ( PLATFORM_efi )
140+
#define IMAGE_EFI /* EFI image support */
141+
#define IMAGE_EFISIG /* EFI signature list image support */
142+
#endif
143+
144+
/* Image types supported only on RISC-V SBI platforms */
145+
#if defined ( PLATFORM_sbi )
146+
#define IMAGE_LKRN /* Linux kernel image support */
147+
#endif
148+
149+
/* Image types supported only on x86 CPUs */
150+
#if defined ( __i386__ ) || defined ( __x86_64__ )
151+
//#define IMAGE_UCODE /* Microcode update image support */
152+
#endif
153+
154+
/* Enable commonly encountered compressed versions of some image types */
155+
#if defined ( IMAGE_EFI ) && defined ( __aarch64__ )
156+
#define IMAGE_GZIP
157+
#endif
158+
#if defined ( IMAGE_LKRN ) && defined ( __riscv )
159+
#define IMAGE_GZIP
160+
#endif
133161

134162
/*
135163
* Command-line commands to include

0 commit comments

Comments
 (0)