]> git.ipfire.org Git - thirdparty/grub.git/commit
tests/util/grub-shell: Use pflash instead of -bios to load UEFI firmware
authorGlenn Washburn <development@efficientek.com>
Sun, 9 Jun 2024 02:42:34 +0000 (21:42 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 20 Jun 2024 13:10:28 +0000 (15:10 +0200)
commitd2fc9dfcd1ca6fa7e8bd281b1b2d36dc125ecd20
tree9a843f2e92556dfe34796303283c12641c35c06e
parent88a7e64c2c38ff5d42098427e87563bceae3a4ba
tests/util/grub-shell: Use pflash instead of -bios to load UEFI firmware

According to the OVMF whitepaper [1]:

  IMPORTANT: Never pass OVMF.fd to qemu with the -bios option. That option
  maps the firmware image as ROM into the guest's address space, and forces
  OVMF to emulate non-volatile variables with a fallback driver that is
  bound to have insufficient and confusing semantics.

Use the pflash interface instead. Currently the unified firmware file is
used, which contains both firmware code and variable sections. By enabling
snapshot on the pflash device, the firmware can be loaded in such a way
that variables can be written to without writing to the backing file.

Since pflash does no searching for firmware paths that are not absolute,
unlike the -bios option, also make firmware paths absolute. Additionally,
update the previous firmware paths or file names that did not correspond to
ones installed by Debian.

Use the q35 machine, instead of the default i440fx, for i386-efi because
the default machine type does not emulate a flash device, which is now
needed to load the firmware.

[1] http://www.linux-kvm.org/downloads/lersek/ovmf-whitepaper-c770f8c.txt

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
tests/util/grub-shell.in