2022-03-07

Compiling OVMF on Debian

How to compile OvmfPkg of TianoCore's EDK II on Debian:

  1. sudo apt install build-essential gcc git iasl nasm uuid-dev
  2. mkdir ~/src; cd ~/src
  3. git clone https://github.com/tianocore/edk2; cd edk2 (compilation issues concerning brotli have been fixed with pull #2514)
  4. git submodule update --init
  5. make -C BaseTools
  6. . edksetup.sh
  7. Edit ./Conf/target.txt:
    ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc
    TARGET = RELEASE
    TARGET_ARCH = X64
    TOOL_CHAIN_TAG = GCC5
  8. build (to compile with Secure Boot enabled, append -D SECURE_BOOT_ENABLE - though it doesn't seem to work without manually adding keys to OVMF_VARS.fd)
  9. FD located in ./Build/OvmfPkg/RELEASE_GCC5/FV
(This is more of a reference for myself than anything else.)