1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#! /bin/sh
# /etc/init.d/modules: loads the appropriate modules in `boot'.
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
# See if we have any modules.
if [ \! -d /lib/modules/`uname -r` ]
then
echo "WARNING: no modules present for this kernel"
exit 0
fi
#
# If you want to re-calculate the dependencies everytime you boot
# remove the if from the following statement:
#
if [ \! -r /lib/modules/`uname -r`/modules.dep ]
then
echo -n "Calculating module dependencies... "
depmod -a > /dev/null
echo "done."
fi
# First test if we have a kernel with kmod
if [ -f /proc/sys/kernel/modprobe ]; then
# We have, so don't start kerneld
startkerneld=1
else
startkerneld=0;
fi
# Loop over every line in /etc/modules.
echo -n 'Loading modules: '
(cat /etc/modules; echo) | # make sure there is a LF at the end
while read module args
do
case "$module" in
auto) [ ${startkerneld} -eq 0 -a -x /sbin/kerneld ] && \
echo && /etc/init.d/kerneld start && startkerneld=1;
continue ;;
noauto) continue ;;
\#*|"") continue ;;
esac
echo -n "$module "
modprobe $module $args
done
echo
#
# Just in case a sysadmin prefers generic symbolic links in
# /lib/modules/boot for boot time modules we will load these modules
#
if [ -n "`modprobe -l -t boot`" ]
then
modprobe -a -t boot \*
fi
|