Building EDK2 Qemu From Scratch On Raspberry Pi
Prerequisites
- a Raspberry PI 4B
- a SD Card, has installed Ubuntu for Raspberry Pi
Building EDK2
Install required packages
1
sudo apt install build-essential git uuid-dev iasl nasm python
Get the latest source for EDKII
1
2
3mkdir code; cd code
git clone https://github.com/tianocore/edk2.git
cd edk2; git submodule update --initConfig and building
- Compile base tools
1
make -C BaseTools
- Set up build environment
1
. ./edksetup.sh
- Compile base tools
Set up build target
1
vi Conf/target.txt
- set ACTIVE_PLATFORM = ArmVirtPkg/ArmVirtQemu.dsc
- set TARGET = DEBUG
- set TARGET_ARCH = AARCH64
- set TOOL_CHAIN_TAG = GCC5
Building MdeModulePkg module package
1
build
Note: build, which is exported by edksetup.sh, is not a system command
Get the UEFI bin
1
ls Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/FV/QEMU_EFI.fd
Building Qemu
Get the latest source for Qemu
1
2
3cd ..
wget https://download.qemu.org/qemu-6.0.0.tar.xz
tar -xvf qemu-6.0.0.tar.xzInstall required packages
1
2sudo apt install build-essential
sudo apt install libaio1 libaio-devConfig and building
1
2
3cd qemu-6.0.0
./configure --enable-trace-backend=simple --enable-debug --target-list=aarch64-softmmu --prefix=/usr/local --without-default-features --enable-kvm --enable-linux-aio --enable-vhost-net --enable-vhost-vsock --enable-vhost-scsi --enable-vhost-kernel --enable-vnc --enable-tools
make -j 3Note: type ./configure –help to set your own configurations
Get the Qemu bin
1
2./build/qemu-system-aarch64 --version
./build/qemu-img --version