Updated guide for building EDK2 firmware on the ASRock Rack ALTRAD8UD platform, superseding an earlier article focused on Mt. Jade. Altrad8ud support was committed to the EDK2 mainline several months ago by Rebecca.
Environment Setup (Ubuntu 24.04)
sudo apt install build-essential uuid-dev iasl nasm \
gcc-aarch64-linux-gnu python3-distutils git
Clone the required repositories:
git clone https://github.com/tianocore/edk2.git
git clone https://github.com/tianocore/edk2-platforms.git
git clone https://github.com/tianocore/edk2-non-osi.git
git clone https://github.com/AmpereComputing/edk2-ampere-tools.git
git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
Initialize BaseTools
cd edk2
git submodule update --init
make -C BaseTools
source edksetup.sh
Build ARM Trusted Firmware (ATF)
cd trusted-firmware-a
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=altra \
bl31 fiptool certtool
Set Environment Variables
export WORKSPACE=/path/to/workspace
export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi
export VENDOR_NAME="ASRock Rack"
export BOARD_NAME="ALTRAD8UD"
Run buildfw.sh
# RELEASE build with Secure Boot and TPM2
./edk2-ampere-tools/buildfw.sh \
-b RELEASE \
-p AmpereAltraAltrad8udPkg \
--secure-boot --tpm2
Available options include RELEASE/DEBUG, Secure Boot, networking, and TPM2.
Merge into Stock BIOS
The resulting EDK2 image is ~10MB and must be merged into the 32MB stock BIOS
at offset 0x600000:
cp stock_bios.bin merged_bios.bin
dd if=edk2_image.bin of=merged_bios.bin bs=1 seek=$((0x600000)) conv=notrunc
# Package for WebGUI upload
tar czf altrad8ud_bios.tar.gz merged_bios.bin
Alternatively, deploy directly via the BMC interface.
Originally published at blog.richliu.com