@@ -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"
@@ -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