From dc55d791011b31317ad57ecb36be0a27b7647ef2 Mon Sep 17 00:00:00 2001 From: Evan Susarret Date: Thu, 20 Mar 2014 16:21:34 -0400 Subject: [PATCH] Correct autodetection of bootfs property Remove lines that contain only a hyphen (match '^-$' instead of '-'). I had a root fs with a hyphen in the name (fedora/ROOT/Fedora20-Dev), it was not detected because sed eliminated that line of output from 'zpool list -Ho bootfs'. Signed-off-by: Evan Susarret Signed-off-by: Turbo Fredriksson Signed-off-by: Brian Behlendorf Closes #2196 --- dracut/90zfs/mount-zfs.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dracut/90zfs/mount-zfs.sh.in b/dracut/90zfs/mount-zfs.sh.in index 2d2afd879..23ec7e45b 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 -n '/-/ !p' | 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 -n '/-/ !p' | sed 'q'` + zfsbootfs=`zpool list -H -o bootfs | sed -n '/^-$/ !p' | sed 'q'` if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \ [ "$zfsbootfs" = "no pools available" ] ; then rootok=0