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>
This commit is contained in:
Michał Żygowski 2022-10-26 11:32:54 +02:00 committed by Felix Held
parent f63cdcffbf
commit 82d814a71a
3 changed files with 61 additions and 1 deletions

View File

@ -166,6 +166,9 @@ $(obj)/UEFIPAYLOAD.fd: $(DOTCONFIG)
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) \

View File

@ -61,6 +61,30 @@ config EDK2_TAG_OR_REV
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

View File

@ -6,7 +6,22 @@ export SHELL := env bash
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 @@ all: UefiPayloadPkg
$(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 @@ print:
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 @@ print:
-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; \