[PATCH] zfs: fix LINUX_ROOT_DEVICE when grub-probe fails

2020-12-17 Thread Doug Goldstein
When grub-probe fails, the current code is to just stuff an empty result
in which causes the user to not knowingly have a system that no longer
boots. grub-probe can fail because the ZFS pool that contains the root
filesystem might have features that grub does not yet support which is a
common configuration for people with a rpool and a bpool. This behavior
uses the zdb utility to dump the same value as the filesystem label
would print.

Signed-off-by: Doug Goldstein 
---
 util/grub.d/10_linux.in | 2 +-
 util/grub.d/20_linux_xen.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index e8b01c0d0..33a25ba8f 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -71,7 +71,7 @@ case x"$GRUB_FS" 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`
+   rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 
2>/dev/null || zdb -l ${GRUB_DEVICE} | awk -F \' '/ name/ { print $2 }'`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
;;
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index 3b1f47049..96210c24d 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -79,7 +79,7 @@ case x"$GRUB_FS" 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`
+   rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 
2>/dev/null || zdb -l ${GRUB_DEVICE} | awk -F \' '/ name/ { print $2 }'`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
;;
-- 
2.24.3 (Apple Git-128)


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH 4/4] travis: Remove riscv32 build

2020-12-17 Thread Glenn Washburn
On Tue, 27 Oct 2020 21:06:45 +0100
Daniel Kiper  wrote:

> Adding Alex...
> 
> On Tue, Sep 22, 2020 at 11:20:12AM +0200, Petr Vorel wrote:
> > Hi Daniel,
> >
> > > To fix travis error:
> > > grub-mkimage: error: target 1036 not reachable from pc=ba.
> >
> > https://travis-ci.org/github/pevik/grub/jobs/729143844
> > $ for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O
> > $target -o grub-$target echo reboot normal; done grub-mkimage:
> > error: target 1036 not reachable from pc=ba.
> >
> > I found error messages in util/grub-mkimagexx.c, but I have no idea
> > what is missing in the test which causes grub-mkimage to fail. Any
> > idea? I doubt it's a real bug.
> >
> > Kind regards,
> > Petr

Did anyone have a chance to look at this? I'm also seeing this with
this target when trying to run the tests, which are failing.

Glenn

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH 4/4] travis: Remove riscv32 build

2020-12-17 Thread Petr Vorel
Hi Glenn,

> On Tue, 27 Oct 2020 21:06:45 +0100
> Daniel Kiper  wrote:

> > Adding Alex...

> > On Tue, Sep 22, 2020 at 11:20:12AM +0200, Petr Vorel wrote:
> > > Hi Daniel,

> > > > To fix travis error:
> > > > grub-mkimage: error: target 1036 not reachable from pc=ba.

> > > https://travis-ci.org/github/pevik/grub/jobs/729143844
> > > $ for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O
> > > $target -o grub-$target echo reboot normal; done grub-mkimage:
> > > error: target 1036 not reachable from pc=ba.

> > > I found error messages in util/grub-mkimagexx.c, but I have no idea
> > > what is missing in the test which causes grub-mkimage to fail. Any
> > > idea? I doubt it's a real bug.

> > > Kind regards,
> > > Petr

> Did anyone have a chance to look at this? I'm also seeing this with
> this target when trying to run the tests, which are failing.

I haven't had a chance yet. Also Travis CI got pretty slow last few weeks, which
does not help.

Kind regards,
Petr

> Glenn

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel