diff options
Diffstat (limited to 'etc/init.d/zfs-functions.in')
-rw-r--r-- | etc/init.d/zfs-functions.in | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/init.d/zfs-functions.in b/etc/init.d/zfs-functions.in index a2204c157..68cb1bb52 100644 --- a/etc/init.d/zfs-functions.in +++ b/etc/init.d/zfs-functions.in @@ -312,14 +312,18 @@ get_root_pool() check_module_loaded() { - [ -r /sys/module/zfs/version ] && return 0 || return 1 + module="$1" + + [ -r "/sys/module/${module}/version" ] && return 0 || return 1 } load_module() { + module="$1" + # Load the zfs module stack - if ! check_module_loaded; then - if ! modprobe zfs; then + if ! check_module_loaded "$module"; then + if ! /sbin/modprobe "$module"; then return 5 fi fi |