Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [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

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