summaryrefslogtreecommitdiffstats
path: root/scripts/zfs.sh
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-08-21 10:00:12 -0700
committerGitHub <[email protected]>2017-08-21 10:00:12 -0700
commit133a5c6598ddc858f5b7ecedaf1364fcfe2e477f (patch)
tree3e38f87c62c03a2886a70d22de710fc2383d24fc /scripts/zfs.sh
parent9000a9fac950d2e2c9578d760dd775ac1ceaa507 (diff)
zimport.sh: Allow custom pool create options
Allow custom options to be passed to 'zpool create` when creating a new pool. Normally zimport.sh is intented to prevent accidentally introduced incompatibilities so we want the default behavior. However, when introducing a known incompatibility with a feature flag we need a way to disable the feature. By adding a line like the following to the commit message the feature can be disabled allowing the pool to be compatibile with older versions. TEST_ZIMPORT_CREATE_OPTIONS="-o feature@encryption=disabled" * Additionally fix /dev/nul -> /dev/null typo and minor white space formating issues. * Updated fail function to print a message and exit with 1 for use by the buildbot. * Silence warnings when zlib_inflate / zlib_default modules don't exist. This can happen when they're build in to the kernel. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6520
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