All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Laager <rlaager@wiktel.com>
To: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
Cc: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
Date: Thu, 08 Mar 2012 16:51:50 -0600	[thread overview]
Message-ID: <1331247110.6821.26.camel@watermelon.coderich.net> (raw)
In-Reply-To: <1330371970.2901.34.camel@watermelon.coderich.net>

[-- Attachment #1: Type: text/plain, Size: 3391 bytes --]

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= or bootfs= 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=zfs. The initrd code should be updated to parse
the root=ZFS=rpool/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=ZFS=rpool/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=zfs) and a ~10 line patch to zfs-initramfs
(to support root=ZFS=rpool/bootfs). (The patches are
backwards-compatible.) Considering other implementations... The systemd
ZFS code is already using the root=ZFS=rpool/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
===================================================================
--- 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="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
 	fi;;
     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}"
-	GRUB_CMDLINE_LINUX="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline} ${GRUB_CMDLINE_LINUX}";;
+	LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
 esac
 
 title_correction_code=


---------------------------------------------------------------------


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
===================================================================
--- 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)

-- 
Richard

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-03-08 22:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 16:12 Freeze on 27 February Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 16:19 ` Lennart Sorensen
2012-02-21 17:09   ` Lists and aliasing (Re: Freeze on 27 February) Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 18:46     ` Lennart Sorensen
2012-02-21 19:58       ` Lennart Sorensen
2012-02-21 20:29         ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 15:34           ` Lennart Sorensen
2012-02-22 15:50             ` Lennart Sorensen
2012-02-22 15:57               ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 16:18                 ` Lennart Sorensen
2012-02-22 16:25                   ` Lennart Sorensen
2012-02-22 16:43                     ` Lennart Sorensen
2012-02-22 16:50                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:16                       ` Lennart Sorensen
2012-02-22 17:35                         ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:41                           ` Lennart Sorensen
2012-02-22 17:46                             ` Lennart Sorensen
2012-02-22 18:01                               ` Lennart Sorensen
2012-02-22 18:28                                 ` Lennart Sorensen
2012-02-22 18:41                                   ` Lennart Sorensen
2012-02-22 19:00                                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 22:50                                       ` Lennart Sorensen
2012-02-22 23:03                                         ` Lennart Sorensen
2012-02-23  2:39                                           ` Isaac Dupree
2012-02-23  6:17                                           ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-23 17:43                                             ` Lennart Sorensen
2012-02-24 23:16                                               ` Lennart Sorensen
2012-02-22 17:38                         ` Lennart Sorensen
2012-02-22 16:51                   ` Lennart Sorensen
2012-02-21 21:40         ` Lennart Sorensen
2012-02-22  5:35 ` Freeze on 27 February Richard Laager
2012-02-23  6:34   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27  6:58     ` Richard Laager
2012-02-27 18:17       ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27  7:32     ` Richard Laager
     [not found]     ` <1330033617.3895.26.camel@watermelon.coderich.net>
     [not found]       ` <4F4AC782.1090402@gmail.com>
     [not found]         ` <1330322499.2901.5.camel@watermelon.coderich.net>
     [not found]           ` <1330322681.2901.8.camel@watermelon.coderich.net>
2012-02-27 18:18             ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 18:20           ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 19:46             ` Richard Laager
2012-03-08 22:51               ` Richard Laager [this message]
2012-03-10 12:44                 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:39                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 15:51                   ` Richard Laager
2012-03-10 16:01                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:41                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 17:51                 ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331247110.6821.26.camel@watermelon.coderich.net \
    --to=rlaager@wiktel.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.