Michael Kubacki 316e6df435 OvmfPkg: Add reference to new build instructions | před 1 rokem | |
---|---|---|
.. | ||
.azurepipelines | před 2 roky | |
AmdSevBuild.py | před 2 roky | |
BhyveBuild.py | před 2 roky | |
CloudHvBuild.py | před 2 roky | |
IntelTdxBuild.py | před 2 roky | |
MicrovmBuild.py | před 2 roky | |
PlatformBuild.py | před 2 roky | |
PlatformBuildLib.py | před 2 roky | |
ReadMe.md | před 1 rokem | |
XenBuild.py | před 2 roky | |
iasl_ext_dep.yaml | před 4 roky |
This ReadMe.md describes the Azure DevOps based Platform CI for OvmfPkg and how to use the same Pytools based build infrastructure locally.
This solution for building and running OvmfPkg has only been validated with Windows 10 with VS2019 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are supported and are described below.
Configuration name | Architectures | DSC File | Additional Flags |
---|---|---|---|
IA32 | IA32 | OvmfPkgIa32.dsc | None |
X64 | X64 | OvmfPkgIa64.dsc | None |
IA32 X64 | PEI-IA32 DXE-X64 | OvmfPkgIa32X64.dsc | None |
IA32 X64 Full | PEI-IA32 DXE-X64 | OvmfPkgIa32X64.dsc | SECURE_BOOT_ENABLE=1 SMM_REQUIRE=1 TPM1_ENABLE=1 TPM2_ENABLE=1 NETWORK_TLS_ENABLE=1 NETWORK_IP6_ENABLE=1 NETWORK_HTTP_BOOT_ENABLE=1 |
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.
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>
source <name of virtual environment>/bin/activate
<name of virtual environment>/Scripts/activate.bat
pip install --upgrade -r pip-requirements.txt
Initialize & Update Submodules - only when submodules updated
stuart_setup -c OvmfPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>
stuart_update -c OvmfPkg/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>
stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a IA32 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>
stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a X64 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>
stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a IA32,X64 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>
stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -h
option to see additional
options like --clean
Running Emulator
--FlashRom
to the end of your build command and the emulator will run after the
build is complete.--FlashOnly
feature to just run the emulator. stuart_build -c OvmfPkg/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 _stuartbuild, prepend BLD_*_
to the define name and pass it on the
command-line. _stuartbuild 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 E1000_ENABLE», the stuart_build
command-line would be:
stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py BLD_*_E1000_ENABLE=1