From: Richard Laager <rlaager@wiktel.com>
To: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
Cc: grub-devel@gnu.org, Zachary Bedell <pendorbound@gmail.com>
Subject: Re: [Patch] Robustly search for ZFS labels & uberblocks
Date: Sat, 28 Jan 2012 12:33:20 -0600 [thread overview]
Message-ID: <1327775600.9477.174.camel@watermelon.coderich.net> (raw)
In-Reply-To: <4F23EF3C.9050407@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]
On Sat, 2012-01-28 at 13:51 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> > Index: grub/util/grub.d/10_linux.in
> > ===================================================================
> > --- grub.orig/util/grub.d/10_linux.in 2012-01-24 23:44:10.530591000 -0600
> > +++ grub/util/grub.d/10_linux.in 2012-01-24 23:44:10.706928000 -0600
> > @@ -56,8 +56,10 @@
> > 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
> > +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}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then
> > rootsubvol="`make_system_path_relative_to_its_root /`"
> > rootsubvol="${rootsubvol#/}"
> > if [ "x${rootsubvol}" != x ]; then
> > @@ -76,6 +78,10 @@
> > GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
> > fi
> >
> > +if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
> > + GRUB_CMDLINE_LINUX="boot=zfs \$bootfs ${GRUB_CMDLINE_LINUX}"
> > +fi
> > +
> > linux_entry ()
> > {
> > os="$1"
> > @@ -114,6 +120,12 @@
> > fi
> > printf '%s\n' "${prepare_boot_cache}"
> > fi
> > + if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
> > + cat<< EOF
> > + insmod zfsinfo
> > + zfs-bootfs (\$root) bootfs
> This makes 3 wrong assumptions in a row:
> - / and /boot may be different.
Despite the variable being called LINUX_ROOT_FS, this is really the
output from grub-probe --device ${GRUB_DEVICE}. When / != /boot, is
$GRUB_DEVICE the device of / or /boot?
> - Linux may be in a non-root subvolume. Then the subvolid points to
> wrong one.
By "Linux", you're talking about the kernel, as opposed to the root
filesystem, correct?
What do you mean by "non-root subvolume"? That sounds like a btrfs term,
not a ZFS term, so I don't follow.
> - / may be unaccessible to GRUB altogether.
Are you talking about at grub-install time or boot time? Can you provide
an example of when this might happen, so I can understand.
> In short: this command line part has to be generated on grub-mkconfig
> time and have a stable representation. I'd recommend UUID and subvolume
> name.
By "this command line part", are you talking about the path to the
kernel?
--
Richard
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-01-28 18:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 18:45 [Patch] Robustly search for ZFS labels & uberblocks Zachary Bedell
2011-09-28 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-19 11:36 ` Richard Laager
2012-01-22 14:18 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-22 20:31 ` Richard Laager
2012-01-24 7:12 ` Richard Laager
2012-01-27 19:04 ` Zachary Bedell
2012-01-27 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28 2:50 ` Richard Laager
2012-01-28 12:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28 16:50 ` Richard Laager
2012-01-28 17:06 ` Darik Horn
2012-01-28 17:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28 18:33 ` Richard Laager [this message]
2012-01-28 19:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-29 22:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-31 8:45 ` Richard Laager
2012-02-02 11:13 ` Richard Laager
2012-02-03 10:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-03 9:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-03 11:20 ` Richard Laager
2012-01-28 18:40 ` Darik Horn
2012-01-28 19:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-30 1:22 ` Richard Laager
2012-01-30 1:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-11-03 14:45 ` 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=1327775600.9477.174.camel@watermelon.coderich.net \
--to=rlaager@wiktel.com \
--cc=grub-devel@gnu.org \
--cc=pendorbound@gmail.com \
--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.