diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index 1254fcd21c99..2633371afe34 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -16,6 +16,10 @@ ZPOOL="/sbin/zpool" ZPOOL_CACHE="/etc/zfs/zpool.cache" export ZFS ZPOOL ZPOOL_CACHE +# Needs to be set for rest of the code to work. +[ -z "${ZFS_INITRD_PRE_MOUNTROOT_SLEEP}" ] && ZFS_INITRD_PRE_MOUNTROOT_SLEEP=0 +[ -z "${ZFS_INITRD_POST_MODPROBE_SLEEP}" ] && ZFS_INITRD_POST_MODPROBE_SLEEP=0 + # This runs any scripts that should run before we start importing # pools and mounting any filesystems. pre_mountroot() @@ -44,7 +48,7 @@ pre_mountroot() # with more logging etc. load_module_initrd() { - if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" > 0 ] + if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] then check_boolean "$quiet" || \ zfs_log_begin_msg "Sleeping for" \ @@ -67,7 +71,7 @@ load_module_initrd() # Load the module load_module "zfs" || return 1 - if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" > 0 ] + if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" -gt 0 ] then check_boolean "$quiet" || \ zfs_log_begin_msg "Sleeping for" \ diff --git a/contrib/shell-common/zfs-functions.in b/contrib/shell-common/zfs-functions.in index ee2b51c8e6d2..f2f64c811360 100644 --- a/contrib/shell-common/zfs-functions.in +++ b/contrib/shell-common/zfs-functions.in @@ -716,8 +716,6 @@ import_pool() else return 1 fi - else - return 1 fi fi @@ -801,8 +799,6 @@ mount_fs() else return 1 fi - else - return 1 fi return 0 @@ -844,8 +840,6 @@ decrypt_fs() else return 1 fi - else - return 1 fi done @@ -868,8 +862,6 @@ decrypt_fs() else return 1 fi - else - return 1 fi return 0 @@ -897,8 +889,6 @@ destroy_fs() else return 1 fi - else - return 1 fi return 0 @@ -939,8 +929,6 @@ clone_snap() else return 1 fi - else - return 1 fi return 0 @@ -966,8 +954,6 @@ rollback_snap() else return 1 fi - else - return 1 fi return 0