File: rc.modutils

package info (click to toggle)
modutils 2.4.26-1.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,724 kB
  • ctags: 1,708
  • sloc: ansic: 16,932; sh: 2,998; makefile: 549; lex: 490; yacc: 375
file content (41 lines) | stat: -rw-r--r-- 864 bytes parent folder | download
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
#! /bin/sh
# /etc/init.d/modutils: loads the appropriate modules in `boot'.


PATH="/sbin:/bin"

[ -f /proc/ksyms ] || exit 0
[ -e /sbin/depmod ] || exit 0

if touch /lib/modules/$(uname -r)/modules.dep 2>/dev/null; then
	echo -n "Calculating module dependencies... "
	depmod -a -q
	echo "done."
else
	echo "Not calculating module dependencies: /lib/modules/$(uname -r) is read only."
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
		\#*|"") 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

exit 0