From 9868f67d38c598663b72e8d2b8878380303a76de Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Sun, 4 Jan 2026 14:47:55 +0100 Subject: [PATCH] boot/edk2: add a new Kconfig option to pass arbitrary build options EDK2 build may include extra options. Those are usually in the form of "-D SOMEFLAG_ENABLE" and might be specific for a processor architecture or a platform. For example: "-D NETWORK_HTTP_BOOT_ENABLE", "-D NETWORK_TLS_ENABLE", ... Those options are generally documented in their respective packages. See for example: https://github.com/tianocore/edk2/blob/master/OvmfPkg/README This commit adds a new Kconfig string option to let the use define arbitrary build flags. Signed-off-by: Julien Olivain Signed-off-by: Thomas Petazzoni --- boot/edk2/Config.in | 15 +++++++++++++++ boot/edk2/edk2.mk | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in index 850b9a39de..168fc296a2 100644 --- a/boot/edk2/Config.in +++ b/boot/edk2/Config.in @@ -130,6 +130,21 @@ config BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL See OVMF README: https://github.com/tianocore/edk2/blob/master/OvmfPkg/README +config BR2_TARGET_EDK2_EXTRA_BUILD_OPTS + string "Extra build options" + help + EDK2 build may include extra options. Those are usually in + the form of "-D SOMEFLAG_ENABLE" and might be specific for a + processor architecture or a platform. For example: "-D + NETWORK_HTTP_BOOT_ENABLE", "-D NETWORK_TLS_ENABLE", ... + + Those options are generally documented in their respective + packages. See for example: + https://github.com/tianocore/edk2/blob/master/OvmfPkg/README + + This configuration is an arbitrary string that will be + passed to the build command. + config BR2_TARGET_EDK2_FD_NAME string default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_I386 diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk index 05e44c711b..2c089aefca 100644 --- a/boot/edk2/edk2.mk +++ b/boot/edk2/edk2.mk @@ -156,7 +156,8 @@ EDK2_BUILD_OPTS += \ -n $(BR2_JLEVEL) \ -a $(EDK2_ARCH) \ -b $(EDK2_BUILD_TYPE) \ - -p $(EDK2_PACKAGE_NAME)/$(EDK2_PLATFORM_NAME).dsc + -p $(EDK2_PACKAGE_NAME)/$(EDK2_PLATFORM_NAME).dsc \ + $(call qstrip,$(BR2_TARGET_EDK2_EXTRA_BUILD_OPTS)) define EDK2_BUILD_CMDS mkdir -p $(EDK2_BUILD_PACKAGES)