aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/zfs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/zfs.sh')
-rwxr-xr-xscripts/zfs.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh
index 63c3a57d0..7dbb51a17 100755
--- a/scripts/zfs.sh
+++ b/scripts/zfs.sh
@@ -125,8 +125,13 @@ load_module() {
load_modules() {
mkdir -p /etc/zfs
- modprobe "$KMOD_ZLIB_DEFLATE" >/dev/null
- modprobe "$KMOD_ZLIB_INFLATE" >/dev/null
+ if modinfo "$KMOD_ZLIB_DEFLATE" >/dev/null 2>&1; then
+ modprobe "$KMOD_ZLIB_DEFLATE" >/dev/null 2>&1
+ fi
+
+ if modinfo "$KMOD_ZLIB_INFLATE">/dev/null 2>&1; then
+ modprobe "$KMOD_ZLIB_INFLATE" >/dev/null 2>&1
+ fi
for KMOD in $KMOD_SPL $KMOD_SPLAT $KMOD_ZAVL $KMOD_ZNVPAIR \
$KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ICP $KMOD_ZFS; do
@@ -167,6 +172,14 @@ unload_modules() {
fi
done
+ if modinfo "$KMOD_ZLIB_DEFLATE" >/dev/null 2>&1; then
+ modprobe -r "$KMOD_ZLIB_DEFLATE" >/dev/null 2>&1
+ fi
+
+ if modinfo "$KMOD_ZLIB_INFLATE">/dev/null 2>&1; then
+ modprobe -r "$KMOD_ZLIB_INFLATE" >/dev/null 2>&1
+ fi
+
if [ "$VERBOSE" = "yes" ]; then
echo "Successfully unloaded ZFS module stack"
fi