Skip to content

Building manual


This documents describes the procedure for compiling Dasharo firmware for QEMU Q35.


sudo apt install git unzip wget


Obtain Dasharo source code:

Replace the REVISION with one of the:

  • qemu_q35_vVERSION (e.g. qemu_q35_v0.1.0) for the given release
  • qemu_q35_vVERSION-rcN (e.g. qemu_q35_v0.1.0-rc1) for the given release candidate

Clone Dasharo EDK II fork:

git clone -b REVISION

Change directory:

cd edk2

Update the submodules in order get latest dependencies.

git submodule update --init --checkout --recursive

Change directory:

cd ..

Clone Dasharo EDK II Platforms fork:

git clone -b v0.9.0

Clone iPXE:

git clone

Build iPXE

Change directory:

cd ipxe


git checkout 77b07ea4fdc259d7253c6f9df2beda6e6c7a9d85

NOTE: This commit was chosen by chainloading 10x. There was zero failures, where other commits lead to even 50% timeuts.

Enabled Dasharo script

sed -i 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "src/config/general.h"

Get the script:


Enabled HTTPS

sed -i 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g'  "src/config/general.h"


Start the instance of the docker image under the Dasharo/edk2 repository:

docker run --rm -it -v $PWD/../edk2:/home/coreboot/edk2 \
    -v $PWD/../edk2-platforms:/home/coreboot/edk2-platforms \
    -v $PWD:/home/coreboot/ipxe \
    -w /home/coreboot/ipxe coreboot/coreboot-sdk:2021-09-23_b0d87f753c \

Export cross compiler prefix:

export CROSS_COMPILE="x86_64-elf-"


make -C src bin-x86_64-efi-sb/ipxe.efi EMBED=$PWD/dasharo.ipxe BUILD_ID_CMD="echo 0x1234567890" \
    EXTRA_CFLAGS="-Wno-address-of-packed-member  -m64  -fuse-ld=bfd \
    -Wl,--build-id=none -fno-delete-null-pointer-checks -Wlogical-op -march=nocona \
    -malign-data=abi -mcmodel=large -mno-red-zone -fno-pic"

Build EDK II

Change directory:

cd ../edk2

Setup the environment variables with the following command


Compile EDK II base tools:

make -C BaseTools

Update the PACKAGES_PATH variable:

export EDK2_PLATFORMS_PATH="$HOME/edk2-platforms"

To build the image simply invoke the following command

build -a IA32 -a X64 -t GCC5 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc

Once the build is completed you should see output as follows:

GUID cross reference file can be found at /home/coreboot/edk2/Build/OvmfX64/RELEASE_GCC5/FV/Guid.xref

FV Space Information
SECFV [5%Full] 212992 total, 11568 used, 201424 free
PEIFV [15%Full] 917504 total, 139640 used, 777864 free
DXEFV [46%Full] 12582912 total, 5849680 used, 6733232 free
FVMAIN_COMPACT [41%Full] 3440640 total, 1430512 used, 2010128 free

- Done -
  Build end time: 21:52:36, Oct.22 2023
  Build total time: 00:01:41

The Dasharo firmware image can be found below given path:


Initial Deployment

Now you can proceed with initial deployment scenario according to you needs: