[Buildroot] [PATCH 2/3] package/edk2-platforms: add custom version option
Vincent Stehlé
vincent.stehle at arm.com
Fri Apr 11 17:29:43 UTC 2025
Add a custom version option, to enable easily specifying an official EDK
II 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-platforms makefile to the
config menu to support that. Also, we need to make edk2-platforms 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-platforms makefile.
Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
Cc: Dick Olsson <hi at senzilla.io>
---
package/edk2-platforms/Config.in | 35 +++++++++++++++++++++++-
package/edk2-platforms/edk2-platforms.mk | 17 ++++++++++--
2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/package/edk2-platforms/Config.in b/package/edk2-platforms/Config.in
index 17633c0fdd..2527c6eb3e 100644
--- a/package/edk2-platforms/Config.in
+++ b/package/edk2-platforms/Config.in
@@ -1,8 +1,41 @@
config BR2_PACKAGE_EDK2_PLATFORMS
- bool
+ bool "EDK2 Platforms"
help
EDK2 description files for all supported platforms.
The main EDK2 bootloader package will depend on these
description files while building firmware for some platforms.
https://github.com/tianocore/edk2-platforms
+
+if BR2_PACKAGE_EDK2_PLATFORMS
+
+choice
+ prompt "EDK2 Platforms version"
+ default BR2_PACKAGE_EDK2_PLATFORMS_LATEST
+ help
+ Select the specific EDK2 Platforms version you want to use
+
+config BR2_PACKAGE_EDK2_PLATFORMS_LATEST
+ # Keep in sync with latest commit as of the release date for boot/edk2
+ bool "f10cc760cf3f7eb693822de1347e71173944e44a"
+
+config BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION
+ bool "Custom version"
+ help
+ This option allows to use a specific official version
+
+endchoice
+
+config BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION_VALUE
+ string "EDK2 Platforms version"
+ depends on BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION
+
+config BR2_PACKAGE_EDK2_PLATFORMS_VERSION
+ string
+ # Keep in sync with latest commit as of the release date for boot/edk2
+ default "f10cc760cf3f7eb693822de1347e71173944e44a" \
+ if BR2_PACKAGE_EDK2_PLATFORMS_LATEST
+ default BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION_VALUE \
+ if BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION
+
+endif
diff --git a/package/edk2-platforms/edk2-platforms.mk b/package/edk2-platforms/edk2-platforms.mk
index 65fcf81a3c..e7cd67555a 100644
--- a/package/edk2-platforms/edk2-platforms.mk
+++ b/package/edk2-platforms/edk2-platforms.mk
@@ -4,8 +4,7 @@
#
################################################################################
-# Keep in sync with latest commit as of the release date for boot/edk2
-EDK2_PLATFORMS_VERSION = f10cc760cf3f7eb693822de1347e71173944e44a
+EDK2_PLATFORMS_VERSION = $(call qstrip,$(BR2_PACKAGE_EDK2_PLATFORMS_VERSION))
EDK2_PLATFORMS_SITE = $(call github,tianocore,edk2-platforms,$(EDK2_PLATFORMS_VERSION))
EDK2_PLATFORMS_LICENSE = BSD-2-Clause-Patent
EDK2_PLATFORMS_LICENSE_FILES = License.txt
@@ -19,4 +18,18 @@ define EDK2_PLATFORMS_INSTALL_STAGING_CMDS
cp -rf $(@D)/*/ $(STAGING_DIR)/usr/share/edk2-platforms/
endef
+ifeq ($(BR2_PACKAGE_EDK2_PLATFORMS)$(BR_BUILDING),yy)
+
+#
+# Check custom version option
+#
+ifeq ($(BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION_VALUE)),)
+$(error No custom edk2-platforms version specified. \
+ Check your BR2_PACKAGE_EDK2_PLATFORMS_CUSTOM_VERSION_VALUE setting)
+endif
+endif
+
+endif # BR2_PACKAGE_EDK2_PLATFORMS and BR_BUILDING
+
$(eval $(generic-package))
--
2.47.2
More information about the buildroot
mailing list