All of 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 1/3] boot/edk2: add custom version option
Date: Sat, 21 Nov 2026 22:51:45 +0100	[thread overview]
Message-ID: <20261121215147.4121-1-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <20250411172944.1379043-1-vincent.stehle@arm.com>

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

Add a custom version option, to enable easily specifying an official EDK
II 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 makefile to the config
menu to support that. We keep the same latest version by default to
preserve current behaviour.

Also, add a check of the custom version option validity in edk2
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 edk2-stable202608
  - skip the hash check for custom versions, otherwise the download
    fails with "No hash found"
  - say in the help text that custom versions must be edk2-stable202605
    or later: older versions use the removed GCC5 toolchain name

Supersedes v1: https://patchwork.buildroot.org/project/buildroot/patch/20250411172944.1379043-2-vincent.stehle@arm.com/
Also supersedes this older patch for the same feature:
https://patchwork.buildroot.org/project/buildroot/patch/tencent_8FFB06F67FA524B2D90D051931B1F0082405@qq.com/

 boot/edk2/Config.in | 27 +++++++++++++++++++++++++++
 boot/edk2/edk2.mk   | 20 +++++++++++++++++++-
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in
index 2f4737fab9..63f44ce50e 100644
--- a/boot/edk2/Config.in
+++ b/boot/edk2/Config.in
@@ -21,6 +21,33 @@ config BR2_TARGET_EDK2
 
 if BR2_TARGET_EDK2
 
+choice
+	prompt "EDK2 version"
+	default BR2_TARGET_EDK2_LATEST
+	help
+	  Select the specific EDK2 version you want to use
+
+config BR2_TARGET_EDK2_LATEST
+	bool "edk2-stable202608"
+
+config BR2_TARGET_EDK2_CUSTOM_VERSION
+	bool "Custom version"
+	help
+	  This option allows to use a specific official version
+	  (edk2-stable202605 or later).
+
+endchoice
+
+config BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE
+	string "EDK2 version"
+	depends on BR2_TARGET_EDK2_CUSTOM_VERSION
+
+config BR2_TARGET_EDK2_VERSION
+	string
+	default "edk2-stable202608" if BR2_TARGET_EDK2_LATEST
+	default BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE \
+	        if BR2_TARGET_EDK2_CUSTOM_VERSION
+
 choice
 	prompt "Platform"
 	default BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64 if \
diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk
index 81a9dfddd3..a0732cd3ca 100644
--- a/boot/edk2/edk2.mk
+++ b/boot/edk2/edk2.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-EDK2_VERSION = edk2-stable202608
+EDK2_VERSION = $(call qstrip,$(BR2_TARGET_EDK2_VERSION))
 EDK2_SITE = https://github.com/tianocore/edk2
 EDK2_SITE_METHOD = git
 EDK2_LICENSE = BSD-2-Clause-Patent
@@ -14,6 +14,10 @@ EDK2_DEPENDENCIES = edk2-platforms host-python3 host-acpica host-util-linux
 EDK2_INSTALL_TARGET = NO
 EDK2_INSTALL_IMAGES = YES
 
+ifeq ($(BR2_TARGET_EDK2):$(BR2_TARGET_EDK2_LATEST),y:)
+BR_NO_CHECK_HASH_FOR += $(EDK2_SOURCE)
+endif
+
 ifeq ($(BR2_ENABLE_DEBUG),y)
 EDK2_BUILD_TYPE = DEBUG
 ifeq ($(BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL),y)
@@ -159,4 +163,18 @@ define EDK2_INSTALL_IMAGES_CMDS
 	cp -f $(@D)/Build/$(EDK2_BUILD_DIR)/$(EDK2_BUILD_TYPE)_GCC/FV/*.fd $(BINARIES_DIR)
 endef
 
+ifeq ($(BR2_TARGET_EDK2)$(BR_BUILDING),yy)
+
+#
+# Check custom version option
+#
+ifeq ($(BR2_TARGET_EDK2_CUSTOM_VERSION),y)
+ifeq ($(call qstrip,$(BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE)),)
+$(error No custom edk2 version specified. \
+	Check your BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE setting)
+endif
+endif
+
+endif # BR2_TARGET_EDK2 and BR_BUILDING
+
 $(eval $(generic-package))
-- 
2.53.0

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

  parent 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 ` Angelo Compagnucci [this message]
2026-11-21 21:51   ` [Buildroot] [PATCH v2 2/3] package/edk2-platforms: " Angelo Compagnucci
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-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.