[Buildroot] [PATCH 3/3] package/edk2-non-osi: add custom version option

Vincent Stehlé vincent.stehle at arm.com
Fri Apr 11 17:29:44 UTC 2025


Add a custom version option, to enable easily specifying an official EDK
II Non-OSI platforms version to use. This is similar to what is done in
other packages, such as linux, uboot, optee_os or arm-trusted-firmware.

Move the default version definition from edk2-non-osi makefile to the
config menu to support that. Also, we need to make edk2-non-osi appear
in the menu to allow selecting the version. We keep the same latest
version by default to preserve current behaviour.

Also, add a check of the custom version option validity in edk2-non-osi
makefile.

Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
---
 package/edk2-non-osi/Config.in       | 36 +++++++++++++++++++++++++++-
 package/edk2-non-osi/edk2-non-osi.mk | 17 +++++++++++--
 2 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/package/edk2-non-osi/Config.in b/package/edk2-non-osi/Config.in
index 6c540c8a40..88f4d52673 100644
--- a/package/edk2-non-osi/Config.in
+++ b/package/edk2-non-osi/Config.in
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_EDK2_NON_OSI
-	bool
+	bool "EDK2 Non-OSI platforms"
 	help
 	  EDK2 description files for additional platforms, not
 	  compatible with the normal licensing requirements.
@@ -9,3 +9,37 @@ config BR2_PACKAGE_EDK2_NON_OSI
 	  Only the Marvell Armada files are copied at this point.
 
 	  https://github.com/tianocore/edk2-non-osi
+
+if BR2_PACKAGE_EDK2_NON_OSI
+
+choice
+	prompt "EDK2 Non-OSI platforms version"
+	default BR2_PACKAGE_EDK2_NON_OSI_LATEST
+	help
+	  Select the specific EDK2 Non-OSI platforms version you want
+	  to use
+
+config BR2_PACKAGE_EDK2_NON_OSI_LATEST
+	# Keep in sync with latest commit as of the release date for boot/edk2
+	bool "8c09bd0955338db38813e0d8ae1faa634f545f73"
+
+config BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION
+	bool "Custom version"
+	help
+	  This option allows to use a specific official version
+
+endchoice
+
+config BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION_VALUE
+	string "EDK2 Non-OSI platforms version"
+	depends on BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION
+
+config BR2_PACKAGE_EDK2_NON_OSI_VERSION
+	string
+	# Keep in sync with latest commit as of the release date for boot/edk2
+	default "8c09bd0955338db38813e0d8ae1faa634f545f73" \
+	        if BR2_PACKAGE_EDK2_NON_OSI_LATEST
+	default BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION_VALUE \
+	        if BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION
+
+endif
diff --git a/package/edk2-non-osi/edk2-non-osi.mk b/package/edk2-non-osi/edk2-non-osi.mk
index d787c882b3..204768d2ae 100644
--- a/package/edk2-non-osi/edk2-non-osi.mk
+++ b/package/edk2-non-osi/edk2-non-osi.mk
@@ -4,8 +4,7 @@
 #
 ################################################################################
 
-# Keep in sync with latest commit as of the release date for boot/edk2
-EDK2_NON_OSI_VERSION = 8c09bd0955338db38813e0d8ae1faa634f545f73
+EDK2_NON_OSI_VERSION = $(call qstrip,$(BR2_PACKAGE_EDK2_NON_OSI_VERSION))
 EDK2_NON_OSI_SITE = $(call github,tianocore,edk2-non-osi,$(EDK2_NON_OSI_VERSION))
 EDK2_NON_OSI_INSTALL_TARGET = NO
 EDK2_NON_OSI_INSTALL_STAGING = YES
@@ -24,4 +23,18 @@ define EDK2_NON_OSI_INSTALL_STAGING_CMDS
 	)
 endef
 
+ifeq ($(BR2_PACKAGE_EDK2_NON_OSI)$(BR_BUILDING),yy)
+
+#
+# Check custom version option
+#
+ifeq ($(BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION_VALUE)),)
+$(error No custom edk2-non-osi version specified. \
+	Check your BR2_PACKAGE_EDK2_NON_OSI_CUSTOM_VERSION_VALUE setting)
+endif
+endif
+
+endif # BR2_PACKAGE_EDK2_NON_OSI and BR_BUILDING
+
 $(eval $(generic-package))
-- 
2.47.2



More information about the buildroot mailing list