Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


compile_efi_firmware_http_boot

UEFI HTTP Boot (instead of TFTP)

This how-to is based on Debian 9 and will result in a compiled EFI firmware binary, capable of booting over HTTP instead of TFTP.

New systems that support UEFI 2.5 and up (HPE, Lenovo) will be able to boot over HTTP(S). Compared to TFTP, HTTP is faster, can transfer much larger files and can be encrypted (TLS).

Documentation:

Compile EDK II

  • Install required packages:
    sudo apt-get install build-essential uuid-dev iasl git nasm
  • Clone git repository:
    mkdir ~/src
    cd ~/src
    git clone https://github.com/tianocore/edk2
  • Compile build tools:
    cd ~/src/edk2
    make -C BaseTools
    . edksetup.sh
  • Build the EDK II BaseTools:
    cd ..
    make -C edk2/BaseTools
  • Setup build shell environment
    cd ~/src/edk2
    export EDK_TOOLS_PATH=$HOME/src/edk2/BaseTools
    . edksetup.sh BaseTools
  • Modify config Conf/target.txt
    ACTIVE_PLATFORM       = OvmfPkg/OvmfPkgX64.dsc
    TARGET_ARCH           = X64
    TARGET                = NOOPT
    TOOL_CHAIN_TAG        = GCC5
  • Enable HTTP boot in OvmfPkg/OvmfPkgX64.dsc
      DEFINE HTTP_BOOT_ENABLE        = TRUE
  • Build:
    build
  • After successful compilation, the binary can be found in ~/src/edk2/Build/OvmfX64/NOOPT_GCC5/FV/
    OVMF_CODE.fd     Binary
    OVMF_VARS.fd     Variable store

Test with qemu

  • Install qemu:
    sudo apt-get install qemu-system-x86
  • Start VM with EFI firmware:
    qemu-system-x86_64 \
        -drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
        -drive if=pflash,format=raw,file=OVMF_VARS.fd \
        -enable-kvm \
        -m 1G \
        -monitor stdio

Press ESC at the logo

Go to Boot Manager

Select UEFI HTTPv4

compile_efi_firmware_http_boot.txt · Last modified: 2018/01/09 22:44 by admin