Skip to content

Commit

Permalink
Unconditionally load core kernel modules
Browse files Browse the repository at this point in the history
Loading and unloading the zlib modules was part of the zfs.sh.
Fix was taken from following  Brian's commit
cf47fad
  • Loading branch information
nkhare committed Nov 27, 2010
1 parent 5990e26 commit 4abda81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions scripts/common.sh.in
Expand Up @@ -11,7 +11,8 @@ SCRIPT_CONFIG=zfs-script-config.sh
if [ -f "${basedir}/../${SCRIPT_CONFIG}" ]; then
. "${basedir}/../${SCRIPT_CONFIG}"
else
MODULES=(zlib_deflate spl splat zavl znvpair zunicode zcommon zfs)
KERNEL_MODULES=(zlib_deflate zlib_inflate)
MODULES=(spl splat zavl znvpair zunicode zcommon zfs)
fi

PROG="<define PROG>"
Expand Down Expand Up @@ -157,14 +158,18 @@ load_module() {
echo "Loading ${NAME} ($@)"
fi

${LDMOD} $* || ERROR="Failed to load $1" return 1
${LDMOD} $* &>/dev/null || ERROR="Failed to load $1" return 1

return 0
}

load_modules() {
mkdir -p /etc/zfs

for MOD in ${KERNEL_MODULES[*]}; do
load_module ${MOD}
done

for MOD in ${MODULES[*]}; do
local NAME=`basename ${MOD} .ko`
local VALUE=
Expand Down
2 changes: 1 addition & 1 deletion zfs-script-config.sh.in
Expand Up @@ -39,6 +39,7 @@ LDMOD=/sbin/insmod

KERNEL_MODULES=( \
${KERNELMOD}/lib/zlib_deflate/zlib_deflate.ko \
${KERNELMOD}/lib/zlib_deflate/zlib_inflate.ko \
)

SPL_MODULES=( \
Expand All @@ -59,7 +60,6 @@ ZPIOS_MODULES=( \
)

MODULES=( \
${KERNEL_MODULES[*]} \
${SPL_MODULES[*]} \
${ZFS_MODULES[*]} \
)

0 comments on commit 4abda81

Please sign in to comment.