* [Buildroot] [PATCH 1/1] boot/edk2: add support for custom configuration.
@ 2024-01-24 11:10 yangcheng.work
2026-11-21 21:51 ` Angelo Compagnucci
0 siblings, 1 reply; 2+ messages in thread
From: yangcheng.work @ 2024-01-24 11:10 UTC (permalink / raw)
To: buildroot; +Cc: Cheng Yang
From: Cheng Yang <yangcheng.work@foxmail.com>
EDK2 currently only supports github, but sometimes
we may need to customize the source of EDK2 to support
applications in some specific scenarios, such as github
access is limited or some repositories that have not
yet been merged into the mainline.
Therefore, this commit adds the possibility to specify custom
EDK2 version, custom version from upstream, custom tarball or
Customizations from Git. Just like OpenSBI, Uboot or Linux.
Signed-off-by: Cheng Yang <yangcheng.work@foxmail.com>
---
boot/edk2/Config.in | 50 +++++++++++++++++++++++++++++++++++++++++++++
boot/edk2/edk2.mk | 15 +++++++++++++-
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in
index 4e6e7d122c..c9f592a9a5 100644
--- a/boot/edk2/Config.in
+++ b/boot/edk2/Config.in
@@ -17,6 +17,56 @@ config BR2_TARGET_EDK2
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
if BR2_TARGET_EDK2
+choice
+ prompt "EDK2 Version"
+ help
+ Select the specific EDK2 version you want to use
+
+config BR2_TARGET_EDK2_LATEST_VERSION
+ bool "edk2-stable202308"
+
+config BR2_TARGET_EDK2_CUSTOM_VERSION
+ bool "Custom version"
+ help
+ This option allows to use a specific official versions
+
+config BR2_TARGET_EDK2_CUSTOM_TARBALL
+ bool "Custom tarball"
+
+config BR2_TARGET_EDK2_CUSTOM_GIT
+ bool "Custom Git repository"
+
+endchoice
+
+config BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE
+ string "EDK2 version"
+ depends on BR2_TARGET_EDK2_CUSTOM_VERSION
+
+config BR2_TARGET_EDK2_CUSTOM_TARBALL_LOCATION
+ string "URL of custom EDK2 tarball"
+ depends on BR2_TARGET_EDK2_CUSTOM_TARBALL
+
+if BR2_TARGET_EDK2_CUSTOM_GIT
+
+config BR2_TARGET_EDK2_CUSTOM_REPO_URL
+ string "URL of custom repository"
+
+config BR2_TARGET_EDK2_CUSTOM_REPO_VERSION
+ string "Custom repository version"
+ help
+ Revision to use in the typical format used by Git. E.G. a
+ sha id, a tag, branch, ..
+
+endif
+
+config BR2_TARGET_EDK2_VERSION
+ string
+ default "edk2-stable202308" if BR2_TARGET_EDK2_LATEST_VERSION
+ default BR2_TARGET_EDK2_CUSTOM_VERSION_VALUE \
+ if BR2_TARGET_EDK2_CUSTOM_VERSION
+ default "custom" if BR2_TARGET_EDK2_CUSTOM_TARBALL
+ default BR2_TARGET_EDK2_CUSTOM_REPO_VERSION \
+ if BR2_TARGET_EDK2_CUSTOM_GIT
choice
prompt "Platform"
diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk
index 87ac80c88f..0f8aed703e 100644
--- a/boot/edk2/edk2.mk
+++ b/boot/edk2/edk2.mk
@@ -4,9 +4,22 @@
#
################################################################################
-EDK2_VERSION = edk2-stable202308
+EDK2_VERSION = $(call qstrip,$(BR2_TARGET_EDK2_VERSION))
+
+ifeq ($(BR2_TARGET_EDK2_CUSTOM_TARBALL),y)
+# Handle custom EDK2 tarballs as specified by the configuration
+EDK2_TARBALL = $(call qstrip,$(BR2_TARGET_EDK2_CUSTOM_TARBALL_LOCATION))
+EDK2_SITE = $(patsubst %/,%,$(dir $(EDK2_TARBALL)))
+EDK2_SOURCE = $(notdir $(EDK2_TARBALL))
+else ifeq ($(BR2_TARGET_EDK2_CUSTOM_GIT),y)
+EDK2_SITE = $(call qstrip,$(BR2_TARGET_EDK2_CUSTOM_REPO_URL))
+EDK2_SITE_METHOD = git
+else
+# Handle official EDK2 versions
EDK2_SITE = https://github.com/tianocore/edk2
EDK2_SITE_METHOD = git
+endif
+
EDK2_LICENSE = BSD-2-Clause-Patent
EDK2_LICENSE_FILES = License.txt
EDK2_CPE_ID_VENDOR = tianocore
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] boot/edk2: add support for custom configuration.
2024-01-24 11:10 [Buildroot] [PATCH 1/1] boot/edk2: add support for custom configuration yangcheng.work
@ 2026-11-21 21:51 ` Angelo Compagnucci
0 siblings, 0 replies; 2+ messages in thread
From: Angelo Compagnucci @ 2026-11-21 21:51 UTC (permalink / raw)
To: buildroot; +Cc: Cheng Yang, Vincent Stehlé, Dick Olsson
Hi Cheng,
On 24/01/24 12:10, Cheng Yang wrote:
> Therefore, this commit adds the possibility to specify custom
> EDK2 version, custom version from upstream, custom tarball or
> Customizations from Git. Just like OpenSBI, Uboot or Linux.
I think this patch can be dropped in favour of the series by Vincent
Stehlé, which adds the same custom version option:
https://patchwork.buildroot.org/project/buildroot/patch/20250411172944.1379043-2-vincent.stehle@arm.com/
I have sent a v2 of that series, rebased on master.
The reasons:
1. EDK2 builds also use edk2-platforms, and edk2-non-osi for some
platforms. Their versions must match the EDK2 version. Vincent's
series adds a custom version option to all three packages. This
patch only changes EDK2.
2. A custom version fails to download with "No hash found": edk2.hash
only lists the default version. The v2 of Vincent's series skips
the hash check for custom versions, like optee-os and uboot do.
3. A custom tarball would miss the git submodules: EDK2 sets
EDK2_GIT_SUBMODULES = YES, and GitHub archives don't include them.
4. The patch no longer applies: EDK2 is now at edk2-stable202608.
A custom git repository is not covered by Vincent's series. It can be
added on top of it, with the hash and submodule points above.
Superseded: https://patchwork.buildroot.org/project/buildroot/patch/tencent_8FFB06F67FA524B2D90D051931B1F0082405@qq.com/
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 21:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 11:10 [Buildroot] [PATCH 1/1] boot/edk2: add support for custom configuration yangcheng.work
2026-11-21 21:51 ` Angelo Compagnucci
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox