Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KOKxF-0003sc-GW for mharc-grub-devel@gnu.org; Wed, 30 Jul 2008 19:19:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOKxE-0003sP-OZ for grub-devel@gnu.org; Wed, 30 Jul 2008 19:19:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOKxC-0003s5-Tl for grub-devel@gnu.org; Wed, 30 Jul 2008 19:19:36 -0400 Received: from [199.232.76.173] (port=36402 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOKxC-0003s2-OX for grub-devel@gnu.org; Wed, 30 Jul 2008 19:19:34 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:62995) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KOKxC-0002ar-Bw for grub-devel@gnu.org; Wed, 30 Jul 2008 19:19:34 -0400 Received: from [85.180.34.54] (e180034054.adsl.alicedsl.de [85.180.34.54]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1KOKx12KJY-0000oI; Thu, 31 Jul 2008 01:19:23 +0200 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-Ob78cVMoet40zjF7fbMz" Date: Thu, 31 Jul 2008 01:19:25 +0200 Message-Id: <1217459965.26275.14.camel@fz-deb.local> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-Provags-ID: V01U2FsdGVkX1+ktHKIbwfxlPq/L5Ttua+1sw3PDJOXLXqzqkA Y6cZc+8n7cSp69JeSwG2IDUKG+HeUdceOmIIWNMdhdPnu9j+rr RGICcQmZA3IleNiDXCXWs8RqeDI9zUx X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) Subject: [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: Wed, 30 Jul 2008 23:19:37 -0000 --=-Ob78cVMoet40zjF7fbMz Content-Type: text/plain Content-Transfer-Encoding: 7bit On invalid BSD partitions partmap/pc.c stops with reading the partitons, so grub doestn't know anything about the ones behind it. Attached patch fixes this and displays also the partition number not only the invalid magic it encounters 2008-07-31 Felix Zielcke * partmap/pc.c (pc_partition_map_iterate): Skip over invalid BSD partitions or if there's no space for the disk label and print the partition number on a invalid magic --=-Ob78cVMoet40zjF7fbMz 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 1753) +++ partmap/pc.c (Arbeitskopie) @@ -160,9 +160,11 @@ { /* 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_error (GRUB_ERR_BAD_PART_TABLE, + "no space for disk label"); + continue; + } /* Read the BSD label. */ if (grub_disk_read (&raw, (p.start @@ -175,10 +177,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_error (GRUB_ERR_BAD_PART_TABLE, + "invalid disk label magic 0x%x on partition %d", + label.magic,p.index); + continue; + } for (pcdata.bsd_part = 0; pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions); pcdata.bsd_part++) --=-Ob78cVMoet40zjF7fbMz--