From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S0SGE-0002n5-En for mharc-grub-devel@gnu.org; Thu, 23 Feb 2012 01:34:38 -0500 Received: from eggs.gnu.org ([140.186.70.92]:49565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0SG8-0002mt-AX for grub-devel@gnu.org; Thu, 23 Feb 2012 01:34:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0SG6-00015S-CY for grub-devel@gnu.org; Thu, 23 Feb 2012 01:34:32 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:51815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0SG6-00015K-22 for grub-devel@gnu.org; Thu, 23 Feb 2012 01:34:30 -0500 Received: by eekc13 with SMTP id c13so330337eek.0 for ; Wed, 22 Feb 2012 22:34:29 -0800 (PST) Received-SPF: pass (google.com: domain of phcoder@gmail.com designates 10.213.15.67 as permitted sender) client-ip=10.213.15.67; Authentication-Results: mr.google.com; spf=pass (google.com: domain of phcoder@gmail.com designates 10.213.15.67 as permitted sender) smtp.mail=phcoder@gmail.com; dkim=pass header.i=phcoder@gmail.com Received: from mr.google.com ([10.213.15.67]) by 10.213.15.67 with SMTP id j3mr35804eba.6.1329978869307 (num_hops = 1); Wed, 22 Feb 2012 22:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=wbwM+UPrAXJG+h+bsVPDWZo9v+PKNMNifiCe7UpXdKE=; b=frlH7PcjGT8WkXilsH+gSKedtZSF4nv3KkEjhRzfk6pLWt+GJM6jFbVs/Ud+ag1PDk 88KygGd3Wc5wOcwoN25p1IOOKD6tYPqIOCCSaMWOqjEhiw8HKFcVRXx4+WMU2fT3xQDy RLfdau/E/Jjw/NF4L6wGxMlTZfSohvISAMdMI= Received: by 10.213.15.67 with SMTP id j3mr28682eba.6.1329978869051; Wed, 22 Feb 2012 22:34:29 -0800 (PST) Received: from debian.x201.phnet (55-234.197-178.cust.bluewin.ch. [178.197.234.55]) by mx.google.com with ESMTPS id n56sm1806672eeh.6.2012.02.22.22.34.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Feb 2012 22:34:27 -0800 (PST) Message-ID: <4F45DDF0.2090908@gmail.com> Date: Thu, 23 Feb 2012 07:34:24 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: Richard Laager Subject: Re: Freeze on 27 February References: <4F43C25C.2040106@gmail.com> <1329888906.16648.134.camel@watermelon.coderich.net> In-Reply-To: <1329888906.16648.134.camel@watermelon.coderich.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 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, 23 Feb 2012 06:34:37 -0000 On 22.02.2012 06:35, Richard Laager wrote: > On Tue, 2012-02-21 at 17:12 +0100, Vladimir 'φ-coder/phcoder' Serbinenko > wrote: >> > @Richard Laager: Which of ZFS patches aren't committed yet? It's a bit >> > tricky to see which ones were superseeded. > I've attached my current patch set. The patches apply in the order > listed. They're also roughly ordered by complexity, so I'd recommend > reviewing them in this order. > > Also, if you have libzfs, a --disable-zfs or --without-zfs or similar > patch is necessary to ensure that the zpool and zfs commands are used > instead of libzfs. > > ---- Not ZFS Related: > > Previously submitted, no feedback, trivial: > grub-install-whitespace.patch > > Not previously submitted, trivial: > bzrignore-updates.patch > > ---- ZFS Related: > > Previously submitted, no feedback: > zfs-poolname-spaces.patch > zfs-devices.patch > > Not previously submitted: > zfs-on-linux-rlaager8.patch > With this, you should be able to boot with (native) > ZFS-on-Linux, though you'll have to add whatever rpool > specifiers (if any) required by your initrd. > > zfs-on-linux-rlaager9.patch > Part of this is just to support ZFS roots > (root=ZFS=rpool/ROOT/ubuntu, for example). > > The other part may need more design work. It moves some > of the btrfs code to inside linux_entry (and likewise, > the ZFS support is added there). Right now, GRUB > supports the concept of multiple kernels. I think that > needs to be extended to multiple root filesystems (in > practice: subvols in btrfs, clones in ZFS). This is the > first step in that process. The missing part is looping > over the additional root filesystems. > > Even if we can't get the multiple root filesystems issue figured out, > I'd really love to see everything else make it into the release. It'd be > a huge step in the right direction for those of us working with native > ZFS-on-Linux. > > -- Richard > > > bzrignore-updates.patch > > > === modified file '.bzrignore' > Index: grub/.bzrignore > =================================================================== > --- grub.orig/.bzrignore 2012-02-04 17:30:15.295629000 -0600 > +++ grub/.bzrignore 2012-02-04 17:30:49.356454000 -0600 > @@ -104,6 +104,8 @@ partmap_test > *.pp > po/*.mo > po/grub.pot > +po/POTFILES > +po/stamp-po > stamp-h > stamp-h1 > stamp-h.in > @@ -132,8 +134,10 @@ contrib > grub-core/Makefile.core.am > grub-core/Makefile.gcry.def > grub-core/contrib > +grub-core/gdb_grub > grub-core/genmod.sh > grub-core/gensyminfo.sh > +grub-core/gmodule.pl > grub-core/modinfo.sh > grub-core/*.module > grub-core/*.pp > Committed > zfs-poolname-spaces.patch > > > Handle pool names with spaces > > Index: grub/util/getroot.c > =================================================================== > --- 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 > @@ -260,7 +260,7 @@ > char cksum[257], notes[257]; > unsigned int dummy; > > - cmd = xasprintf ("zpool status %s", poolname); > + cmd = xasprintf ("zpool status \"%s\"", poolname); > fp = popen (cmd, "r"); This is wrong if poolname contains weird characters. Can you make it similar to mdadm-related code? > free (cmd); > > @@ -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) > @@ -420,6 +419,9 @@ > if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2) > continue; > > + unescape (entry.fstype); > + unescape (entry.device); > + You need to increase the size of storage for these fields. > > Handle vdevs with full paths > > Index: grub/util/getroot.c > =================================================================== > --- grub.orig/util/getroot.c 2012-02-03 05:22:36.227364000 -0600 > +++ grub/util/getroot.c 2012-02-03 05:22:41.255135000 -0600 > @@ -301,7 +301,10 @@ > devices = xrealloc (devices, sizeof (devices[0]) > * devices_allocated); > } > - devices[ndevices++] = xasprintf ("/dev/%s", name); > + if (name[0] == '/') > + devices[ndevices++] = xstrdup (name); > + else > + devices[ndevices++] = xasprintf ("/dev/%s", name); > } > break; > } > This one is ok other than the missing ChangeLog. > zfs-on-linux-rlaager8.patch > > > ZFS on Linux Improvements > > 1. `zpool status` can output disk names which are under /dev/disk. > 2. `zpool status` outputs the whole disk device for wholedisk pools, > but GRUB needs the partition device. > 3. Support native ZFS on Linux. > > Index: grub/util/getroot.c > =================================================================== > --- grub.orig/util/getroot.c 2012-02-03 05:54:39.540539000 -0600 > +++ grub/util/getroot.c 2012-02-03 06:04:29.465275000 -0600 > @@ -304,7 +304,87 @@ > if (name[0] == '/') > devices[ndevices++] = xstrdup (name); > else > +#ifdef __linux__ > + { > + /* The name returned by zpool isn't necessarily directly under /dev. */ > + char *device = xasprintf ("/dev/%s", name); Could you unify this with the scan code we already have? (the one where we scan for major/minor) @@ -478,7 +558,8 @@ if (!*entries[i].device) continue; - if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0) + if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 || + grub_strcmp (entries[i].fstype, "zfs") == 0) { char *slash; slash = strchr (entries[i].device, '/'); This should go as a separate patch > > zfs-on-linux-rlaager9.patch > > > Pass boot=zfs and zfs-bootfs=... when / is ZFS on Linux > > Index: grub/util/grub.d/10_linux.in > =================================================================== > --- grub.orig/util/grub.d/10_linux.in 2012-02-02 03:34:48.512644650 -0600 > +++ grub/util/grub.d/10_linux.in 2012-02-03 01:12:57.608355000 -0600 > @@ -56,13 +56,11 @@ > LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} > fi > > -if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \ > - || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then > - rootsubvol="`make_system_path_relative_to_its_root /`" > - rootsubvol="${rootsubvol#/}" > - if [ "x${rootsubvol}" != x ]; then > - GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" > - fi > +LINUX_ROOT_FS=`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true` > +LINUX_ROOT_STAT=`stat -f --printf=%T / || true` > + > +if [ "x${LINUX_ROOT_FS}" = xzfs ]; then > + RPOOL=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` > fi > > for word in $GRUB_CMDLINE_LINUX_DEFAULT; do > @@ -193,6 +191,19 @@ > version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` > alt_version=`echo $version | sed -e "s,\.old$,,g"` > linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" > + cmdline="" > + if [ "x${LINUX_ROOT_FS}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then > + rootsubvol="`make_system_path_relative_to_its_root /`" > + rootsubvol="${rootsubvol#/}" > + if [ "x${rootsubvol}" != x ]; then > + cmdline="rootflags=subvol=${rootsubvol} ${cmdline}" > + fi > + fi > + if [ "x${LINUX_ROOT_FS}" = xzfs ]; then > + bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" > + linux_root_device_thisversion="ZFS=${RPOOL}${bootfs}" > + cmdline="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline}" > + fi Please keep this at the beginning, we don't need to execute it for every kernel. > > initrd= > for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ > @@ -229,7 +240,7 @@ > fi > > linux_entry "${OS}" "${version}" false \ > - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \ > + "${cmdline} ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \ > quiet > if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then > if [ -x /lib/recovery-mode/recovery-menu ]; then -- Regards Vladimir 'φ-coder/phcoder' Serbinenko