--- /etc/grub.d/10_linux.orig 2017-03-24 07:32:33.000000000 +0100 +++ /etc/grub.d/10_linux 2017-05-17 20:38:01.198390372 +0200 @@ -1,5 +1,6 @@ #! /bin/sh set -e +set -x # grub-mkconfig helper script. # Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. @@ -78,6 +79,15 @@ fi;; xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` + # JEL: + # bogus/debian castrated grub isn't able to determine the root poolname + # properly because it simply does a 'zpool status' and prefixes all + # device basenames with '/dev/'. Therefore /dev/chassis/SYS/HDD0/HDD0p2 + # and the like let grub explode. + if [ "x${rpool}" = "x" ]; then + rpool=`df / | awk '{ if ( $6 == "/" ) { split($1,a,"/"); print a[1];}}'` + [ "x${rpool}" = "x" ] && rpool='rpool' + fi bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" ;;