From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VvS0u-00068C-1y for mharc-grub-devel@gnu.org; Tue, 24 Dec 2013 08:27:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvS0k-000671-FC for grub-devel@gnu.org; Tue, 24 Dec 2013 08:27:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvS0c-0004H0-1M for grub-devel@gnu.org; Tue, 24 Dec 2013 08:27:02 -0500 Received: from mail-ee0-x233.google.com ([2a00:1450:4013:c00::233]:56751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvS0b-0004Gv-PS for grub-devel@gnu.org; Tue, 24 Dec 2013 08:26:53 -0500 Received: by mail-ee0-f51.google.com with SMTP id b15so2892587eek.38 for ; Tue, 24 Dec 2013 05:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=pq5El+Miqq7xVyL8c6dGwgBt9wruflRa1QbCIS1KFg8=; b=RW81X9M180POOETegTzrhTJLwhGWBIa9ttHbpvV1QbcXlWAm7k6nWBzaAemR2ERprv fIiWXHHCMRCpMiK8KXa26mE2QvYzGaAJoU+VpjR7sZCkzNaX1af6IIUmz2SPFQ6Ddih0 eHwYPLvnkrLY0QGq8SRAsOYhcB9bTp4G7JhfcGjI2ScuMhrg+AUwSozP87dWON3ZhNAW EeViZHN4gd9rNiNTG6EqDM2clGsSc5C+TYLNCt9uqYlCN7Z7ow0m8YN1UAppk8WwVGyI se2JmOLcaeXDOy3jCnMG7nMqo1q7di7ywZHe/VkkyHcUNiN883V5u7hVwC5Es1CxlbPg vAuA== X-Received: by 10.15.52.73 with SMTP id o49mr2629925eew.60.1387891612995; Tue, 24 Dec 2013 05:26:52 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id 1sm55008094eeg.4.2013.12.24.05.26.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Dec 2013 05:26:51 -0800 (PST) Message-ID: <52B98B9A.5020609@gmail.com> Date: Tue, 24 Dec 2013 14:26:50 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: The development of GRUB 2 Subject: [PATCH] Skip Apple ghosts X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5dIE8dgNae4OEfwxBFv0voN1IA2Frhk0G" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::233 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 13:27:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5dIE8dgNae4OEfwxBFv0voN1IA2Frhk0G Content-Type: multipart/mixed; boundary="------------060304020900070403080502" This is a multi-part message in MIME format. --------------060304020900070403080502 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, all. It was discovered that on macs sometimes firmware defines ghost disks with vendor suffix. E.g. /ACPI(a0341d0,0)/PCI(2,1f)/UnknownMessaging(12)/EndEntire is a normal disks with partitions presented with HD(...) but then /ACPI(a0341d0,0)/PCI(2,1f)/UnknownMessaging(12)/MediaVendor(Apple)[0: ]/EndEntire is a ghost disk. It has as suffix a vendor path with empty vendor data. This is a problem because when chainloading on such disks GRUB can't find handle of partition as none is defined. I propose to dkip ghosts completely. This should be safe as the skip happens only for empty Apple vendor suffix and if the parent is already a known disk. Did anyone see anything similar? --------------060304020900070403080502 Content-Type: text/x-diff; name="appledisk.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="appledisk.diff" diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index e04203f..3b12c34 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; =20 + /* Ghosts proudly presented by Apple. */ + if (GRUB_EFI_DEVICE_PATH_TYPE (dp) =3D=3D GRUB_EFI_MEDIA_DEVICE_PA= TH_TYPE + && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) + =3D=3D GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE) + { + grub_efi_vendor_device_path_t *vendor =3D (grub_efi_vendor_device_pat= h_t *) dp; + const struct grub_efi_guid apple =3D GRUB_EFI_VENDOR_APPLE_GUID; + + if (vendor->header.length =3D=3D sizeof (*vendor) + && grub_memcmp (&vendor->vendor_guid, &apple, + sizeof (vendor->vendor_guid)) =3D=3D 0 + && find_parent_device (devices, d)) + continue; + } + m =3D d->block_io->media; if (GRUB_EFI_DEVICE_PATH_TYPE (dp) =3D=3D GRUB_EFI_ACPI_DEVICE_PAT= H_TYPE && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) --------------060304020900070403080502-- --5dIE8dgNae4OEfwxBFv0voN1IA2Frhk0G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlK5i5oACgkQmBXlbbo5nOv78AEAqbmVSRFjSV6rnId/FSXT0mnI XNBzRuOlvRgMI3NVTsYA/jysbqtH8GDezwLbVNAL43Ajymv9aqI04ReEc7a0h2Nz =kgvV -----END PGP SIGNATURE----- --5dIE8dgNae4OEfwxBFv0voN1IA2Frhk0G--