Add qemu UEFI firmware support.

This commit is contained in:
2025-02-25 02:53:28 +00:00
parent 00d3a1de72
commit b945416665
3 changed files with 55 additions and 3 deletions
+18
View File
@@ -135,6 +135,23 @@ else
debug_flags=""
fi
if [ $USE_LEGACY_BIOS ]; then
boot_flags=""
else
# Check for the presence of the OVMF firmware.
if [ ! -f $build_dir/RELEASEX64_OVMF_CODE.fd ]; then
info "Downloading OVMF UEFI firmware for QEMU"
info "To disable this, set USE_LEGACY_BIOS=1."
pushd $build_dir
curl https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_CODE.fd -LO || error "failed to download OVMF firmware for UEFI"
curl https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_VARS.fd -LO || error "failed to download OVMF firmware for UEFI"
popd
fi
boot_flags="-drive if=pflash,format=raw,readonly=on,file=$build_dir/RELEASEX64_OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$build_dir/RELEASEX64_OVMF_VARS.fd"
fi
# Set up test-specific flags
if [ $is_test -eq 1 ]; then
test_flags="-device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none"
@@ -189,5 +206,6 @@ qemu-system-x86_64 -M q35 \
-no-reboot \
${test_flags} \
${debug_flags} \
${boot_flags} \
${QEMU_FLAGS:-}
+17
View File
@@ -131,6 +131,23 @@ fi
# I'm lazy but I just remove GDB flags when running this script.
debug_flags=""
if [ $USE_LEGACY_BIOS ]; then
boot_flags=""
else
# Check for the presence of the OVMF firmware.
if [ ! -f $build_dir/RELEASEX64_OVMF_CODE.fd ]; then
info "Downloading OVMF UEFI firmware for QEMU"
info "To disable this, set USE_LEGACY_BIOS=1."
pushd $build_dir
curl https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_CODE.fd -LO || error "failed to download OVMF firmware for UEFI"
curl https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_VARS.fd -LO || error "failed to download OVMF firmware for UEFI"
popd
fi
boot_flags="-drive if=pflash,format=raw,readonly=on,file=$build_dir/RELEASEX64_OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$build_dir/RELEASEX64_OVMF_VARS.fd"
fi
# Set up test-specific flags
if [ $is_test -eq 1 ]; then
test_flags="-device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none"