diff --git a/90zfsbootmenu/module-setup.sh b/90zfsbootmenu/module-setup.sh index 87b3befc9..6d81d4423 100755 --- a/90zfsbootmenu/module-setup.sh +++ b/90zfsbootmenu/module-setup.sh @@ -74,6 +74,7 @@ install() { dracut_install tput dracut_install mount dracut_install df + dracut_install ip dracut_install /usr/bin/timeout dracut_install /usr/bin/mkdir dracut_install /usr/bin/tail diff --git a/90zfsbootmenu/zfsbootmenu-lib.sh b/90zfsbootmenu/zfsbootmenu-lib.sh index d775854e1..61c6a4272 100755 --- a/90zfsbootmenu/zfsbootmenu-lib.sh +++ b/90zfsbootmenu/zfsbootmenu-lib.sh @@ -150,10 +150,6 @@ kexec_kernel() { umount_zfs ${fs} - if ! [ $? -eq 0 ]; then - emergency_shell "unable to export pools" - fi - kexec -e -i } @@ -239,13 +235,14 @@ find_be_kernels() { # returns: nothing select_kernel() { - local fs - fs="${1}" + local zfsbe + zfsbe="${1}" local sane specific_kernel kexec_args - sane="$( underscore ${fs} )" + sane="$( underscore ${zfsbe} )" - specific_kernel="$( zfs get -H -o value org.zfsbootmenu:kernel ${BOOTFS} )" + specific_kernel="$( zfs get -H -o value org.zfsbootmenu:kernel ${zfsbe} )" + # No value set, pick the last kernel entry if [ "${specific_kernel}" = "-" ]; then kexec_args="$( tail -1 ${BASE}/${sane} )" diff --git a/90zfsbootmenu/zfsbootmenu.sh b/90zfsbootmenu/zfsbootmenu.sh index 075ff2b87..083599188 100755 --- a/90zfsbootmenu/zfsbootmenu.sh +++ b/90zfsbootmenu/zfsbootmenu.sh @@ -56,14 +56,14 @@ fi # Attempt to find the bootfs property datasets="$( zpool list -H -o bootfs ${pool} )" -if [ "$datasets" = "-" ]; then - BOOTFS= -else - while read -r line; do +while read -r line; do + if [ "${line}" = "-" ]; then + BOOTFS= + else BOOTFS="${line}" break - done <<<"${datasets}" -fi + fi +done <<<"${datasets}" # If BOOTFS is not empty display the fast boot menu fast_boot=0