grub2 1.96+20080724-3

Robert Millan rmh at aybabtu.com
Mon Jul 28 23:09:57 UTC 2008


Hi,

Please unblock grub2 1.96+20080724-3.  It fixes 3 rc/important bugs and
a minor dependency issue (#492543) which was approved by Marc on IRC.

debdiff attached.

Thanks

-- 
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."
-------------- next part --------------
diff -u grub2-1.96+20080724/debian/changelog grub2-1.96+20080724/debian/changelog
--- grub2-1.96+20080724/debian/changelog
+++ grub2-1.96+20080724/debian/changelog
@@ -1,3 +1,19 @@
+grub2 (1.96+20080724-3) unstable; urgency=low
+
+  [ Felix Zielcke ]
+  * changed depency for debconf to also support debconf-2.0. (Closes: #492543)
+  * patches/00_xfs.diff: Fix "out of partition" error with XFS.
+    (Closes: #436943)
+
+  [ Robert Millan ]
+  * patches/00_raid_duped_disks.diff: Do not abort when two RAID disks with
+    the same number are found.  (Closes: #492656)
+  * patches/00_strengthen_apple_partmap_check.diff: Be more strict when probing
+    for Apple partition maps (this prevents false positives on i386-pc
+    installs).  (Closes: #475718)
+
+ -- Robert Millan <rmh at aybabtu.com>  Tue, 29 Jul 2008 00:48:01 +0200
+
 grub2 (1.96+20080724-2) unstable; urgency=high
 
   [ Felix Zielcke ]
diff -u grub2-1.96+20080724/debian/control grub2-1.96+20080724/debian/control
--- grub2-1.96+20080724/debian/control
+++ grub2-1.96+20080724/debian/control
@@ -20,7 +20,7 @@
 
 Package: grub2
 Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 powerpc ppc64
-Depends: debconf, grub-pc [i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64] | grub-ieee1275 [powerpc ppc64]
+Depends: ${misc:Depends} , grub-pc [i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64] | grub-ieee1275 [powerpc ppc64]
 Description: GRand Unified Bootloader, version 2 (dummy package)
  This is a dummy transitional package to handle GRUB 2 upgrades.  It can be
  safely removed.
@@ -42,7 +42,7 @@
 
 Package: grub-pc
 Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64
-Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1), debconf, ${grub-pc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1), ${grub-pc:Depends}
 Provides: grub
 Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1)
 Conflicts: pupa, grub, desktop-base (= 4.0.5)
diff -u grub2-1.96+20080724/debian/legacy/update-grub grub2-1.96+20080724/debian/legacy/update-grub
--- grub2-1.96+20080724/debian/legacy/update-grub
+++ grub2-1.96+20080724/debian/legacy/update-grub
@@ -604,27 +604,14 @@
 	menu="$menu_file"
 	echo >&2
 	echo >&2
-	echo -n "Could not find $menu_file file. " >&2
 	if [ "-y" = "$command_line_arguments" ] ; then
-		echo >&2
-		echo "Generating $menu_file" >&2
-		answer=y
-	else
-		echo -n "Would you like $menu_file generated for you? " >&2
-		echo -n "(y/N) " >&2
-		read answer
+		echo "Warning: ignoring deprecated -y option." >&2
 	fi
-
-	case "$answer" in
-		y* | Y*)
-		cat "$newtemplate" > $menu_file
-		rm -f $newtemplate
-		unset newtemplate
-		;;
-		*)
-		abort "Not creating $menu_file as you wish"
-		;;
-	esac
+	echo >&2
+	echo "Generating $menu_file" >&2
+	cat "$newtemplate" > $menu_file
+	rm -f $newtemplate
+	unset newtemplate
 fi
 
 # Extract the kernel options to use
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_strengthen_apple_partmap_check.diff
+++ grub2-1.96+20080724/debian/patches/00_strengthen_apple_partmap_check.diff
@@ -0,0 +1,78 @@
+
+2008-07-28  Robert Millan  <rmh at aybabtu.com>
+
+	* partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro.
+	(struct grub_apple_header): New struct.  Describes the layout of
+	the partmap header.
+	(apple_partition_map_iterate): Check the header magic as well as the
+	partition magic (which was already being checked).
+
+Index: partmap/apple.c
+===================================================================
+--- partmap/apple.c	(revision 1745)
++++ partmap/apple.c	(revision 1746)
+@@ -22,11 +22,19 @@
+ #include <grub/mm.h>
+ #include <grub/partition.h>
+ 
++#define GRUB_APPLE_HEADER_MAGIC	0x4552
+ #define GRUB_APPLE_PART_MAGIC	0x504D
+ 
++struct grub_apple_header
++{
++  /* The magic number to identify the partition map, it should have
++     the value `0x4552'.  */
++  grub_uint16_t magic;
++};
++
+ struct grub_apple_part
+ {
+-  /* The magic number to idenify this as a partition, it should have
++  /* The magic number to identify this as a partition, it should have
+      the value `0x504D'.  */
+   grub_uint16_t magic;
+ 
+@@ -98,6 +106,7 @@
+ 					  const grub_partition_t partition))
+ {
+   struct grub_partition part;
++  struct grub_apple_header aheader;
+   struct grub_apple_part apart;
+   struct grub_disk raw;
+   int partno = 0;
+@@ -109,6 +118,18 @@
+ 
+   part.partmap = &grub_apple_partition_map;
+ 
++  if (grub_disk_read (&raw, 0, 0, sizeof (aheader), (char *) &aheader))
++    return grub_errno;
++
++  if (grub_be_to_cpu16 (aheader.magic) != GRUB_APPLE_HEADER_MAGIC)
++    {
++      grub_dprintf ("partition",
++		    "bad magic (found 0x%x; wanted 0x%x\n",
++		    grub_be_to_cpu16 (aheader.magic),
++		    GRUB_APPLE_HEADER_MAGIC);
++      goto fail;
++    }
++
+   for (;;)
+     {
+       if (grub_disk_read (&raw, pos / GRUB_DISK_SECTOR_SIZE,
+@@ -147,11 +168,12 @@
+       partno++;
+     }
+ 
+-  if (pos == GRUB_DISK_SECTOR_SIZE)
+-    return grub_error (GRUB_ERR_BAD_PART_TABLE,
+-		       "Apple partition map not found.");
++  if (pos != GRUB_DISK_SECTOR_SIZE)
++    return 0;
+ 
+-  return 0;
++ fail:
++  return grub_error (GRUB_ERR_BAD_PART_TABLE,
++		     "Apple partition map not found.");
+ }
+ 
+ 
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_raid_duped_disks.diff
+++ grub2-1.96+20080724/debian/patches/00_raid_duped_disks.diff
@@ -0,0 +1,30 @@
+2008-07-28  Robert Millan  <rmh at aybabtu.com>
+
+	* disk/raid.c (grub_raid_scan_device): Do not abort when two disks
+	with the same number are found, just use issue a warning with
+	grub_dprintf(), as this error has been reported to be non-fatal.
+
+Index: disk/raid.c
+===================================================================
+--- disk/raid.c	(revision 1741)
++++ disk/raid.c	(revision 1742)
+@@ -442,16 +442,10 @@
+ 	}
+   
+       if (array->device[sb.this_disk.number] != NULL)
+-	{
+-	  /* We found multiple devices with the same number. Again,
+-	     this shouldn't happen.*/
+-
+-	  grub_error (GRUB_ERR_BAD_NUMBER,
+-		      "Found two disks with the number %d?!?",
++	/* We found multiple devices with the same number. Again,
++	   this shouldn't happen.*/
++	grub_dprintf ("raid", "Found two disks with the number %d?!?",
+ 		      sb.this_disk.number);
+-
+-	  return 0;
+-	}
+     }
+ 
+   /* Add an array to the list if we didn't find any.  */
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_xfs.diff
+++ grub2-1.96+20080724/debian/patches/00_xfs.diff
@@ -0,0 +1,50 @@
+
+Fixes "out of partition" error with XFS.  See #436943.
+
+diff --git a/fs/xfs.c b/fs/xfs.c
+index 7da3e40..72d6a5f 100644
+--- a/fs/xfs.c
++++ b/fs/xfs.c
+@@ -56,7 +56,7 @@ struct grub_xfs_sblock
+ struct grub_xfs_dir_header
+ {
+   grub_uint8_t count;
+-  grub_uint8_t i8count;
++  grub_uint8_t smallno;
+   union
+   {
+     grub_uint32_t i4;
+@@ -423,7 +423,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
+     case XFS_INODE_FORMAT_INO:
+       {
+ 	struct grub_xfs_dir_entry *de = &diro->inode.data.dir.direntry[0];
+-	int smallino = !diro->inode.data.dir.dirhead.i8count;
++	int smallino = !diro->inode.data.dir.dirhead.smallno;
+ 	int i;
+ 	grub_uint64_t parent;
+ 
+@@ -433,12 +433,12 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
+ 	  {
+ 	    parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4);
+ 	    parent = grub_cpu_to_be64 (parent);
++            /* The header is a bit smaller than usual.  */
++	    de = (struct grub_xfs_dir_entry *) ((char *) de - 4);
+ 	  }
+ 	else
+ 	  {
+-	    parent = diro->inode.data.dir.dirhead.parent.i8;
+-	    /* The header is a bit bigger than usual.  */
+-	    de = (struct grub_xfs_dir_entry *) ((char *) de + 4);
++	    parent = *(grub_uint64_t *) &diro->inode.data.dir.dirhead.parent.i8;
+ 	  }
+ 
+ 	/* Synthesize the direntries for `.' and `..'.  */
+@@ -448,7 +448,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
+ 	if (call_hook (parent, ".."))
+ 	  return 1;
+ 
+-	for (i = 0; i < diro->inode.data.dir.dirhead.count; i++)
++        for (i = 0; i < diro->inode.data.dir.dirhead.count; i++)
+ 	  {
+ 	    grub_uint64_t ino;
+ 	    void *inopos = (((char *) de)


More information about the Pkg-grub-devel mailing list