[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Cope with / being on a ZFS root dataset
From: |
Colin Watson |
Subject: |
[PATCH] Cope with / being on a ZFS root dataset |
Date: |
Mon, 29 Oct 2018 12:33:37 +0000 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
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
Tested-by: Fejes József <address@hidden>
Signed-off-by: Colin Watson <address@hidden>
---
util/grub.d/10_linux.in | 2 +-
util/grub.d/20_linux_xen.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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
--
2.19.1
signature.asc
Description: PGP signature
- [PATCH] Cope with / being on a ZFS root dataset,
Colin Watson <=