You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
os-autoinst/625.patch

63 lines
2.5 KiB

From 7261632228be96aeeaf1068f01639d506368f692 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Tue, 18 Oct 2016 11:23:52 -0700
Subject: [PATCH] Factor out and update known UEFI firmware locations
We had two files defining the same list of known locations
for the OVMF (UEFI) firmware file, so factor them into a
shared array provided by bmwqemu. Also Fedora now has a
distro edk2-ovmf package, so add the pure EFI firmware from
that to the list.
---
backend/qemu.pm | 5 +----
bmwqemu.pm | 4 ++++
consoles/sshVirtsh.pm | 4 +---
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/backend/qemu.pm b/backend/qemu.pm
index 6022c0e..6b94177 100644
--- a/backend/qemu.pm
+++ b/backend/qemu.pm
@@ -255,10 +255,7 @@ sub start_qemu {
}
if ($vars->{UEFI} && $vars->{ARCH} eq 'x86_64' && !$vars->{BIOS}) {
- # We have to try and find a firmware for UEFI. These are known
- # locations for openSUSE and Fedora (respectively).
- my @known = ('/usr/share/qemu/ovmf-x86_64-ms.bin', '/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd');
- foreach my $firmware (@known) {
+ foreach my $firmware (@bmwqemu::ovmf_locations) {
if (-e $firmware) {
$vars->{BIOS} = $firmware;
last;
diff --git a/bmwqemu.pm b/bmwqemu.pm
index 75109b5..af774b8 100755
--- a/bmwqemu.pm
+++ b/bmwqemu.pm
@@ -59,6 +59,10 @@ our $istty;
our $direct_output;
our $standstillthreshold = scale_timeout(600);
+# Known locations of OVMF (UEFI) firmware: first is openSUSE, second is
+# the kraxel.org nightly packages, third is Fedora's edk2-ovmf package.
+our @ovmf_locations = ('/usr/share/qemu/ovmf-x86_64-ms.bin', '/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd', '/usr/share/edk2/ovmf/OVMF_CODE.fd');
+
our %vars;
sub load_vars() {
diff --git a/consoles/sshVirtsh.pm b/consoles/sshVirtsh.pm
index 309e898..7012712 100644
--- a/consoles/sshVirtsh.pm
+++ b/consoles/sshVirtsh.pm
@@ -136,9 +136,7 @@ sub _init_xml {
}
if (get_var('UEFI') and check_var('ARCH', 'x86_64') and !get_var('BIOS')) {
- # These are known locations for openSUSE and Fedora (respectively).
- my @known = ('/usr/share/qemu/ovmf-x86_64-ms.bin', '/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd');
- foreach my $firmware (@known) {
+ foreach my $firmware (@bmwqemu::ovmf_locations) {
if (!$self->run_cmd("test -e $firmware")) {
set_var('BIOS', $firmware);
$elem = $doc->createElement('loader');