From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MSEvM-0006Yo-OV for mharc-grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MSEvL-0006YS-Nv for grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MSEvH-0006WK-5t for grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:19 -0400 Received: from [199.232.76.173] (port=56536 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MSEvG-0006WB-Os for grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:14 -0400 Received: from mx20.gnu.org ([199.232.41.8]:43422) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MSEvG-00016m-3i for grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:14 -0400 Received: from aybabtu.com ([69.60.117.155]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MSEvF-0004YN-78 for grub-devel@gnu.org; Sat, 18 Jul 2009 14:46:13 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MSDpe-0003CX-EW for grub-devel@gnu.org; Sat, 18 Jul 2009 19:36:25 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MSEux-0003XN-Nk for grub-devel@gnu.org; Sat, 18 Jul 2009 20:45:55 +0200 Date: Sat, 18 Jul 2009 20:45:55 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090718184555.GH8867@thorin> References: <20090717165140.GN11691@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090717165140.GN11691@riva.ucam.org> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] Fix when installing on pationless but partionable medium 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: Sat, 18 Jul 2009 18:46:20 -0000 On Fri, Jul 17, 2009 at 05:51:40PM +0100, Colin Watson wrote: > On Fri, Jul 17, 2009 at 06:41:59PM +0200, Vladimir 'phcoder' Serbinenko wrote: > > Sometimes a media that can be partioned isn't really partioned. E.g. > > usb sticks. This is a patch to handle this situation. Unfortunately > > such medium is often formated with a flavour of FAT which shares its > > signature with MBR so it may be easily misidentified as > > pc_partition_table. Furthermore the same signature is shared with > > bootsectors including grub. One possibility is to try interpret disk > > as known filesystems and see if we succeed. But the problem is that > > the check for FAT are light and may result in false positives too. The > > only more or less advanced check there is a check for FATXX string. > > But I was about to propose to eliminate this check since I encountered > > a FAT filesystem without this string on friend's SD card formatted > > with symbian which he wanted to use as liveusb. Does anyone has a > > better idea? > > When checking for an MBR filesystem label, parted checks whether each of > partitions 1-4 has a boot indicator that's either 0 or 0x80, since as > you point out checking for the FAT signature suffers false positives; I > believe this algorithm matches that in the Linux kernel. Look at > libparted/labels/dos.c:msdos_probe(), which is already FSF-copyrighted > and GPLv3+. GRUB should use the same algorithm, and then the worst case > is that things will fail consistently. I might be missing something about this check, but GRUB doesn't require that the boot flag is present. Therefore, its non presence doesn't imply this is not a real msdos label. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."