From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KQMNy-00089B-NJ for mharc-grub-devel@gnu.org; Tue, 05 Aug 2008 09:15:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQMNw-00088R-C5 for grub-devel@gnu.org; Tue, 05 Aug 2008 09:15:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQMNu-00087J-QJ for grub-devel@gnu.org; Tue, 05 Aug 2008 09:15:31 -0400 Received: from [199.232.76.173] (port=42476 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQMNu-000879-Jm for grub-devel@gnu.org; Tue, 05 Aug 2008 09:15:30 -0400 Received: from qb-out-1314.google.com ([72.14.204.171]:52523) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQMNt-0003M9-HV for grub-devel@gnu.org; Tue, 05 Aug 2008 09:15:30 -0400 Received: by qb-out-1314.google.com with SMTP id d2so2865448qbc.30 for ; Tue, 05 Aug 2008 06:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer; bh=ugFzXqzErIZvkNtyFXcP1B0FhVFYMhbNYETdaqiOQfE=; b=Wpv4VSROauB11WF2JaI9I5Qo3p9uQjcYcEn7zEwJOcWUOQPTYIGC1XP1BFEGhJdMJ3 mK0rCcwWPd0/grkMj/HSri2u9DdXKHI7XKhPxPo/O+ziHSN6EEV9QiDff6a/a+Dj7rKB pRmtAz8rfawDubfn81bZr+g9xS8gWSqOIML2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; b=pM9HUjP76uRVXFX9Jp38wyqctjcM+wbSeaQtu2YW1+Cjw2P/M9HJQRElfA444o1K14 X5lCogpUdwrl6ZNyl/G+5wTrDncADXR15gXUcaFqZhinxU3ejaXlfcHmh2wn41p6B8cj Fbn3VFbCH+l3HPa+vI7aXb6j8qbRWItx0AZ7k= Received: by 10.86.52.6 with SMTP id z6mr11632692fgz.48.1217942126383; Tue, 05 Aug 2008 06:15:26 -0700 (PDT) Received: from ?85.180.54.43? ( [85.180.54.43]) by mx.google.com with ESMTPS id d6sm1945564fga.2.2008.08.05.06.15.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Aug 2008 06:15:25 -0700 (PDT) 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="=-oquQ5I2QpCDwBtwzwvfB" Date: Tue, 05 Aug 2008 15:15:31 +0200 Message-Id: <1217942131.17498.3.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:15:32 -0000 --=-oquQ5I2QpCDwBtwzwvfB 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? > Bah, I noticed the 2 missing spaces and then missed that one out :( Attached. --=-oquQ5I2QpCDwBtwzwvfB 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++) --=-oquQ5I2QpCDwBtwzwvfB--