Create a new PlatformBuild.py that can be called by stuart_build. UniversalPayloadBuild.py is consumed by new script to maintain backward compatibility and eliminate duplicate build steps. Supported builds: 1. UEFI package build: directly call BaseTools build for EFI bin 2. UPL ELF/FIT build: call UniversalPayloadBuild.py 3. (new) UPL ELF - stuart build: follow stuart build steps to call PlatformBuild.py (edk2toolext is mandatory) Signed-off-by: Gua Guo <gua.guo@intel.com>
UefiPayloadPkg - Platform CI
This ReadMe.md describes the Azure DevOps based Platform CI for UefiPayloadPkg and how to use the same Pytools based build infrastructure locally.
Supported Configuration Details
This solution for building UefiPayloadPkg has only been validated with Windows 11 with VS2019 + CLANG/LLVM. Different firmware builds are supported and are described below.
| Configuration name | Architectures | DSC File | Additional Flags |
|---|---|---|---|
| IA32 | IA32 | UefiPayloadPkg.dsc | None |
| X64 | X64 | UefiPayloadPkg.dsc | None |
More build configuration detail are in UPL ReadMe
EDK2 Developer environment
Note: edksetup, Submodule initialization and manual installation of NASM, iASL, or the required cross-compiler toolchains are not required, this is handled by the Pytools build system.
Building with Pytools for UefiPayloadPkg
If you are unfamiliar with Pytools, it is recommended to first read through the generic set of edk2 Build Instructions.
-
[Optional] Create a Python Virtual Environment - generally once per workspace
python -m venv <name of virtual environment> -
[Optional] Activate Virtual Environment - each time new shell opened
-
Linux
source <name of virtual environment>/bin/activate -
Windows
<name of virtual environment>/Scripts/activate.bat
-
-
Install Pytools - generally once per virtual env or whenever pip-requirements.txt changes
pip install --upgrade -r pip-requirements.txt -
Initialize & Update Submodules - only when submodules updated
stuart_setup -c UefiPayloadPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH> -
Initialize & Update Dependencies - only as needed when ext_deps change
stuart_update -c UefiPayloadPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH> -
Compile the basetools if necessary - only when basetools C source files change
python BaseTools/Edk2ToolsBuild.py -t <ToolChainTag> -
Compile Firmware
stuart_build -c UefiPayloadPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>- use
stuart_build -c UefiPayloadPkg/PlatformCI/PlatformBuild.py -hoption to see additional options like--clean
- use
Notes
- Configuring ACTIVE_PLATFORM and TARGET_ARCH in Conf/target.txt is not required. This
environment is set by PlatformBuild.py based upon the
[-a <TARGET_ARCH>]parameter.
NOTE: Logging the execution output will be in the normal stuart log as well as to your console.
Custom Build Options
Passing Build Defines
To pass build defines through stuart_build, prepend BLD_*_to the define name and pass it on the
command-line. stuart_build currently requires values to be assigned, so add an=1 suffix for bare defines.
For example, to enable the IP6 Network Stack, the stuart_build command-line would be:
stuart_build -c UefiPayloadPkg/PlatformCI/PlatformBuild.py BLD_*_NETWORK_DRIVER_ENABLE=1