Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: buildroot@buildroot.org
Cc: "Dick Olsson" <hi@senzilla.io>,
	"Vincent Stehlé" <vincent.stehle@arm.com>,
	"Cheng Yang" <yangcheng.work@foxmail.com>
Subject: [Buildroot] [PATCH v2 2/3] package/edk2-platforms: add custom version option
Date: Sat, 21 Nov 2026 22:51:46 +0100	[thread overview]
Message-ID: <20261121215147.4121-2-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <20261121215147.4121-1-angelo.compagnucci@gmail.com>

From: Vincent Stehlé <vincent.stehle@arm.com>

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.

Skip the hash check for custom versions: the hash file only covers the
default version. optee-os and uboot do the same.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Dick Olsson <hi@senzilla.io>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Tested-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
Changes v1 -> v2:
  - rebase on master: the default version is now the edk2-platforms
    commit f8dbb5c60330 ("AmpereAltraPkg: Add support for configuring
    ASPM per root complex"), set by 2260627613cb ("boot/edk2: bump to
    version edk2-stable202608")
  - skip the hash check for custom versions, otherwise the download
    fails with "No hash found"

Supersedes v1: https://patchwork.buildroot.org/project/buildroot/patch/20250411172944.1379043-3-vincent.stehle@arm.com/

 package/edk2-platforms/Config.in         | 35 +++++++++++++++++++++++-
 package/edk2-platforms/edk2-platforms.mk | 21 ++++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/package/edk2-platforms/Config.in b/package/edk2-platforms/Config.in
index 17633c0fdd..fad0983d63 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 "f8dbb5c603302dc661f572b560bdb34f7db6edb5"
+
+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 "f8dbb5c603302dc661f572b560bdb34f7db6edb5" \
+	        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 b7cd29784a..967862b437 100644
--- a/package/edk2-platforms/edk2-platforms.mk
+++ b/package/edk2-platforms/edk2-platforms.mk
@@ -4,14 +4,17 @@
 #
 ################################################################################
 
-# Keep in sync with latest commit as of the release date for boot/edk2
-EDK2_PLATFORMS_VERSION = f8dbb5c603302dc661f572b560bdb34f7db6edb5
+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
 EDK2_PLATFORMS_INSTALL_TARGET = NO
 EDK2_PLATFORMS_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_EDK2_PLATFORMS):$(BR2_PACKAGE_EDK2_PLATFORMS_LATEST),y:)
+BR_NO_CHECK_HASH_FOR += $(EDK2_PLATFORMS_SOURCE)
+endif
+
 # There is nothing to build for edk2-platforms. All we need to do is to copy
 # all description files to staging, for other packages to build with.
 define EDK2_PLATFORMS_INSTALL_STAGING_CMDS
@@ -19,4 +22,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.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-11-21 21:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 17:29 [Buildroot] [PATCH 0/3] add custom version options for all three edk2 packages Vincent Stehlé
2025-04-11 17:29 ` [Buildroot] [PATCH 1/3] boot/edk2: add custom version option Vincent Stehlé
2025-04-11 17:29 ` [Buildroot] [PATCH 2/3] package/edk2-platforms: " Vincent Stehlé
2025-04-11 17:29 ` [Buildroot] [PATCH 3/3] package/edk2-non-osi: " Vincent Stehlé
2026-11-21 21:51 ` [Buildroot] [PATCH v2 1/3] boot/edk2: " Angelo Compagnucci
2026-11-21 21:51   ` Angelo Compagnucci [this message]
2026-11-21 21:51   ` [Buildroot] [PATCH v2 3/3] package/edk2-non-osi: " Angelo Compagnucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261121215147.4121-2-angelo.compagnucci@gmail.com \
    --to=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=hi@senzilla.io \
    --cc=vincent.stehle@arm.com \
    --cc=yangcheng.work@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox