From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ih5ip-0001Vu-74 for mharc-grub-devel@gnu.org; Sun, 14 Oct 2007 11:49:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ih5in-0001Ub-Ns for grub-devel@gnu.org; Sun, 14 Oct 2007 11:49:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ih5im-0001UG-UP for grub-devel@gnu.org; Sun, 14 Oct 2007 11:49:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ih5im-0001UD-Oe for grub-devel@gnu.org; Sun, 14 Oct 2007 11:49:40 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ih5im-0007OO-A2 for grub-devel@gnu.org; Sun, 14 Oct 2007 11:49:40 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Ih5ii-0000Ii-AH for grub-devel@gnu.org; Sun, 14 Oct 2007 17:49:37 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Ih5iJ-000658-Tq for grub-devel@gnu.org; Sun, 14 Oct 2007 17:49:11 +0200 Date: Sun, 14 Oct 2007 17:49:11 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20071014154911.GA23357@thorin> References: <20071005095948.GA27825@thorin> <20071005123008.GA3916@thorin> <20071006201644.GA8454@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <20071006201644.GA8454@thorin> Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] do not require that device is a partition 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: Sun, 14 Oct 2007 15:49:42 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline New patch after IRC discussion with Marco. code + ChangeLog should be self-explanatory. -- Robert Millan I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.) --2oS5YaxWCcQjTEyO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="disk.diff" 2007-10-14 Robert Millan * normal/misc.c (grub_normal_print_device_info): Do not probe for filesystem when dev->disk is unset. Do probe for filesystem even when dev->disk->has_partitions is set. In case a filesystem is found, always report it. In case it isn't, if dev->disk->has_partitions is set, report that a partition table was found instead of reporting that no filesystem could be identified. diff -pur grub2/normal/misc.c grub2.disk/normal/misc.c --- grub2/normal/misc.c 2007-07-22 01:32:29.000000000 +0200 +++ grub2.disk/normal/misc.c 2007-10-14 17:41:57.000000000 +0200 @@ -40,7 +40,7 @@ grub_normal_print_device_info (const cha dev = grub_device_open (name); if (! dev) grub_printf ("Filesystem cannot be accessed"); - else if (! dev->disk || ! dev->disk->has_partitions || dev->disk->partition) + else if (dev->disk) { char *label; grub_fs_t fs; @@ -49,7 +49,12 @@ grub_normal_print_device_info (const cha /* Ignore all errors. */ grub_errno = 0; - grub_printf ("Filesystem type %s", fs ? fs->name : "unknown"); + if (fs) + grub_printf ("Filesystem type %s", fs->name); + else if (! dev->disk->has_partitions || dev->disk->partition) + grub_printf ("Unknown filesystem"); + else + grub_printf ("Partition table"); if (fs && fs->label) { --2oS5YaxWCcQjTEyO--