From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XiocI-0001st-V5 for mharc-grub-devel@gnu.org; Mon, 27 Oct 2014 14:02:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiocB-0001pY-N2 for grub-devel@gnu.org; Mon, 27 Oct 2014 14:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xioc6-0002SJ-1I for grub-devel@gnu.org; Mon, 27 Oct 2014 14:01:59 -0400 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:65180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xioc5-0002SD-Ql for grub-devel@gnu.org; Mon, 27 Oct 2014 14:01:53 -0400 Received: by mail-la0-f50.google.com with SMTP id s18so6309587lam.23 for ; Mon, 27 Oct 2014 11:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ayh7U8Rx08Rs5Y/3xVNbWH2k0d6TiiovyoMJ0MP2HWg=; b=X+oJEIS2SxQk4/AIEcjXKOdt6ECDaZSZ44eBL3kN8Q2hxXIALTER2Y695/+Gz0/e9L HVsqEkp5Ek51Rcu470lQnjlhg4tA3b1TvrXwPt4fofvyJkSd/PICQ4xnPMIU4gaCyKS0 JM1kg89hzaG3cuRZuR4BeKh6AwAZ+kb+Nq1jGIDLVn00GmFqbGvPxxIHp/DWNTeB3PGa zOyDFzTs4xtSn6omssLd2Eo+Je71o23R9XsQaqhY9r2NmBhZR9dMcK7Tma1rhCPG6+g0 UrhS8h7EyrmXxVN+CbQX8evrfJ+Pg4zYiNpwzQFaCSPNVZwxHN+jUCndjvG5J4JVrNos pzoQ== X-Received: by 10.152.30.33 with SMTP id p1mr25008037lah.78.1414432912375; Mon, 27 Oct 2014 11:01:52 -0700 (PDT) Received: from opensuse.site (ppp91-76-139-38.pppoe.mtu-net.ru. [91.76.139.38]) by mx.google.com with ESMTPSA id r1sm5223931lae.25.2014.10.27.11.01.50 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 11:01:51 -0700 (PDT) Date: Mon, 27 Oct 2014 21:01:46 +0300 From: Andrei Borzenkov To: Chris Murphy Subject: Re: GRUB booting Mac OS X (xnu) Message-ID: <20141027210146.04df5e4d@opensuse.site> In-Reply-To: References: <23F75FF8-A1AA-4BE0-9CB6-1AC8C7F78CD3@colorremedies.com> <20141026095305.6a6adea9@opensuse.site> <316FFE5F-DCA3-49F3-BE9F-82E57514DA55@colorremedies.com> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.23; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 Cc: The development of GNU GRUB 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: Mon, 27 Oct 2014 18:02:05 -0000 =D0=92 Mon, 27 Oct 2014 10:30:31 -0600 Chris Murphy =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > On Oct 27, 2014, at 1:39 AM, Andrei Borzenkov wrote: >=20 >=20 >=20 > > It does not look like anything needs to > > be changed in grub2 though. You will need to modify os-prober to > > return efi loader type in this case; grub2 already supports > > chainloading EFI binary in 30_os-prober. >=20 > 30_os-prober creates this entry for EFI systems: > 284 chainloader /EFI/${DEVICE} >=20 No, it does not. It creates prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" cat < This won't work on Macs, because the OS X bootloader isn't a.) on the ESP= and b.) isn't in an \EFI directory. >=20 Fine. So write or extend os-prober script that returns correct path. > So it looks like os-prober needs to look for the Apple Boot partitiontype= GUID, pass that device to 30_os-prober which can then do: > chainloader /System/Library/CoreServices/boot.efi >=20 > Currently 30_os-prober lines 44 to 103 appear obsolete and should be remo= ved. That's what creates the OS X entries right now using the various xnu m= odules. >=20 >=20 > >=20 > > You still need to keep current xnu loader (and macosx os-prober type) > > for the case of CSM boot though. >=20 > What's the use case for this? If you do not use it does not mean nobody is using it. It still works just fine if you want it. > Something like linux BIOS installation with i386 version of GRUB, and it uses the xnu modules to EFI boot OS X? OK, but that's still broken today=20 No, it is not. Please test it. > and going forward because neither GRUB nor linux can read Core Storage, which is where the xnu kernel and its initramfs are found. And anyone using any version of OS X for the past three years with full disk encryption likewise can't use GRUB xnu modules to EFI boot OS X from CSM mode either. This seems like a very legacy use case. >=20 > If it's possible to have an i386 30_os-prober that keeps the current osx = xnu module boot entries intact; but on x86_64 the 30_os-prober makes the gr= ub.cfg with chainloader, then I'm fine with that. >=20 > >=20 > >> The Apple Boot [1] is used by OS X 10.7 through 10.10, so it's a good = start point to search for OS X since it won't be anywhere else. > >>=20 > >=20 > > give grub device name; it is file system and has UUID right? So it is > > going to find it during boot just fine. >=20 > Yes, I mean for grub-mkconfig to create the entry via os-prober it's goin= g to need to know to only look for OS X's bootloader that has the Apple Boo= t partitiontype GUID because it's not going to find it anywhere else. And i= f it does, it's not really an OS X bootloader, it's likely a renamed grubx6= 4.efi masquerading as an OS X bootloader, so that the built-in firmware boo= t manager displays it as a boot option at start up time (which it doesn't d= o if the EFI binary is on the EFI System partition).