From: Colin Watson Date: Mon, 29 Oct 2018 12:33:37 +0000 (+0000) Subject: Cope with / being on a ZFS root dataset X-Git-Tag: grub-2.04-rc1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e720eef6a69bc4acc767d9a4cf8bc939b8b98e11;p=thirdparty%2Fgrub.git Cope with / being on a ZFS root dataset If / is on the root dataset in a ZFS pool, then ${bootfs} will be set to "/" (whereas if it is on a non-root dataset, there will be no trailing slash). Passing "root=ZFS=${rpool}/" will fail to boot, but "root=ZFS=${rpool}" works fine, so strip the trailing slash. Fixes: https://savannah.gnu.org/bugs/?52746 Signed-off-by: Colin Watson Tested-by: Fejes József Reviewed-by: Daniel Kiper --- diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 61ebd7dc7..4532266be 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -73,7 +73,7 @@ case x"$GRUB_FS" in xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" - LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}" ;; esac diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index e8143b079..d22626e30 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -81,7 +81,7 @@ case x"$GRUB_FS" in xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" - LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}" ;; esac