Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MOgGV-00018m-0w for mharc-grub-devel@gnu.org; Wed, 08 Jul 2009 19:09:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOgGT-00018Q-GV for grub-devel@gnu.org; Wed, 08 Jul 2009 19:09:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOgGP-00017x-Lg for grub-devel@gnu.org; Wed, 08 Jul 2009 19:09:25 -0400 Received: from [199.232.76.173] (port=48006 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOgGP-00017u-If for grub-devel@gnu.org; Wed, 08 Jul 2009 19:09:21 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]:47660) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOgGP-0002eR-2I for grub-devel@gnu.org; Wed, 08 Jul 2009 19:09:21 -0400 Received: by ewy4 with SMTP id 4so6977031ewy.42 for ; Wed, 08 Jul 2009 16:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=RdGhHJqCjUR+QydZUESitEGqzVBRDgAhxpV/kN8b1HQ=; b=hvU7VmeUZSLLCTh7Bcx0YFieCZ2zjfnANWmsSn7uU82O8FQJOYKk3MghlyDOqmEk7j DbYL8nNCCRldEQvcD+lEeS15gxZWtYIFARylgKa/jdclaNoFggKDQqiXoPoLQqO9KvDH yzE40m/Pt9Rxq1Paz9nARR2PSVzRj5pJwbWuo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CkxRMJGulaa6MR1djkY0iMXCRp6f6jDg6FzZWevMtk0mbl2bSoYnORQR4H8G8/Rz0+ DtIhTJ1d2QGLG0/na89Nh9dJdExKjmzA+Sh7GI66w3aOUMu9C503EtWag0nFP6LeqNzz JjQJfNjToQomAgd7qf/23WC+TPpmqc9RkxPjU= MIME-Version: 1.0 Received: by 10.210.41.14 with SMTP id o14mr79452ebo.47.1247094560126; Wed, 08 Jul 2009 16:09:20 -0700 (PDT) In-Reply-To: <1247005027.3393.82.camel@mj> References: <15498-60872@sneakemail.com> <1247005027.3393.82.camel@mj> Date: Thu, 9 Jul 2009 01:09:20 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Wed, 08 Jul 2009 23:09:25 -0000 Sorry for posting some not very-related ideas in one mail and top-posting but I want to go to bed ASAP now. FAT install is important. A friend asked me on RMLL to install GRUB on his partionless SD card. This card was formatted with Symbian and contained no "FAT32" string. I actually see no reason to keep the check for this string. Originally it was added to ignore some recovery partitions from the list. But there is no reason to do so even if they normally contain no useful data. It's user's freedom to read even useless data in GRUB. Current grub-setup may have a bug to accidently detect FAT* as pc_partition_map (they share signature) and try to embed with potentially bad results For FAT booting I would prefer to have 3 separate sectors able to parse FAT32/FAT16/FAT12. I would prefer it to be able to go into subdirectories but in worst case grub-install can copy core.img to the root. Or we can use so-called "reserved sectors" on FAT to either store second part of parser or embed core. For the latter the obstacle is that it's typically only around 32 reserved sectors. On Wed, Jul 8, 2009 at 12:17 AM, Pavel Roskin wrote: > 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 i= t). > > I think a much bigger issue is that installing on FAT32 it was allowed > at all! =A0I assume that even with your patch, installing the GRUB > bootsector into some filesystems would still break them. =A0We 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: >> =A0 =A0 * change the offset of the end of BPB >> =A0 =A0 * change the offsets of the data inside the region of Extended B= PB >> =A0 =A0 * remove 2 constants that are never used > > Removing unused constants is better done in a separate patch. =A0And they > should be specified by name. > >> =A0 =A0 * change the minor version of the GRUB_BOOT_VERSION 4.0 =3D> 4.1 > > I don't see where it's checked. =A0What's the effect of the change? > >> =A0 =A0 * change the string of hd_probe_error_string from "Hard Drive" t= o "HD" >> =A0 =A0 =A0 =A0because i needed 2 extras bytes and do not want to change= the working >> =A0 =A0 =A0 =A0code of the boot. > > It means the code is very tight. =A0We would not able to add any > workarounds or features in the future. > > When is the ability to install on FAT32 important? =A0If 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. =A0I think we should > need either one hole or another. =A0That 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. =A0Besides, the > use of tabs is justified for alignment. > > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git