[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

grub2 update to squeeze?



I'm considering a grub2 update to squeeze to fix a handful of important
bugs.  I'll try to secure as much testing as I reasonably can before
upload, but before I start that work I'd like to know whether the SRMs
feel that this set of changes is in general terms likely to be accepted.

The Xen fix is in my opinion the most important one here, but I've had
various requests for these RAID fixes too.

Here's my current patch (which I haven't even build-tested yet):

=== modified file 'debian/changelog'
--- debian/changelog	2011-01-18 10:55:00 +0000
+++ debian/changelog	2011-06-11 21:27:11 +0000
@@ -1,3 +1,13 @@
+grub2 (1.98+20100804-15) UNRELEASED; urgency=low
+
+  * Backport from upstream:
+    - Handle Xen split-partition disk image devices (closes: 601974).
+    - Check RAID superblock offset (closes: #610184).
+    - Ensure uniqueness of RAID array numbers even if some elements have a
+      name (closes: #609804).
+
+ -- Colin Watson <cjwatson@debian.org>  Sat, 11 Jun 2011 22:02:42 +0100
+
 grub2 (1.98+20100804-14) unstable; urgency=low
 
   [ Updated translations ]

=== added file 'debian/patches/check_raid_superblock_offset.patch'
--- debian/patches/check_raid_superblock_offset.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/check_raid_superblock_offset.patch	2011-06-11 21:14:49 +0000
@@ -0,0 +1,22 @@
+Description: Check RAID superblock offset
+Author: Anthony DeRobertis <anthony@derobert.net>
+Author: Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
+Bug-Debian: http://bugs.debian.org/610184
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3082
+Last-Update: 2011-06-11
+
+Index: b/disk/mdraid_linux.c
+===================================================================
+--- a/disk/mdraid_linux.c
++++ b/disk/mdraid_linux.c
+@@ -402,7 +402,8 @@
+ 			  &sb_1x))
+ 	return grub_errno;
+ 
+-      if (sb_1x.magic == SB_MAGIC)
++      if (sb_1x.magic == SB_MAGIC
++	  && grub_le_to_cpu64 (sb_1x.super_offset) == sector)
+ 	return grub_mdraid_detect_1x (disk, sector, &sb_1x, array,
+ 				      start_sector);
+     }

=== added file 'debian/patches/raid_number_uniqueness.patch'
--- debian/patches/raid_number_uniqueness.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/raid_number_uniqueness.patch	2011-06-11 21:27:11 +0000
@@ -0,0 +1,21 @@
+Description: Ensure uniqueness of RAID array numbers
+ ... even if some elements have a name.
+Author: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
+Bug-Debian: http://bugs.debian.org/609804
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3076
+Last-Update: 2011-06-11
+
+Index: b/disk/raid.c
+===================================================================
+--- a/disk/raid.c
++++ b/disk/raid.c
+@@ -559,7 +559,7 @@
+ 	{
+ 	  for (p = array_list; p != NULL; p = p->next)
+ 	    {
+-	      if (! p->name && p->number == array->number) 
++	      if (p->number == array->number) 
+ 		break;
+ 	    }
+ 	}

=== modified file 'debian/patches/series'
--- debian/patches/series	2011-01-04 13:32:23 +0000
+++ debian/patches/series	2011-06-11 21:27:11 +0000
@@ -35,3 +35,6 @@
 multiboot_unaligned_pointer.patch
 pci_probe.patch
 raid_spurious_members.patch
+xen_disk_names.patch
+check_raid_superblock_offset.patch
+raid_number_uniqueness.patch

=== added file 'debian/patches/xen_disk_names.patch'
--- debian/patches/xen_disk_names.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/xen_disk_names.patch	2011-06-11 21:05:00 +0000
@@ -0,0 +1,75 @@
+Description: Handle Xen split-partition disk image devices
+ If opening the disk device returns GRUB_ERR_UNKNOWN_DEVICE, treat the
+ partition device as a disk in its own right.  This can happen with Xen disk
+ images.
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/601974
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2832
+Last-Update: 2011-06-11
+
+Index: b/kern/emu/hostdisk.c
+===================================================================
+--- a/kern/emu/hostdisk.c
++++ b/kern/emu/hostdisk.c
+@@ -1353,12 +1353,15 @@
+ #endif /* defined(__NetBSD__) */
+ 
+ static int
+-find_system_device (const char *os_dev, struct stat *st)
++find_system_device (const char *os_dev, struct stat *st, int convert)
+ {
+   unsigned int i;
+   char *os_disk;
+ 
+-  os_disk = convert_system_partition_to_system_disk (os_dev, st);
++  if (convert)
++    os_disk = convert_system_partition_to_system_disk (os_dev, st);
++  else
++    os_disk = xstrdup (os_dev);
+   if (! os_disk)
+     return -1;
+ 
+@@ -1392,7 +1395,7 @@
+       return 0;
+     }
+ 
+-  drive = find_system_device (os_dev, &st);
++  drive = find_system_device (os_dev, &st, 1);
+   if (drive < 0)
+     {
+       grub_error (GRUB_ERR_UNKNOWN_DEVICE,
+@@ -1498,7 +1501,32 @@
+     free (name);
+ 
+     if (! disk)
+-      return 0;
++      {
++	/* We already know that the partition exists.  Given that we already
++	   checked the device map above, we can only get
++	   GRUB_ERR_UNKNOWN_DEVICE at this point if the disk does not exist.
++	   This can happen on Xen, where disk images in the host can be
++	   assigned to devices that have partition-like names in the guest
++	   but are really more like disks.  */
++	if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
++	  {
++	    grub_util_warn
++	      ("disk does not exist, so falling back to partition device %s",
++	       os_dev);
++
++	    drive = find_system_device (os_dev, &st, 0);
++	    if (drive < 0)
++	      {
++		grub_error (GRUB_ERR_UNKNOWN_DEVICE,
++			    "no mapping exists for `%s'", os_dev);
++		return 0;
++	      }
++
++	    return make_device_name (drive, -1, -1);
++	  }
++	else
++	  return 0;
++      }
+ 
+     partname = NULL;
+     grub_partition_iterate (disk, find_partition);

Thanks,

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: