Skip to content

Commit

Permalink
Fix boot failure in Dracut scripts.
Browse files Browse the repository at this point in the history
mount-zfs.sh script incorrectly parsed results from zpool list.  Correct
bootfs attribute was only found on systems with a single pool or where
the bootable pool's name alphabetized to before all other pool names.
Boot failed when the bootable pool's name came after other pools
(IE 'rpool' and 'mypool' would fail to find bootfs on rpool.)

Patch correctly discards pools whose bootfs attribute is blank ('-').

Signed-off-by: Zachary Bedell <zac@thebedells.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #402
  • Loading branch information
pendor authored and behlendorf committed Sep 26, 2011
1 parent f021fe1 commit c39b278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dracut/90zfs/mount-zfs.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ case "$root" in

# Might be imported by the kernel module, so try searching before
# we import anything.
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'`
if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then
# Not there, so we need to import everything.
info "ZFS: Attempting to import additional pools."
zpool import -N -a ${ZPOOL_FORCE}
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'`
if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then
rootok=0
Expand Down

1 comment on commit c39b278

@Rudd-O
Copy link
Contributor

@Rudd-O Rudd-O commented on c39b278 Oct 11, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad :-)

Please sign in to comment.