Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/68872 )
Change subject: payloads/external/edk2: Add option to clone edk2-platforms repo ......................................................................
payloads/external/edk2: Add option to clone edk2-platforms repo
Add possibility to clone edk2-platforms repository. Some edk2 repositories may use modules from edk2-platforms which contains various feature packages for Intel platforms, e.g VT-d driver if DMA protection is enabled.
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: Iabd0793dfdcb95260046dc992ff30ef581159db9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68872 Reviewed-by: Krystian Hebel krystian.hebel@3mdeb.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M payloads/external/Makefile.inc M payloads/external/edk2/Kconfig M payloads/external/edk2/Makefile 3 files changed, 79 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Krystian Hebel: Looks good to me, approved
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index 91fce58..475427e 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -166,6 +166,9 @@ CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \ CONFIG_EDK2_CPU_TIMER_LIB=$(CONFIG_EDK2_CPU_TIMER_LIB) \ 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 454aef0..e3bb157 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 27ce4a9..b241cf9 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
OBJCOPY = $(GCC_PREFIX)objcopy
@@ -119,6 +134,23 @@ $(WORKSPACE): mkdir $(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 "nothing to commit, working tree 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) if [ ! -d "$(EDK2_PATH)" ]; then \ git clone --recurse-submodules $(CONFIG_EDK2_REPOSITORY) $(EDK2_PATH) -j5; \ @@ -176,6 +208,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' \ @@ -187,7 +220,7 @@ -e 's/s /Build: Silent/' \ -e 's/t /Toolchain: /'
-prep: $(EDK2_PATH) clean checktools logo +prep: $(EDK2_PATH) $(EDK2_PLATFORMS_PATH) clean checktools logo cd $(WORKSPACE); \ source $(EDK2_PATH)/edksetup.sh; \ unset CC; $(MAKE) -C $(EDK2_PATH)/BaseTools 2>&1; \