summaryrefslogtreecommitdiffstats
path: root/dracut/90zfs
diff options
context:
space:
mode:
authorZachary Bedell <[email protected]>2011-09-17 23:42:43 -0400
committerBrian Behlendorf <[email protected]>2011-09-26 09:29:51 -0700
commitc39b2786ac98ab87d6dda00aa83b399ed175055a (patch)
treefe5b358849ed6d4588fa4089bb73f02c6843b9fd /dracut/90zfs
parentf021fe194fec75ba1196638ca00301ba3b54ae85 (diff)
Fix boot failure in Dracut scripts.
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #402
Diffstat (limited to 'dracut/90zfs')
-rwxr-xr-xdracut/90zfs/mount-zfs.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/dracut/90zfs/mount-zfs.sh.in b/dracut/90zfs/mount-zfs.sh.in
index 49d68466c..2d2afd879 100755
--- a/dracut/90zfs/mount-zfs.sh.in
+++ b/dracut/90zfs/mount-zfs.sh.in
@@ -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