Annotation of /trunk/busybox-initscripts/rc/modules
Parent Directory | Revision Log
Revision 1235 -
(hide annotations)
(download)
Thu Mar 10 20:22:25 2011 UTC (13 years, 6 months ago) by niro
File size: 1233 byte(s)
Thu Mar 10 20:22:25 2011 UTC (13 years, 6 months ago) by niro
File size: 1233 byte(s)
-honor start/stop calls
1 | niro | 724 | #!/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 | niro | 1235 | case "$1" in |
17 | start) | ||
18 | # stops annoying kernel messages | ||
19 | echo "0" > /proc/sys/kernel/printk | ||
20 | niro | 724 | |
21 | niro | 1235 | # 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 | niro | 724 | |
30 | niro | 1235 | # 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 | niro | 724 | |
34 | niro | 1235 | (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 | niro | 724 | |
45 | niro | 1235 | # sets default level for kernel messages |
46 | echo "3" > /proc/sys/kernel/printk | ||
47 | niro | 724 | |
48 | niro | 1235 | 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 |