]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/PlatformCI/ReadMe.md
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / PlatformCI / ReadMe.md
CommitLineData
6cdf647b
SB
1# OvmfPkg - Platform CI\r
2\r
3This ReadMe.md describes the Azure DevOps based Platform CI for OvmfPkg and how\r
4to use the same Pytools based build infrastructure locally.\r
5\r
6## Supported Configuration Details\r
7\r
8This solution for building and running OvmfPkg has only been validated with Windows 10\r
9with VS2019 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are\r
10supported and are described below.\r
11\r
12| Configuration name | Architectures | DSC File |Additional Flags |\r
13| :---- | :----- | :---- | :---- |\r
14| IA32 | IA32 | OvmfPkgIa32.dsc | None |\r
15| X64 | X64 | OvmfPkgIa64.dsc | None |\r
16| IA32 X64 | PEI-IA32 DXE-X64 | OvmfPkgIa32X64.dsc | None |\r
4de8d61b 17| 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 |\r
6cdf647b
SB
18\r
19## EDK2 Developer environment\r
20\r
21- [Python 3.8.x - Download & Install](https://www.python.org/downloads/)\r
22- [GIT - Download & Install](https://git-scm.com/download/)\r
23- [QEMU - Download, Install, and add to your path](https://www.qemu.org/download/)\r
24- [Edk2 Source](https://github.com/tianocore/edk2)\r
25- Additional packages found necessary for Ubuntu 18.04\r
26 - apt-get install gcc g++ make uuid-dev\r
27\r
28Note: edksetup, Submodule initialization and manual installation of NASM, iASL, or\r
29the required cross-compiler toolchains are **not** required, this is handled by the\r
30Pytools build system.\r
31\r
32## Building with Pytools for OvmfPkg\r
33\r
316e6df4
MK
34If you are unfamiliar with Pytools, it is recommended to first read through\r
35the generic set of edk2 [Build Instructions](https://github.com/tianocore/tianocore.github.io/wiki/Build-Instructions).\r
36\r
6cdf647b
SB
371. [Optional] Create a Python Virtual Environment - generally once per workspace\r
38\r
39 ``` bash\r
40 python -m venv <name of virtual environment>\r
41 ```\r
42\r
432. [Optional] Activate Virtual Environment - each time new shell opened\r
44 - Linux\r
45\r
46 ```bash\r
47 source <name of virtual environment>/bin/activate\r
48 ```\r
49\r
50 - Windows\r
51\r
52 ``` bash\r
53 <name of virtual environment>/Scripts/activate.bat\r
54 ```\r
55\r
563. Install Pytools - generally once per virtual env or whenever pip-requirements.txt changes\r
57\r
58 ``` bash\r
59 pip install --upgrade -r pip-requirements.txt\r
60 ```\r
61\r
624. Initialize & Update Submodules - only when submodules updated\r
63\r
64 ``` bash\r
65 stuart_setup -c OvmfPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>\r
66 ```\r
67\r
685. Initialize & Update Dependencies - only as needed when ext_deps change\r
69\r
70 ``` bash\r
71 stuart_update -c OvmfPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>\r
72 ```\r
73\r
746. Compile the basetools if necessary - only when basetools C source files change\r
75\r
76 ``` bash\r
77 python BaseTools/Edk2ToolsBuild.py -t <ToolChainTag>\r
78 ```\r
79\r
807. Compile Firmware\r
81 - To build IA32\r
82\r
83 ``` bash\r
84 stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a IA32 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>\r
85 ```\r
86\r
87 - To build X64\r
88\r
89 ``` bash\r
90 stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a X64 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>\r
91 ```\r
92\r
93 - To build IA32 X64\r
94\r
95 ``` bash\r
96 stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -a IA32,X64 TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG>\r
97 ```\r
98\r
99 - use `stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py -h` option to see additional\r
100 options like `--clean`\r
101\r
1028. Running Emulator\r
103 - You can add `--FlashRom` to the end of your build command and the emulator will run after the\r
104 build is complete.\r
105 - or use the `--FlashOnly` feature to just run the emulator.\r
106\r
107 ``` bash\r
108 stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH> --FlashOnly\r
109 ```\r
110\r
111### Notes\r
112\r
1131. Configuring *ACTIVE_PLATFORM* and *TARGET_ARCH* in Conf/target.txt is **not** required. This\r
114 environment is set by PlatformBuild.py based upon the `[-a <TARGET_ARCH>]` parameter.\r
1152. QEMU must be on your path. On Windows this is a manual process and not part of the QEMU installer.\r
116\r
117**NOTE:** Logging the execution output will be in the normal stuart log as well as to your console.\r
118\r
119### Custom Build Options\r
120\r
121**MAKE_STARTUP_NSH=TRUE** will output a *startup.nsh* file to the location mapped as fs0. This is\r
122used in CI in combination with the `--FlashOnly` feature to run QEMU to the UEFI shell and then execute\r
123the contents of *startup.nsh*.\r
124\r
125**QEMU_HEADLESS=TRUE** Since CI servers run headless QEMU must be told to run with no display otherwise\r
126an error occurs. Locally you don't need to set this.\r
127\r
128### Passing Build Defines\r
129\r
130To pass build defines through _stuart_build_, prepend `BLD_*_`to the define name and pass it on the\r
131command-line. _stuart_build_ currently requires values to be assigned, so add an`=1` suffix for bare defines.\r
132For example, to enable the TPM2 support, instead of the traditional "-D E1000_ENABLE", the stuart_build\r
133command-line would be:\r
134\r
135`stuart_build -c OvmfPkg/PlatformCI/PlatformBuild.py BLD_*_E1000_ENABLE=1`\r
136\r
137## References\r
138\r
139- [Installing and using Pytools](https://github.com/tianocore/edk2-pytool-extensions/blob/master/docs/using.md#installing)\r
140- More on [python virtual environments](https://docs.python.org/3/library/venv.html)\r