Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gH6k5-0000ya-1M for mharc-grub-devel@gnu.org; Mon, 29 Oct 2018 08:34:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gH6k2-0000wI-EP for grub-devel@gnu.org; Mon, 29 Oct 2018 08:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gH6jv-0002sI-HI for grub-devel@gnu.org; Mon, 29 Oct 2018 08:33:56 -0400 Received: from a-painless.mh.aa.net.uk ([81.187.30.51]:41133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gH6js-0002fu-O0 for grub-devel@gnu.org; Mon, 29 Oct 2018 08:33:50 -0400 Received: from 3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org) by a-painless.mh.aa.net.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH6jq-0005u1-PK for grub-devel@gnu.org; Mon, 29 Oct 2018 12:33:46 +0000 Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org) by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89) (envelope-from ) id 1gH6jh-0006AJ-Vs for grub-devel@gnu.org; Mon, 29 Oct 2018 12:33:38 +0000 Date: Mon, 29 Oct 2018 12:33:37 +0000 From: Colin Watson To: grub-devel@gnu.org Subject: [PATCH] Cope with / being on a ZFS root dataset Message-ID: <20181029123337.bzrbdbc6bdh52wax@riva.ucam.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aelvqqy7b2uxdp74" Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 81.187.30.51 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:33:59 -0000 --aelvqqy7b2uxdp74 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=3DZFS=3D${rpool}/" will fail to boot, but "root=3DZFS=3D${rpool}" works fine, so strip the trailing slash. Fixes: https://savannah.gnu.org/bugs/?52746 Tested-by: Fejes J=C3=B3zsef Signed-off-by: Colin Watson --- 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=3D`${grub_probe} --device ${GRUB_DEVICE} --target=3Dfs_label 2>/dev= /null || true` bootfs=3D"`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" - LINUX_ROOT_DEVICE=3D"ZFS=3D${rpool}${bootfs}" + LINUX_ROOT_DEVICE=3D"ZFS=3D${rpool}${bootfs%/}" ;; esac =20 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=3D`${grub_probe} --device ${GRUB_DEVICE} --target=3Dfs_label 2>/dev= /null || true` bootfs=3D"`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" - LINUX_ROOT_DEVICE=3D"ZFS=3D${rpool}${bootfs}" + LINUX_ROOT_DEVICE=3D"ZFS=3D${rpool}${bootfs%/}" ;; esac =20 --=20 2.19.1 --aelvqqy7b2uxdp74 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Colin Watson -- Debian developer iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAlvW/h0ACgkQOTWH2X2G UAs8NQ//VnQpX2pwt2kobGwP4CtUDMqfoLo282Qa/gxMScMTGc37IIwntNDWzWht CDK0N3E7vpDI326gtsi+rSmn2tkh/oe/kF6H5ytALUR5e2j/vubaMTcRVuH/9yWT 0JCiWzExdTQwMupsBWPha8YibCVToB2qZI3jp1tKkCvWYoROq9Raee/Nxb6m68DK 68DYrXeKvVeKQg1UygBbcStYxhaM1CKaZjVrgxa3w2mHXMtiqjJV2ahnhXOFoVld p4pNTyE9bKNC3O4Ok9XAMKYM3vGIcvphl86uZtQaxTZRW3uMWxip9HNzr7BD7RId L5SXeQI6Oug7ktSWR/CB3Jt5yhNiIaD/E/LWnYyF/JsL0pYwRUbadt0doPc2hc8z /IsSl5ytll53UfYcOE5l2MT1h2Xz/tc4QoreBhlrLuBy6dgAC7614NQOjnhukzqq r27UkSGO3FkoAMVqz3MiaR9C5pu2txbHb8IKYftGhx+8MZXbmXeA+lP8PGBD9jwG LBq2MXckPCPxU56RFrPAjalnqn18dIf48mGitL6oa28us7y99RWIZaK+ZvmRzFm6 0KjSgHR3jW9qTt5tlfD7uwfeekaY4o3aZHwCeeKGapF/g3yd0y5gCoqtk7JrXMfB L6U9eqOb+U0IRfTK+BUQH0vNMSEPx34bQdJSQOFqRsi8LQ0RF9c= =ar1F -----END PGP SIGNATURE----- --aelvqqy7b2uxdp74--