payloads/edk2: Add a recipe to build the ShimLayer

The ShimLayer is required to start the Universal Payload. It will build
the required HOBs and pass them accordingly.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I043271994f40813d9059a89420d4311d9d5802b1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64485
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Sean Rhodes 2022-05-18 23:00:57 +01:00 committed by Martin L Roth
parent c60f3b2ced
commit ba67276177
1 changed files with 15 additions and 0 deletions

View File

@ -117,6 +117,9 @@ $(EDK2_PATH): $(WORKSPACE)
fi fi
cd $(EDK2_PATH); \ cd $(EDK2_PATH); \
git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true; \ git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true; \
if [ -e UefiPayloadPkg/ShimLayer/UniversalPayload.o ]; then \
rm UefiPayloadPkg/ShimLayer/UniversalPayload.o; \
fi; \
echo " Fetching new commits from $(CONFIG_EDK2_REPOSITORY)"; \ echo " Fetching new commits from $(CONFIG_EDK2_REPOSITORY)"; \
git fetch origin 2>/dev/null; \ git fetch origin 2>/dev/null; \
if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV) >/dev/null; then \ if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV) >/dev/null; then \
@ -210,6 +213,18 @@ $(WORKSPACE)/Build/UefiPayloadPkgX64/UniversalPayload.elf: \
fi fi
echo "Success!"; \ echo "Success!"; \
$(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/IA32/UefiPayloadPkg/ShimLayer/ShimLayer/DEBUG/ShimLayer.dll: \
$(WORKSPACE)/Build/UefiPayloadPkgX64/UniversalPayload.elf prep
cd $(WORKSPACE)/Build/UefiPayloadPkgX64 && \
$(OBJCOPY) -I binary UniversalPayload.elf -O elf32-i386 -B i386 \
$(EDK2_PATH)/UefiPayloadPkg/ShimLayer/UniversalPayload.o; \
cd $(WORKSPACE) && \
source $(EDK2_PATH)/edksetup.sh; \
build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b $(RELEASE_STR) -a IA32 -a X64 \
-m UefiPayloadPkg/ShimLayer/ShimLayer.inf \
-t COREBOOT -D BOOTLOADER=COREBOOT -D SHIMLAYER=TRUE \
-y $(WORKSPACE)/Build/UefiPayloadPkgX64/ShimLayer.txt
UefiPayloadPkg: $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd UefiPayloadPkg: $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd
mv $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd \ mv $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd \
../../../build/UEFIPAYLOAD.fd ../../../build/UEFIPAYLOAD.fd