From dc3286ade43657e070f9920f154c182589115e87 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 24 Dec 2013 20:32:14 +0100 Subject: [PATCH] * grub-core/disk/efi/efidisk.c (name_devices): Skip Apple ghosts. --- ChangeLog | 4 ++++ grub-core/disk/efi/efidisk.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9931c96bc..3545ea1a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-24 Vladimir Serbinenko + + * grub-core/disk/efi/efidisk.c (name_devices): Skip Apple ghosts. + 2013-12-24 Andrey Borzenkov * util/grub-probe.c: Improve help message and simplify list handling. diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index e04203fe0..3b12c3499 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -333,6 +333,21 @@ name_devices (struct grub_efidisk_data *devices) if (! dp) continue; + /* Ghosts proudly presented by Apple. */ + if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE + && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) + == GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE) + { + grub_efi_vendor_device_path_t *vendor = (grub_efi_vendor_device_path_t *) dp; + const struct grub_efi_guid apple = GRUB_EFI_VENDOR_APPLE_GUID; + + if (vendor->header.length == sizeof (*vendor) + && grub_memcmp (&vendor->vendor_guid, &apple, + sizeof (vendor->vendor_guid)) == 0 + && find_parent_device (devices, d)) + continue; + } + m = d->block_io->media; if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_ACPI_DEVICE_PATH_TYPE && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)