Bug#775739: grub-pc: bug in postinst usable_partitions

Dietmar Maurer dietmar at proxmox.com
Mon Jan 19 12:31:36 UTC 2015


Package: grub-pc
Version: 2.02~beta2-19

I am testing with zfs on /, and I get the following output with grub-probe:

# grub-probe -t device /
/dev/sda3
/dev/sdb1
/dev/sdc1

but usable_partitions() expect to get a single device.

The following patch fixes the issue:

Index: new/debian/postinst.in
===================================================================
--- new.orig/debian/postinst.in 2014-12-22 12:55:53.000000000 +0100
+++ new/debian/postinst.in      2015-01-19 12:20:20.000000000 +0100
@@ -265,8 +265,13 @@
     if [ -z "$partition" ] || [ "$partition" = "$last_partition" ]; then
       continue
     fi
-    partition_id="$(device_to_id "$partition" || true)"
-    echo "$path:$partition_id"
+    for dev in $partition; do
+       partition_id="$(device_to_id "$dev" || true)"
+       if [ -z "$partition_id" ]; then
+           continue;
+       fi
+       echo "$dev:$partition_id"
+    done
     last_partition="$partition"
   done | sort -t: -k2
 }



More information about the Pkg-grub-devel mailing list