From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JlSMS-00059M-KQ for mharc-grub-devel@gnu.org; Mon, 14 Apr 2008 13:20:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlSMQ-000597-Lt for grub-devel@gnu.org; Mon, 14 Apr 2008 13:20:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlSMO-00058h-Uh for grub-devel@gnu.org; Mon, 14 Apr 2008 13:20:53 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlSMO-00058e-Rg for grub-devel@gnu.org; Mon, 14 Apr 2008 13:20:52 -0400 Received: from c60.cesmail.net ([216.154.195.49]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1JlSMO-00038o-Ny for grub-devel@gnu.org; Mon, 14 Apr 2008 13:20:52 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 14 Apr 2008 13:20:50 -0400 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 102EC619058 for ; Mon, 14 Apr 2008 13:20:50 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <200804141021.49995.Chris.Knadle@coredump.us> References: <200804131734.50447.Chris.Knadle@coredump.us> <20080414120742.GB24443@thorin> <200804141021.49995.Chris.Knadle@coredump.us> Content-Type: text/plain Date: Mon, 14 Apr 2008 13:20:49 -0400 Message-Id: <1208193649.4027.19.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: grub-probe fails to find PC partition due to Apple disklabel X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 17:20:54 -0000 On Mon, 2008-04-14 at 10:21 -0400, Chris Knadle wrote: > Instead of probing for partmaps in a particular order, it seems that > solving for this might best be done by probing for all of the possible > partmaps for the architecture and trying to figure out which one best fits. > grub2's grub-probe is clearly already doing this; _however_, somehow the PC > partmap probe is subtly different depending on whether partmap/apple.c is > included in the search. Apple and PC partition maps can coexist. The place occupied by the PC partition and the PC magic is not used by the Apple partition. The way to differentiate them would be to check at the first sector. If it starts with 0x45 0x52, then it's an Apple partition. A PC partition would have an executable entry there. The Apple magic would decode to: inc %bp push %dx It's highly unlikely to be used in the first two instructions of the PC boot code. partmap/apple.c starts reading with the second sector (unsigned pos = GRUB_DISK_SECTOR_SIZE). Perhaps it should read the first sector to check the magic. -- Regards, Pavel Roskin