Bug#637114: pu: package grub2/1.98+20100804-15
2011/8/27 Jonathan Nieder <jrnieder@gmail.com>:
>> #601974 is indeed fixed in unstable, it wasn't closed in changelog
>> because the fix was applied directly to upstream (and included with
>> 1.99-1 upload). I've closed that bug and put everyone involved on CC.
>>
>> #610184 might not be fixed in unstable according to this report:
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610184#64 . Given
>> the situation I wouldn't include it in this proposed update.
>
> Thanks. Do you have an updated patch for review?
Here you are.
--
Robert Millan
=== modified file 'debian/changelog'
--- debian/changelog 2011-01-18 10:55:00 +0000
+++ debian/changelog 2011-08-27 09:58:02 +0000
@@ -1,3 +1,19 @@
+grub2 (1.98+20100804-15) UNRELEASED; urgency=low
+
+ [ Colin Watson ]
+ * Backport from upstream:
+ - Handle Xen split-partition disk image devices (closes: 601974).
+ - Ensure uniqueness of RAID array numbers even if some elements have a
+ name (closes: #609804).
+
+ [ Robert Millan ]
+ * Fix grub-probe detection for ATA devices using `ata' driver on kFreeBSD 9.
+ - kfreebsd-9_ada_devices.patch
+ * Mark la_array as packed.
+ - zfs_packed_la_array.patch
+
+ -- Robert Millan <rmh@debian.org> Wed, 03 Aug 2011 14:26:57 +0200
+
grub2 (1.98+20100804-14) unstable; urgency=low
[ Updated translations ]
=== added file 'debian/patches/kfreebsd-9_ada_devices.patch'
--- debian/patches/kfreebsd-9_ada_devices.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/kfreebsd-9_ada_devices.patch 2011-07-17 12:16:49 +0000
@@ -0,0 +1,71 @@
+2011-06-16 Robert Millan <rmh@gnu.org>
+
+ Detect `ataraid' devices on GNU/kFreeBSD. Fix for ATA devices using
+ `ata' driver on kernel of FreeBSD 9.
+
+ * util/deviceiter.c [__FreeBSD_kernel__] (get_ada_disk_name)
+ (get_ataraid_disk_name): New functions.
+ [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for ataraid
+ (/dev/ar[0-9]+) and ada (/dev/ada[0-9]+) devices using
+ get_ataraid_disk_name() and get_ada_disk_name().
+
+=== modified file 'util/deviceiter.c'
+--- a/util/deviceiter.c
++++ b/util/deviceiter.c
+@@ -286,6 +286,20 @@
+ #endif
+ }
+
++#ifdef __FreeBSD_kernel__
++static void
++get_ada_disk_name (char *name, int unit)
++{
++ sprintf (name, "/dev/ada%d", unit);
++}
++
++static void
++get_ataraid_disk_name (char *name, int unit)
++{
++ sprintf (name, "/dev/ar%d", unit);
++}
++#endif
++
+ #ifdef __linux__
+ static void
+ get_virtio_disk_name (char *name, int unit)
+@@ -613,6 +627,35 @@
+ }
+ }
+
++#ifdef __FreeBSD_kernel__
++ /* IDE disks using ATA Direct Access driver. */
++ if (get_kfreebsd_version () >= 800000)
++ for (i = 0; i < 96; i++)
++ {
++ char name[16];
++
++ get_ada_disk_name (name, i);
++ if (check_device_readable_unique (name))
++ {
++ if (hook (name, 0))
++ goto out;
++ }
++ }
++
++ /* ATARAID disks. */
++ for (i = 0; i < 8; i++)
++ {
++ char name[20];
++
++ get_ataraid_disk_name (name, i);
++ if (check_device_readable_unique (name))
++ {
++ if (hook (name, 0))
++ goto out;
++ }
++ }
++#endif
++
+ #ifdef __linux__
+ /* Virtio disks. */
+ for (i = 0; i < 26; i++)
=== 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-08-27 09:58:02 +0000
@@ -35,3 +35,7 @@ echo_utf-8_clean.patch
multiboot_unaligned_pointer.patch
pci_probe.patch
raid_spurious_members.patch
+xen_disk_names.patch
+raid_number_uniqueness.patch
+kfreebsd-9_ada_devices.patch
+zfs_packed_la_array.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);
=== added file 'debian/patches/zfs_packed_la_array.patch'
--- debian/patches/zfs_packed_la_array.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/zfs_packed_la_array.patch 2011-08-03 12:27:39 +0000
@@ -0,0 +1,17 @@
+2011-08-03 Robert Millan <rmh@gnu.org>
+
+ * include/grub/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark
+ la_array as packed.
+ Reported by: Zachary Bedell
+
+--- a/debian/grub-extras/zfs/include/grub/zfs/zap_leaf.h
++++ b/debian/grub-extras/zfs/include/grub/zfs/zap_leaf.h
+@@ -90,7 +90,7 @@
+ {
+ grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES];
+ grub_uint64_t la_array64;
+- };
++ } __attribute__ ((packed));
+ grub_uint16_t la_next; /* next blk or CHAIN_END */
+ } l_array;
+ struct zap_leaf_free {
Reply to: