[build] Canonicalise command list configuration

Move all command selection from config/defaults/<platform>.h to the
top-level config/general.h, using indented conditional blocks to
clarify which commands are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-01-16 12:05:38 +00:00
parent 9f4b9f60fe
commit e72c331aa7
5 changed files with 61 additions and 55 deletions

View File

@@ -26,7 +26,6 @@ FILE_SECBOOT ( PERMITTED );
#define TIME_EFI
#define REBOOT_EFI
#define ACPI_EFI
#define FDT_EFI
#define MPAPI_EFI
#define NAP_EFI
#define SERIAL_SPCR
@@ -48,8 +47,6 @@ FILE_SECBOOT ( PERMITTED );
#define USB_EFI /* Provide EFI_USB_IO_PROTOCOL interface */
#define USB_BLOCK /* USB block devices */
#define REBOOT_CMD /* Reboot command */
#define EFI_SETTINGS /* EFI variable settings */
#define CERTS_EFI /* EFI certificate sources */
@@ -57,26 +54,23 @@ FILE_SECBOOT ( PERMITTED );
#if defined ( __i386__ ) || defined ( __x86_64__ )
#define IOAPI_X86
#define ENTROPY_RDRAND
#define CPUID_CMD /* x86 CPU feature detection command */
#define UNSAFE_STD /* Avoid setting direction flag */
#define FDT_NULL
#endif
#if defined ( __arm__ ) || defined ( __aarch64__ )
#define IOAPI_ARM
#define FDT_CMD
#endif
#if defined ( __aarch64__ )
#define FDT_CMD
#define FDT_EFI
#endif
#if defined ( __loongarch__ )
#define IOAPI_LOONG64
#define FDT_EFI
#endif
#if defined ( __riscv )
#define IOAPI_RISCV
#define FDT_CMD
#define FDT_EFI
#endif
#endif /* CONFIG_DEFAULTS_EFI_H */

View File

@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define ACPI_LINUX
#define MPAPI_NULL
#define SERIAL_NULL
#define FDT_NULL
#define DRIVERS_LINUX

View File

@@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ACPI_RSDP
#define MPAPI_PCBIOS
#define SERIAL_SPCR
#define FDT_NULL
#ifdef __x86_64__
#define IOMAP_PAGES
@@ -49,7 +50,4 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define USB_KEYBOARD /* USB keyboards */
#define USB_BLOCK /* USB block devices */
#define REBOOT_CMD /* Reboot command */
#define CPUID_CMD /* x86 CPU feature detection command */
#endif /* CONFIG_DEFAULTS_PCBIOS_H */

View File

@@ -22,6 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define DMAAPI_FLAT
#endif
#define FDT_SBI
#define CONSOLE_SBI
#define CONSOLE_SERIAL
#define REBOOT_SBI
@@ -37,8 +38,4 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define SMBIOS_NULL
#define TIME_NULL
#define REBOOT_CMD
#define POWEROFF_CMD
#define FDT_CMD
#endif /* CONFIG_DEFAULTS_SBI_H */

View File

@@ -159,50 +159,66 @@ FILE_SECBOOT ( PERMITTED );
#define IMAGE_GZIP
#endif
/*
* Command-line commands to include
/*****************************************************************************
*
* Command-line and script commands to include
*
*/
#define AUTOBOOT_CMD /* Automatic booting */
#define NVO_CMD /* Non-volatile option storage commands */
#define CONFIG_CMD /* Option configuration console */
#define IFMGMT_CMD /* Interface management commands */
#define IWMGMT_CMD /* Wireless interface management commands */
#define IBMGMT_CMD /* Infiniband management commands */
#define FCMGMT_CMD /* Fibre Channel management commands */
#define ROUTE_CMD /* Routing table management commands */
#define IMAGE_CMD /* Image management commands */
#define DHCP_CMD /* DHCP management commands */
#define SANBOOT_CMD /* SAN boot commands */
#define MENU_CMD /* Menu commands */
#define FORM_CMD /* Form commands */
#define LOGIN_CMD /* Login command */
#define SYNC_CMD /* Sync command */
#define SHELL_CMD /* Shell command */
//#define NSLOOKUP_CMD /* DNS resolving command */
//#define TIME_CMD /* Time commands */
//#define DIGEST_CMD /* Image crypto digest commands */
//#define LOTEST_CMD /* Loopback testing commands */
//#define VLAN_CMD /* VLAN commands */
//#define PXE_CMD /* PXE commands */
//#define REBOOT_CMD /* Reboot command */
//#define POWEROFF_CMD /* Power off command */
//#define IMAGE_TRUST_CMD /* Image trust management commands */
//#define IMAGE_CRYPT_CMD /* Image encryption management commands */
//#define PCI_CMD /* PCI commands */
//#define PARAM_CMD /* Request parameter commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
//#define PING_CMD /* Ping command */
//#define CONSOLE_CMD /* Console command */
//#define IPSTAT_CMD /* IP statistics commands */
//#define PROFSTAT_CMD /* Profiling commands */
//#define NTP_CMD /* NTP commands */
/* Commands supported on all platforms */
#define AUTOBOOT_CMD /* Automatic booting */
//#define CERT_CMD /* Certificate management commands */
//#define IMAGE_MEM_CMD /* Read memory command */
#define CONFIG_CMD /* Option configuration console */
//#define CONSOLE_CMD /* Console command */
//#define DIGEST_CMD /* Image crypto digest commands */
#define DHCP_CMD /* DHCP management commands */
#define FCMGMT_CMD /* Fibre Channel management commands */
#define FORM_CMD /* Form commands */
#define IBMGMT_CMD /* Infiniband management commands */
#define IFMGMT_CMD /* Interface management commands */
#define IMAGE_CMD /* Image management commands */
#define IMAGE_ARCHIVE_CMD /* Archive image management commands */
//#define IMAGE_CRYPT_CMD /* Image encryption management commands */
//#define IMAGE_MEM_CMD /* Read memory command */
//#define IMAGE_TRUST_CMD /* Image trust management commands */
//#define IPSTAT_CMD /* IP statistics commands */
#define IWMGMT_CMD /* Wireless interface management commands */
#define LOGIN_CMD /* Login command */
//#define LOTEST_CMD /* Loopback testing commands */
#define MENU_CMD /* Menu commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
//#define NSLOOKUP_CMD /* DNS resolving command */
//#define NTP_CMD /* NTP commands */
#define NVO_CMD /* Non-volatile option storage commands */
//#define PARAM_CMD /* Request parameter commands */
//#define PCI_CMD /* PCI commands */
//#define PING_CMD /* Ping command */
//#define PROFSTAT_CMD /* Profiling commands */
//#define PXE_CMD /* PXE commands */
#define ROUTE_CMD /* Routing table management commands */
#define SANBOOT_CMD /* SAN boot commands */
#define SHELL_CMD /* Shell command */
#define SHIM_CMD /* EFI shim command (or dummy command) */
#define SYNC_CMD /* Sync command */
//#define TIME_CMD /* Time commands */
//#define USB_CMD /* USB commands */
//#define FDT_CMD /* Flattened Device Tree commands */
//#define VLAN_CMD /* VLAN commands */
/* Commands supported only on systems capable of rebooting */
#if ! defined ( REBOOT_NULL )
#define POWEROFF_CMD /* Power off command */
#define REBOOT_CMD /* Reboot command */
#endif
/* Commands supported only on systems that may use FDTs */
#if ! defined ( FDT_NULL )
#define FDT_CMD /* Flattened Device Tree commands */
#endif
/* Commands supported only on x86 CPUs */
#if defined ( __i386__ ) || defined ( __x86_64__ )
#define CPUID_CMD /* x86 CPU feature detection command */
#endif
/*
* Certificate sources