]>
git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blob - src/initscripts/system/modules
2 ########################################################################
3 # Begin $rc_base/init.d/modules
5 # Description : Module auto-loading script
7 # Authors : Zack Winkles
13 ########################################################################
18 # Assure that the kernel has module support.
19 [ -e /proc
/ksyms
-o -e /proc
/modules
] ||
exit 0
24 # If proc is mounted, find the current kernel
26 if [ -f /proc
/sys
/kernel
/printk
]; then
27 prev_msg
=`cat /proc/sys/kernel/printk | \
28 sed 'l 1' | sed -n '2~0p' | \
34 # Now set the message level to 1 so not to make too
35 # much noise when loading modules
38 # Only try to load modules if the user has actually given us
39 # some modules to load.
40 if egrep -qv '^(#|$)' /etc
/sysconfig
/modules
2>/dev
/null
43 # Read in the configuration file.
44 exec 9>&0 < /etc
/sysconfig
/modules
46 boot_mesg
-n "Loading modules:" ${INFO}
48 while read module args
50 # Ignore comments and blank lines.
55 # Attempt to load the module, making
56 # sure to pass any arguments provided.
57 modprobe
${module} ${args} &>/dev
/null
59 # Print the module name if successful,
60 # otherwise take note.
61 if [ ${?} -eq 0 ]; then
62 boot_mesg
-n " ${module}" ${NORMAL}
66 boot_mesg
"" ${NORMAL}
67 # Print a message about successfully loaded
68 # modules on the correct line.
74 # Set the kernel message level back to it's previous value.
75 dmesg
-n "${prev_msg}"
78 echo "Usage: ${0} {start}"
83 # End $rc_base/init.d/modules