This Readme.md describes the Azure DevOps based Platform CI for ArmVirtPkg and how
to use the same Pytools based build infrastructure locally.
This solution for building and running ArmVirtPkg has only been validated with Ubuntu
18.04 and the GCC5 toolchain. Two different firmware builds are supported and are
described below.
Configuration name | Architecture | DSC File | Additional Flags |
---|---|---|---|
AARCH64 | AARCH64 | ArmVirtQemu.dsc | None |
ARM | ARM | ArmVirtQemu.dsc | None |
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.
[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
bash <name of virtual environment>/Scripts/activate.bat
bash source <name of virtual environment>/bin/activate
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 ArmVirtPkg/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 ArmVirtPkg/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 ArmVirtPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>
stuart_build -c ArmVirtPkg/PlatformCI/PlatformBuild.py -h
option to see additional--clean
Running Emulator
--FlashRom
to the end of your build command and the emulator will run after the--FlashOnly
feature to just run the emulator.bash stuart_build -c ArmVirtPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH> --FlashOnly
[-a <TARGET_ARCH>]
parameter.NOTE: Logging the execution output will be in the normal stuart log as well as to your console.
MAKE_STARTUP_NSH=TRUE will output a startup.nsh file to the location mapped as fs0. This is
used in CI in combination with the --FlashOnly
feature to run QEMU to the UEFI shell and then execute
the contents of startup.nsh.
QEMU_HEADLESS=TRUE Since CI servers run headless QEMU must be told to run with no display otherwise
an error occurs. Locally you don't need to set this.
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 TPM2 support, instead of the traditional "-D TPM2_ENABLE=TRUE", the stuart_build
command-line would be:
stuart_build -c ArmVirtPkg/PlatformCI/PlatformBuild.py BLD_*_TPM2_ENABLE=TRUE