]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/modules
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
25 # Assure that the kernel has module support.
26 [ -e /proc
/ksyms
-o -e /proc
/modules
] ||
exit 0
31 # If proc is mounted, find the current kernel
33 if [ -f /proc
/sys
/kernel
/printk
]; then
34 prev_msg
=`cat /proc/sys/kernel/printk | \
35 sed 'l 1' | sed -n '2~0p' | \
41 # Now set the message level to 1 so not to make too
42 # much noise when loading modules
45 # Only try to load modules if the user has actually given us
46 # some modules to load.
47 if egrep -qv '^(#|$)' /etc
/sysconfig
/modules
2>/dev
/null
50 # Read in the configuration file.
51 exec 9>&0 < /etc
/sysconfig
/modules
53 boot_mesg
-n "Loading modules:" ${INFO}
55 while read module args
57 # Ignore comments and blank lines.
62 # Attempt to load the module, making
63 # sure to pass any arguments provided.
64 modprobe
${module} ${args} &>/dev
/null
66 # Print the module name if successful,
67 # otherwise take note.
68 if [ ${?} -eq 0 ]; then
69 boot_mesg
-n " ${module}" ${NORMAL}
73 boot_mesg
"" ${NORMAL}
74 # Print a message about successfully loaded
75 # modules on the correct line.
81 # Set the kernel message level back to it's previous value.
82 dmesg
-n "${prev_msg}"
85 echo "Usage: ${0} {start}"