Skip to content

Commit

Permalink
UefiPayloadPkg: Enhance ReadMe.md for ELF and FIT
Browse files Browse the repository at this point in the history
Enhance and introduce environment construction and
build step for ELF and FIT format payload

Signed-off-by: Gua Guo <[email protected]>
  • Loading branch information
gguo11837463 authored and mergify[bot] committed Sep 23, 2024
1 parent 1a89c69 commit 4c3bffa
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions UefiPayloadPkg/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Provide UEFI Universal Payload for different bootloader to generate EFI environment

# Spec
UniversalPayload URL: https://universalscalablefirmware.github.io/documentation/2_universal_payload.html
UniversalPayload URL: https://universalpayload.github.io/spec/
ELF Format URL: https://refspecs.linuxfoundation.org/elf/elf.pdf
FIT Format URL: https://universalpayload.github.io/spec/chapter2-payload-image-format.html
- UniversalPayload URL: https://universalscalablefirmware.github.io/documentation/2_universal_payload.html
- UniversalPayload URL: https://universalpayload.github.io/spec/
- ELF Format URL: https://refspecs.linuxfoundation.org/elf/elf.pdf
- FIT Format URL: https://universalpayload.github.io/spec/chapter2-payload-image-format.html

# Uefi UniversalPayload Format
| Binary Format | HandOffPayload - HOB |
Expand Down Expand Up @@ -48,29 +48,19 @@ FIT Format URL: https://universalpayload.github.io/spec/chapter2-payload-image-f
+ +-----------------------+
```

# Environment
# Build Environment
- ELF
```
Download and install https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.1
Install GCC compiler on linux and MSVC compiler on windows
Install CLANG compiler https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.1 on windows and linux
```
- FIT
- Windows
```
Download and install swig by https://swig.org/ and also set install path into environment variable
```
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install dtc-msys2
pip3 install pefile
pip3 install pylibfdt
```
- Ubuntu
```bash
sudo apt install -y u-boot-tools
pip3 install pefile
pip3 install swig
pip3 install pylibfdt
```
```
Install GCC compiler on linux and MSVC compiler on windows
pip3 install pefile
pip3 install pylibfdt
```

# How to build UEFI UniversalPayload
- Windows
- edksetup Rebuild
Expand All @@ -84,6 +74,24 @@ FIT Format URL: https://universalpayload.github.io/spec/chapter2-payload-image-f

- UniversalPayload.fit
- python UefiPayloadPkg/UniversalPayloadBuild.py -t <TOOL_CHAIN_TAG> --Fit

# How to dump payload binary data
- UniversalPayload.elf
- Install elf dump tools https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.1
- llvm-objdump -h Build/UefiPayloadPkgX64/UniversalPayload.elf

- UniversalPayload.fit
- Install fdtdump tool
- Windows
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install dtc-msys2
```
- Linux
```bash
sudo apt install -y u-boot-tools
```

- fdtdump Build/UefiPayloadPkgX64/UniversalPayload.fit

# Edk2boot + UefiUniversalPayload
Expand Down

0 comments on commit 4c3bffa

Please sign in to comment.