From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MOIym-0003JI-Ct for mharc-grub-devel@gnu.org; Tue, 07 Jul 2009 18:17:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOIyj-0003HV-VT for grub-devel@gnu.org; Tue, 07 Jul 2009 18:17:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOIyf-0003Fb-Hz for grub-devel@gnu.org; Tue, 07 Jul 2009 18:17:33 -0400 Received: from [199.232.76.173] (port=40947 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOIyf-0003FY-7V for grub-devel@gnu.org; Tue, 07 Jul 2009 18:17:29 -0400 Received: from c60.cesmail.net ([216.154.195.49]:36758) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MOIye-0007hh-Pq for grub-devel@gnu.org; Tue, 07 Jul 2009 18:17:29 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 07 Jul 2009 18:17:09 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 45F5234C6A for ; Tue, 7 Jul 2009 18:25:31 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <15498-60872@sneakemail.com> References: <15498-60872@sneakemail.com> Content-Type: text/plain Date: Tue, 07 Jul 2009 18:17:07 -0400 Message-Id: <1247005027.3393.82.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: boot.img Fix 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: Tue, 07 Jul 2009 22:17:34 -0000 On Tue, 2009-07-07 at 10:08 +0200, Yves BLUSSEAU wrote: > Hi, > > there is a "bug" in boot.img: if you install the boot.img into the > volume boot sector of a FAT32 partition instead of MBR (i know it's a > bad idea), you "destroyed" the partition (even grub will not recognize it). I think a much bigger issue is that installing on FAT32 it was allowed at all! I assume that even with your patch, installing the GRUB bootsector into some filesystems would still break them. We need a check that the bootsector is compatible with the filesystem. > The problem is that the FAT32 FileSystem need a 87 bytes long BPB > instead of the 59 bytes long for FAT16 > (http://en.wikipedia.org/wiki/File_Allocation_Table#Boot_Sector). > So the boot.img need to preverse the first 90 bytes of the first sectors > of a FAT32 partition. > I made this patch to fix it and it work perfectly. > > What i have done is: > * change the offset of the end of BPB > * change the offsets of the data inside the region of Extended BPB > * remove 2 constants that are never used Removing unused constants is better done in a separate patch. And they should be specified by name. > * change the minor version of the GRUB_BOOT_VERSION 4.0 => 4.1 I don't see where it's checked. What's the effect of the change? > * change the string of hd_probe_error_string from "Hard Drive" to "HD" > because i needed 2 extras bytes and do not want to change the working > code of the boot. It means the code is very tight. We would not able to add any workarounds or features in the future. When is the ability to install on FAT32 important? If it's just a way to fix a missing check in grub-setup, then I'll rather have some extra space. The same boot.S has a hole for the partition table. I think we should need either one hole or another. That would allow us to have two versions of boot.img, one for FAT bootsector and another for MBR. > -notification_string: .asciz "GRUB " It's better not to mix formatting and essential changes. Besides, the use of tabs is justified for alignment. -- Regards, Pavel Roskin