Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68872 )
Change subject: payloads/external/edk2: Add option to clone edk2-paltforms repo ......................................................................
payloads/external/edk2: Add option to clone edk2-paltforms repo
Add possibility to clone edk2-platforms repository. Some edk2 repositories may use modules from edk2-platforms which contain various feature packages for Intel platforms.
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: Iabd0793dfdcb95260046dc992ff30ef581159db9 --- M payloads/external/Makefile.inc M payloads/external/edk2/Kconfig M payloads/external/edk2/Makefile 3 files changed, 75 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/68872/1
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index 70096f5..dbd2db1 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -165,6 +165,9 @@ CONFIG_EDK2_REPO_MRCHROMEBOX=$(CONFIG_EDK2_REPO_MRCHROMEBOX) \ CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \ CONFIG_EDK2_CUSTOM_BUILD_PARAMS=$(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) \ + CONFIG_EDK2_USE_EDK2_PLATFORMS=$(CONFIG_EDK2_USE_EDK2_PLATFORMS) \ + CONFIG_EDK2_PLATFORMS_REPOSITORY=$(CONFIG_EDK2_PLATFORMS_REPOSITORY) \ + CONFIG_EDK2_PLATFORMS_TAG_OR_REV=$(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) \ CONFIG_EDK2_DEBUG=$(CONFIG_EDK2_DEBUG) \ CONFIG_EDK2_RELEASE=$(CONFIG_EDK2_RELEASE) \ CONFIG_EDK2_VERBOSE_BUILD=$(CONFIG_EDK2_VERBOSE_BUILD) \ diff --git a/payloads/external/edk2/Kconfig b/payloads/external/edk2/Kconfig index e0c19bb..da92274 100644 --- a/payloads/external/edk2/Kconfig +++ b/payloads/external/edk2/Kconfig @@ -61,6 +61,30 @@ EDK2_REPOSITORY, and in the case of a branch name, prefixed with origin i.e. "origin/uefipayload_202202"
+config EDK2_USE_EDK2_PLATFORMS + bool "Use edk2-platforms repository" + default n + help + Clone edk2-platforms repository to the edk2 workspace for additional modules. + +if EDK2_USE_EDK2_PLATFORMS + +config EDK2_PLATFORMS_REPOSITORY + string "URL to git repository for edk2-platforms" + default "https://github.com/tianocore/edk2-platforms" + help + URL to the edk2-platfors repository to clone. + +config EDK2_PLATFORMS_TAG_OR_REV + string "Insert a commit's SHA-1 or a branch name" + default "origin/master" + help + The commit's SHA-1 or branch name of the revision to use. This must exist in + EDK2_PLATFORMS_REPOSITORY, and in the case of a branch name, prefixed with + origin i.e. "origin/master" + +endif + choice prompt "edk2 build" default EDK2_RELEASE diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile index 498e11a..1c90ee8 100644 --- a/payloads/external/edk2/Makefile +++ b/payloads/external/edk2/Makefile @@ -6,7 +6,22 @@ project_name = edk2 export WORKSPACE := $(CURDIR)/workspace export EDK2_PATH := $(WORKSPACE)/$(word 3,$(subst /, ,$(CONFIG_EDK2_REPOSITORY))) + +ifeq ($(CONFIG_EDK2_USE_EDK2_PLATFORMS),y) +export EDK2_PLATFORMS_PATH := $(WORKSPACE)/edk2-platforms +export PACKAGES_PATH := $(EDK2_PATH):\ + $(EDK2_PLATFORMS_PATH)/Platform/Intel:\ + $(EDK2_PLATFORMS_PATH)/Silicon/Intel:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/Debugging:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/Network:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/OutOfBandManagement:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/PowerManagement:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/SystemInformation:\ + $(EDK2_PLATFORMS_PATH)/Features/Intel/UserInterface +else export PACKAGES_PATH := $(EDK2_PATH) +endif
ifeq ($(CONFIG_EDK2_UEFIPAYLOAD),y) BUILD_STR = -p UefiPayloadPkg/UefiPayloadPkg.dsc @@ -111,7 +126,24 @@ $(WORKSPACE): mkdir $(WORKSPACE)
-$(EDK2_PATH): $(WORKSPACE) +$(EDK2_PLATFORMS_PATH): $(WORKSPACE) + if [ ! -d "$(EDK2_PLATFORMS_PATH)" ]; then \ + git clone --recurse-submodules $(CONFIG_EDK2_PLATFORMS_REPOSITORY) $(EDK2_PLATFORMS_PATH) -j5; \ + fi + cd $(EDK2_PLATFORMS_PATH); \ + if ! git rev-parse --verify -q $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) >/dev/null; then \ + echo " $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) is not a valid git reference"; \ + exit 1; \ + fi; \ + if git status --ignore-submodules=dirty | grep -q clean; then \ + echo " Checking out edk2-platforms revision $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV)"; \ + git checkout --detach $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) -f; \ + else \ + echo " Working directory not clean; will not overwrite"; \ + fi; \ + git submodule update --init --checkout + +$(EDK2_PATH): $(WORKSPACE) $(EDK2_PLATFORMS_PATH) if [ ! -d "$(EDK2_PATH)" ]; then \ git clone --recurse-submodules $(CONFIG_EDK2_REPOSITORY) $(EDK2_PATH) -j5; \ fi @@ -168,6 +200,7 @@ echo " ##### $(project_name) Build Summary #####" echo " Repository: $(CONFIG_EDK2_REPOSITORY)" echo " Branch: $(CONFIG_EDK2_TAG_OR_REV)" + echo " Packages path: $(PACKAGES_PATH)" echo " $(BUILD_STR)" | \ sed -e 's/--/-/g' -e 's/-/\n /g' | sort | sed \ -e 's/a /Architecture: /g' \