From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KQMRK-0001gv-Oj for mharc-grub-devel@gnu.org; Tue, 05 Aug 2008 09:19:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQMRJ-0001gi-Vh for grub-devel@gnu.org; Tue, 05 Aug 2008 09:19:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQMRI-0001gJ-MM for grub-devel@gnu.org; Tue, 05 Aug 2008 09:19:01 -0400 Received: from [199.232.76.173] (port=45065 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQMRI-0001gF-ET for grub-devel@gnu.org; Tue, 05 Aug 2008 09:19:00 -0400 Received: from moutng.kundenserver.de ([212.227.126.174]:63463) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQMRH-0004Jb-OY for grub-devel@gnu.org; Tue, 05 Aug 2008 09:19:00 -0400 Received: from [85.180.54.43] (e180054043.adsl.alicedsl.de [85.180.54.43]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1KQMRH0m5S-0000pK; Tue, 05 Aug 2008 15:18:59 +0200 From: Felix Zielcke To: The development of GRUB 2 In-Reply-To: <87d4knehfs.fsf@xs4all.nl> References: <1217459965.26275.14.camel@fz-deb.local> <877ib1hvce.fsf@xs4all.nl> <20080801130222.GA12405@thorin> <87k5evhimz.fsf@xs4all.nl> <1217933393.7116.1.camel@fz.local> <1217936298.14245.0.camel@fz.local> <87d4knehfs.fsf@xs4all.nl> Content-Type: multipart/mixed; boundary="=-FfIBqePRZYzvmAdLMWw7" Date: Tue, 05 Aug 2008 15:19:06 +0200 Message-Id: <1217942346.20134.1.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-Provags-ID: V01U2FsdGVkX1/iZXZB6LR+hH1xFUhnSzs/aBIcDHQxSIPbVY/ mKB7oqqnOtkPnDwYfvitBH6wECxBA4aju1rjntPE+piBl80VVy cHuAkjuix6jb+1VwCWQtCJ6SkfuxPUQ X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) Subject: Re: [PATCH] skip over invalid BSD partitions 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, 05 Aug 2008 13:19:02 -0000 --=-FfIBqePRZYzvmAdLMWw7 Content-Type: text/plain Content-Transfer-Encoding: 7bit Am Dienstag, den 05.08.2008, 15:10 +0200 schrieb Marco Gerards: > Felix Zielcke writes: > > > 2008-08-05 Felix Zielcke > > > > * partmap/pc.c (pc_partition_map_iterate): Do not abort on an invalid BSD > > magic or if there's no space left, use grub_dprintf to issue a warning. > > Looks fine. Hurray. > > + { > > + grub_dprintf ("partition", > > + "invalid disk label magic 0x%x on partition %d\n" > > + label.magic, p.index); > > + continue; > > + } > > Isn't a comma missing after the second string? I am surprised that > this compiles. Or am I missing something? > You're right, shame on me I notice to missing spaces but not a missing comma. Attached. --=-FfIBqePRZYzvmAdLMWw7 Content-Disposition: attachment; filename=skip_invalid_bsd_parts.diff Content-Type: text/x-patch; name=skip_invalid_bsd_parts.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: partmap/pc.c =================================================================== --- partmap/pc.c (Revision 1770) +++ partmap/pc.c (Arbeitskopie) @@ -160,9 +160,10 @@ { /* Check if the BSD label is within the DOS partition. */ if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR) - return grub_error (GRUB_ERR_BAD_PART_TABLE, - "no space for disk label"); - + { + grub_dprintf ("partition", "no space for disk label\n"); + continue; + } /* Read the BSD label. */ if (grub_disk_read (&raw, (p.start @@ -175,10 +176,12 @@ /* Check if it is valid. */ if (label.magic != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, - "invalid disk label magic 0x%x", - label.magic); - + { + grub_dprintf ("partition", + "invalid disk label magic 0x%x on partition %d\n", + label.magic, p.index); + continue; + } for (pcdata.bsd_part = 0; pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions); pcdata.bsd_part++) --=-FfIBqePRZYzvmAdLMWw7--