From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S5mBn-0001NN-8U for mharc-grub-devel@gnu.org; Thu, 08 Mar 2012 17:52:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5mBk-0001MB-Cq for grub-devel@gnu.org; Thu, 08 Mar 2012 17:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5mBi-0003PV-Gy for grub-devel@gnu.org; Thu, 08 Mar 2012 17:51:59 -0500 Received: from spam1.wiktel.com ([69.89.207.151]:35508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5mBi-0003Os-AY for grub-devel@gnu.org; Thu, 08 Mar 2012 17:51:58 -0500 Received: from [10.10.10.30] (vpn.wiktel.com [69.89.205.192]) (authenticated bits=0) by spam1.wiktel.com (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id q28MppqQ002551; Thu, 8 Mar 2012 16:51:51 -0600 Subject: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) From: Richard Laager To: Vladimir =?UTF-8?Q?=27=CF=86-coder/phcoder=27?= Serbinenko In-Reply-To: <1330371970.2901.34.camel@watermelon.coderich.net> References: <4F43C25C.2040106@gmail.com> <1329888906.16648.134.camel@watermelon.coderich.net> <4F45DDF0.2090908@gmail.com> <1330033617.3895.26.camel@watermelon.coderich.net> <4F4AC782.1090402@gmail.com> <1330322499.2901.5.camel@watermelon.coderich.net> <4F4BC95C.5040706@gmail.com> <1330371970.2901.34.camel@watermelon.coderich.net> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Y9Ww7QtvuZJNPdosAzMn" Date: Thu, 08 Mar 2012 16:51:50 -0600 Message-ID: <1331247110.6821.26.camel@watermelon.coderich.net> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 X-bounce-key: wiktel.com-1; rlaager@wiktel.com; 1331247111; UlkTWRXy2b5yg7+Iw9sRTOF8MjQ; X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 69.89.207.151 Cc: The development of GRUB 2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 22:52:01 -0000 --=-Y9Ww7QtvuZJNPdosAzMn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've rebased my patch sets against BZR revision 4144 and tested. Aside from the device scanning code (which you wanted me to implement differently) and the Ubuntu-specific recordfail patch, the following two changes are all that's left: --------------------------------------------------------------------- IMHO, the following change should be committed before the next release. The code currently in BZR does not actually set the RPOOL variable. Also, I don't think we should be adding rpool=3D or bootfs=3D to the Linux command-line. I had those in my patch set for compatibility with the existing initramfs on my system. I wasn't intending to propose those for upstream inclusion. If GRUB 2.00 is released with them, then initrds might start using them, which would mean GRUB would have to support them for a long time. The same applies to boot=3Dzfs. The initrd code should be updated to parse the root=3DZFS=3Drpool/bootfs syntax. Or, if the distro wants/needs something else, they can patch GRUB and/or have the admin set the appropriate flags in GRUB_CMDLINE_LINUX in /etc/default/grub. Supporting just the root=3DZFS=3Drpool/bootfs syntax in an initrd is not difficult. On Ubuntu, it's a two-line patch to initramfs-tools (to eliminate the need for boot=3Dzfs) and a ~10 line patch to zfs-initramfs (to support root=3DZFS=3Drpool/bootfs). (The patches are backwards-compatible.) Considering other implementations... The systemd ZFS code is already using the root=3DZFS=3Drpool/bootfs syntax, so it shouldn't require any changes. Gentoo is using something very similar, I believe, so the changes there should be minimal. Index: grub/util/grub.d/10_linux.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- grub.orig/util/grub.d/10_linux.in 2012-03-08 14:06:00.641410243 -0600 +++ grub/util/grub.d/10_linux.in 2012-03-08 15:30:53.557993000 -0600 @@ -61,9 +61,9 @@ case x"$GRUBFS" in GRUB_CMDLINE_LINUX=3D"rootflags=3Dsubvol=3D${rootsubvol} ${GRUB_CMDLI= NE_LINUX}" fi;; 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}" - GRUB_CMDLINE_LINUX=3D"boot=3Dzfs rpool=3D${RPOOL} bootfs=3D${RPOOL}${boot= fs} ${cmdline} ${GRUB_CMDLINE_LINUX}";; + LINUX_ROOT_DEVICE=3D"ZFS=3D${rpool}${bootfs}" esac =20 title_correction_code=3D --------------------------------------------------------------------- I believe the following change is still needed to support pool names with spaces. That said, maybe we shouldn't care about pool names with spaces. If a pool name has spaces, then we need some way to escape it when building the linux_entry command line. Then the initrd needs to unescape it. That seems like a lot of hassle for a configuration that's likely to be extremely uncommon even if GRUB does support it. Index: grub/util/getroot.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- grub.orig/util/getroot.c 2012-02-03 05:21:06.838056692 -0600 +++ grub/util/getroot.c 2012-02-03 05:22:36.227364000 -0600 @@ -285,8 +285,7 @@ st++; break; case 1: - if (!strcmp (name, poolname)) - st++; + st++; break; case 2: if (strcmp (name, "mirror") && !sscanf (name, "mirror-%u", &dummy) --=20 Richard --=-Y9Ww7QtvuZJNPdosAzMn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk9ZOAEACgkQbfU6uV4fG8560wCfe7dNMwocwiUPXbgGgr7x1QmM ym0Ani/dYyogwTo1ceEe1zRXO7uzppWW =Ztnp -----END PGP SIGNATURE----- --=-Y9Ww7QtvuZJNPdosAzMn--