With this patch, efibootmgr generates the following device path scheme for
virtio-scsi disks, matching the ones installed by OVMF's VirtioScsiDxe:

  ACPI(a0341d0,0)PCI(4,0)SCSI(5,6)\
  HD(1,800,64000,87b09cbe-32b9-4737-8ecc-c1e65702cfb6)\
  File(\EFI\redhat\grub.efi)

For now the user has to specify "-e 3" on the command line, to enable EDD
3.0 support under OVMF. (The autodetection code in get_edd_version() seems
to be EFI inheritance, it doesn't work under UEFI / edk2.)

Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=998611

Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 src/lib/disk.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/lib/disk.c b/src/lib/disk.c
index c82ac80..720452c 100644
--- a/src/lib/disk.c
+++ b/src/lib/disk.c
@@ -203,6 +203,7 @@ disk_get_virt_pci(const struct disk_info *info, unsigned 
char *bus,
 
 static int
 disk_get_scsi_pci(int fd, 
+            const struct disk_info *info,
             unsigned char *bus,
             unsigned char *device,
             unsigned char *function)
@@ -232,6 +233,9 @@ disk_get_scsi_pci(int fd,
                perror("get_scsi_pci");
                return rc;
        }
+       if (strncmp(slot_name, "virtio", 6) == 0) {
+               return disk_get_virt_pci(info, bus, device, function);
+       }
        rc = sscanf(slot_name, "%x:%x.%x", &b,&d,&f);
        if (rc != 3) {
                printf("sscanf failed\n");
@@ -325,7 +329,7 @@ disk_get_pci(int fd,
                return disk_get_ide_pci(fd, bus, device, function);
                break;
        case scsi:
-               return disk_get_scsi_pci(fd, bus, device, function);
+               return disk_get_scsi_pci(fd, &info, bus, device, function);
                break;
        case i2o:
                break;
-- 
1.7.1


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to