Magellan Linux

Contents of /trunk/initscripts/busybox/rc/modules

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1357 - (show annotations) (download)
Sat Jun 4 21:05:40 2011 UTC (12 years, 10 months ago) by niro
File size: 1233 byte(s)
copied from original repos
1 #!/bin/sh
2 # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/modules,v 1.1 2008-06-02 22:14:35 niro Exp $
3
4 #%rlevels: 7:s
5 #%start: 55
6 #%stop:
7
8 #deps
9 #%needs:
10 #%before:
11 #%after:
12
13 source /etc/conf.d/rc
14 source ${rc_functions}
15
16 case "$1" in
17 start)
18 # stops annoying kernel messages
19 echo "0" > /proc/sys/kernel/printk
20
21 # renew deps only if not booted from livecd
22 # a livecd has always the file .bootdev at root
23 if [ ! -e /.bootdev ]
24 then
25 rc_print "Calculating modules dependencies ..."
26 modules-update
27 evaluate_retval
28 fi
29
30 # get modules.autoload file matching to kernel
31 MODULESFILE=/etc/modules.autoload.d/kernel-$(kernel_major_version)
32 [[ ! -f ${MODULESFILE} ]] && MODULESFILE=/etc/modules.autoload
33
34 (cat ${MODULESFILE}; echo) | # make sure there is a LF at the end
35 while read module args
36 do
37 case "${module}" in
38 \#*|"") continue ;;
39 esac
40 rc_print "Loading module ${COLBLUE}${module}${COLDEFAULT} ..."
41 modprobe ${module} ${args} &>/dev/null
42 evaluate_retval
43 done
44
45 # sets default level for kernel messages
46 echo "3" > /proc/sys/kernel/printk
47
48 update_svcstatus $1
49 splash svc_started "$(basename $0)" 0
50 ;;
51
52 *)
53 rc_echo "Usage: $0 {start}"
54 exit 1
55 ;;
56 esac