From 90587f5caf9c3f2a3761a053a58ec86617c7e375 Mon Sep 17 00:00:00 2001 From: Yuliang Wang Date: Wed, 20 Nov 2024 18:35:01 +0000 Subject: [PATCH 1/2] config: Split edk2 and edk2-platforms into independent targets Allow each to be separately configured with local sourcedir's as this is currently not supported by the nested repo field syntax This introduces a new issue as the EDK2 build system will always search for edk2-platforms in the base repo ("sourcedir"), ignoring the value of PACKAGES_PATH, unless WORKSPACE points elsewhere. Take this opportunity to override the default build path in a more widely compatible way, since EDK2_OUT_DIR is not universally supported. Same with CONF_PATH so that cleaning the build becomes as trivial as deleting "builddir". Signed-off-by: Yuliang Wang --- config/edk2-base.yaml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/config/edk2-base.yaml b/config/edk2-base.yaml index dc3ea48..04c1868 100644 --- a/config/edk2-base.yaml +++ b/config/edk2-base.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2022, Arm Limited. +# Copyright (c) 2024, Arm Limited. # SPDX-License-Identifier: MIT %YAML 1.2 @@ -22,26 +22,41 @@ build: path: ${param:sourcedir}/generate/unix/bin export: false + edk2-platforms: + repo: + remote: https://github.com/tianocore/edk2-platforms.git + revision: 5b5885ef3e30a2896f23afd6df3d2dae8d5e51b3 + + artifacts: + # Share the source directory with EDK2 + EDK2_PLATFORMS: + path: ${param:sourcedir} + export: false + edk2: repo: - edk2: - remote: https://github.com/tianocore/edk2.git - revision: 95d8a1c255cfb8e063d679930d08ca6426eb5701 - edk2-platforms: - remote: https://github.com/tianocore/edk2-platforms.git - revision: 5b5885ef3e30a2896f23afd6df3d2dae8d5e51b3 + remote: https://github.com/tianocore/edk2.git + revision: 95d8a1c255cfb8e063d679930d08ca6426eb5701 toolchain: aarch64-none-elf- stderrfilt: true prebuild: - - export WORKSPACE=${param:sourcedir} + # Change working directory to reduce build artifacts in repo + - export WORKSPACE=${param:builddir} + - export CONF_PATH=${param:builddir}/Conf + - export EDK_TOOLS_PATH=${param:sourcedir}/BaseTools - export GCC5_AARCH64_PREFIX=$$CROSS_COMPILE - - export PACKAGES_PATH=$$WORKSPACE/edk2:$$WORKSPACE/edk2-platforms + - export PACKAGES_PATH=${param:sourcedir}:${artifact:EDK2_PLATFORMS} - export IASL_PREFIX=${artifact:ACPICA}/ - export PYTHON_COMMAND=/usr/bin/python3 + # Pre-build steps: create configuration + compile tools + - mkdir -p $$CONF_PATH + - source ${param:sourcedir}/edksetup.sh --reconfig + - make -j${param:jobs} -C $$EDK_TOOLS_PATH + params: -a: AARCH64 -t: GCC5 @@ -51,8 +66,6 @@ build: ' --pcd': PcdUefiShellDefaultBootEnable=1 build: - - source edk2/edksetup.sh --reconfig - - make -j${param:jobs} -C edk2/BaseTools - build -n ${param:jobs} -D EDK2_OUT_DIR=${param:builddir} ${param:join_space} artifacts: -- GitLab From ffec547aff17c7bb0406a2ce43379933310eb796 Mon Sep 17 00:00:00 2001 From: Yuliang Wang Date: Wed, 20 Nov 2024 19:57:39 +0000 Subject: [PATCH 2/2] config: Make edk2-base more flexible Move parameters specific to the base UEFI out of "params" so that "param:join_space" can be used for other targets, e.g. StandaloneMM Signed-off-by: Yuliang Wang --- config/edk2-base.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/edk2-base.yaml b/config/edk2-base.yaml index 04c1868..13981fb 100644 --- a/config/edk2-base.yaml +++ b/config/edk2-base.yaml @@ -60,13 +60,15 @@ build: params: -a: AARCH64 -t: GCC5 - -p: Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -b: DEBUG - --pcd: PcdShellDefaultDelay=0 - ' --pcd': PcdUefiShellDefaultBootEnable=1 + -n: ${param:jobs} build: - - build -n ${param:jobs} -D EDK2_OUT_DIR=${param:builddir} ${param:join_space} + - build ${param:join_space} + -p Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc + -D EDK2_OUT_DIR=${param:builddir} + --pcd PcdShellDefaultDelay=0 + --pcd PcdUefiShellDefaultBootEnable=1 artifacts: EDK2: ${param:builddir}/DEBUG_GCC5/FV/FVP_AARCH64_EFI.fd -- GitLab