Commit b735acae authored by Colin Watson's avatar Colin Watson Committed by Colin Watson

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/?52746Tested-by: default avatarFejes József <jozsef.fejes@gmail.com>
Signed-off-by: default avatarColin Watson <cjwatson@ubuntu.com>

Bug: https://savannah.gnu.org/bugs/?52746
Bug-Debian: https://bugs.debian.org/886178
Last-Update: 2018-10-29

Patch-Name: zfs-root-dataset.patch
parent 12cd97a0
......@@ -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
......
......@@ -77,7 +77,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment