]> git.proxmox.com Git - mirror_edk2.git/blame - EmulatorPkg/PlatformCI/ReadMe.md
pip-requirements.txt: Update to edk2-pytool-extensions 0.20.0
[mirror_edk2.git] / EmulatorPkg / PlatformCI / ReadMe.md
CommitLineData
951a0353
SB
1# EmulatorPkg - Platform CI\r
2\r
3This ReadMe.md describes the Azure DevOps based Platform CI for EmulatorPkg 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 EmulatorPkg has only been validated with Windows 10\r
2e14ee75 9with VS2019 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are\r
951a0353
SB
10supported and are described below.\r
11\r
12| Configuration name | Architectures | DSC File |Additional Flags |\r
13| :---- | :----- | :---- | :---- |\r
14| IA32 | IA32 | EmulatorPkg.dsc | None |\r
15| X64 | X64 | EmulatorPkg.dsc | None |\r
2e14ee75
MK
16| IA32 Full | IA32 | EmulatorPkg.dsc | SECURE_BOOT_ENABLE=TRUE |\r
17| X64 Full | X64 | EmulatorPkg.dsc | SECURE_BOOT_ENABLE=TRUE |\r
951a0353
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- [Edk2 Source](https://github.com/tianocore/edk2)\r
24- For building Basetools and other host applications\r
25\r
26 ``` bash\r
27 sudo apt-get update\r
28 sudo apt-get install gcc g++ make uuid-dev\r
29 ```\r
30\r
31- For building ARCH IA32 on X64 Ubuntu 18.04 LTS these steps where needed.\r
32\r
33 ``` bash\r
34 sudo dpkg --add-architecture i386\r
35 sudo apt-get update\r
36 sudo apt-get install libc6-dev:i386 libx11-dev:i386 libxext-dev:i386 lib32gcc-7-dev\r
37 ```\r
38\r
39Note: edksetup, Submodule initialization and manual installation of NASM, iASL, or\r
40the required cross-compiler toolchains are **not** required, this is handled by the\r
41Pytools build system.\r
42\r
43## Building with Pytools for EmulatorPkg\r
44\r
451. [Optional] Create a Python Virtual Environment - generally once per workspace\r
46\r
47 ``` bash\r
48 python -m venv <name of virtual environment>\r
49 ```\r
50\r
512. [Optional] Activate Virtual Environment - each time new shell opened\r
52 - Linux\r
53\r
54 ```bash\r
55 source <name of virtual environment>/bin/activate\r
56 ```\r
57\r
58 - Windows\r
59\r
60 ``` bash\r
61 <name of virtual environment>/Scripts/activate.bat\r
62 ```\r
63\r
643. Install Pytools - generally once per virtual env or whenever pip-requirements.txt changes\r
65\r
66 ``` bash\r
67 pip install --upgrade -r pip-requirements.txt\r
68 ```\r
69\r
704. Initialize & Update Submodules - only when submodules updated\r
71\r
72 ``` bash\r
73 stuart_setup -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>\r
74 ```\r
75\r
765. Initialize & Update Dependencies - only as needed when ext_deps change\r
77\r
78 ``` bash\r
79 stuart_update -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>\r
80 ```\r
81\r
826. Compile the basetools if necessary - only when basetools C source files change\r
83\r
84 ``` bash\r
85 python BaseTools/Edk2ToolsBuild.py -t <ToolChainTag>\r
86 ```\r
87\r
887. Compile Firmware\r
89\r
90 ``` bash\r
91 stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH>\r
92 ```\r
93\r
94 - use `stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py -h` option to see additional\r
95 options like `--clean`\r
96\r
978. Running Emulator\r
98 - You can add `--FlashRom` to the end of your build command and the emulator will run after the\r
99 build is complete.\r
100 - or use the `--FlashOnly` feature to just run the emulator.\r
101\r
102 ``` bash\r
103 stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=<TOOL_CHAIN_TAG> -a <TARGET_ARCH> --FlashOnly\r
104 ```\r
105\r
106### Notes\r
107\r
1081. Configuring *ACTIVE_PLATFORM* and *TARGET_ARCH* in Conf/target.txt is **not** required. This\r
109 environment is set by PlatformBuild.py based upon the `[-a <TARGET_ARCH>]` parameter.\r
110\r
111**NOTE:** Logging the execution output will be in the normal stuart log as well as to your console.\r
112\r
113### Custom Build Options\r
114\r
115**MAKE_STARTUP_NSH=TRUE** will output a *startup.nsh* file to the location mapped as fs0. This is\r
116used in CI in combination with the `--FlashOnly` feature to run the Emulator to the UEFI shell and then execute\r
117the contents of *startup.nsh*.\r
118\r
119### Passing Build Defines\r
120\r
121To pass build defines through _stuart_build_, prepend `BLD_*_`to the define name and pass it on the\r
122command-line. _stuart_build_ currently requires values to be assigned, so add an`=1` suffix for bare defines.\r
123For example, to enable the IP6 Network Stack, the stuart_build command-line would be:\r
124\r
125`stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py BLD_*_NETWORK_IP6_ENABLE=1`\r
126\r
127## References\r
128\r
129- [Installing and using Pytools](https://github.com/tianocore/edk2-pytool-extensions/blob/master/docs/using.md#installing)\r
130- More on [python virtual environments](https://docs.python.org/3/library/venv.html)\r