grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ZFS boot environment patch


From: Paul Lagerweij
Subject: Re: ZFS boot environment patch
Date: Thu, 14 Sep 2017 21:22:01 +0200

Thanks for answering.

On Wed, Sep 13, 2017 at 11:02:48AM -0400, Konrad Rzeszutek Wilk wrote:
> You seem to be missing an Signed off?

Signed-off-by: Paul Lagerweij <address@hidden>

I'm quite new with submitting code like this. I asked questions about where to start at Ubuntu and they sent me here.

> And perhaps an commit description?

So first this makes grub-mkconfig use the bootfs property if set, because the beadm tool changes that property to change the active boot environment. Secondly for each kernel this adds bootable ZFS boot environment entries in the advanced menu of grub.cfg by looking for valid boot environments and if /boot resides in ZFS it checks if that boot environment has that kernel.

> > +     zfs_active_bootfs="`zpool list -H -o bootfs ${rpool} || true`"
> > +     if [ -n "${zfs_active_bootfs}" ] && [ "${zfs_active_bootfs}" != "-" ]
> > && \
> > +        [ `echo ${zfs_active_bootfs} | grep -o '/' | wc -l` -gt 1 ]; then
> > +         zfs_be="1"
> > +         LINUX_ROOT_DEVICE="ZFS=${zfs_active_bootfs}"
> > +     else
> > +         bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
> > +         LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
> > +     fi;;
>
> Did you test this where zpool is not installed?

I did and grub-mkconfig failed long before reaching this, because grub-probe failed. Apparently grub-probe depends on the zpool command.

On Wed, 13 Sep 2017 at 09:17:42PM +0100, Colin Watson wrote:
> > On Wed, Sep 13, 2017 at 11:02:48AM -0400, Konrad Rzeszutek Wilk wrote:
> > > @@ -62,9 +63,15 @@ case x"$GRUB_FS" in
> > >     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}"
> > > -   ;;
> > > +   zfs_active_bootfs="`zpool list -H -o bootfs ${rpool} || true`"
> >
> > Is zpool usually in /sbin or such? Perhaps a full path?
>
> Full paths are brittle when they refer to something installed by a
> different package.  If you need to do that kind of thing then it's
> usually better to temporarily extend $PATH instead.

Do you mean that grub-mkconfig has its own $PATH and that I should temporarily change it to the user's $PATH? If so, can the 10_linux script see the user's $PATH?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]