Apply Tuomo Soini's loadmodule patch

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-08-23 09:20:50 -07:00
parent 3d322d31b7
commit 6053a40af0
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -269,53 +269,50 @@ loadmodule() # $1 = module name, $2 - * arguments
{
local modulename
modulename=$1
shift
local moduleoptions
moduleoptions=$*
local modulefile
local suffix
if [ -d /sys/module/ ]; then
if ! list_search $modulename $DONT_LOAD; then
if [ ! -f /sys/module/$modulename ]; then
shift
if [ ! -d /sys/module/$modulename ]; then
case $moduleloader in
insmod)
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
insmod $modulefile $moduleoptions
break 2
fi
done
done
;;
*)
modprobe $modulename $moduleoptions
;;
esac
fi
fi
elif ! list_search $modulename $DONT_LOAD $MODULES; then
case $moduleloader in
insmod)
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename $*
;;
esac
insmod $modulefile $moduleoptions
break 2
fi
done
done
fi
fi
elif ! list_search $modulename $DONT_LOAD $MODULES; then
shift
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename $*
;;
esac
break 2
fi
done
done
;;
*)
modprobe $modulename $moduleoptions
;;
esac
fi
}