Skip to content

Commit

Permalink
Some minor fixes to the initramfs script (1/3).
Browse files Browse the repository at this point in the history
* Apparently "var > 0" doesn't work. Use 'var -gt 0' instead. But that
  means that 'var' needs to be set, so set this to '0' if it's not already
  set at the beginning of the initrd script.

Signed-off-by: Turbo Fredriksson <[email protected]>
  • Loading branch information
FransUrbo committed Oct 4, 2015
1 parent 545dcd5 commit 8a077a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contrib/initramfs/scripts/zfs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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" \
Expand All @@ -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" \
Expand Down

0 comments on commit 8a077a3

Please sign in to comment.