OSDN Git Service

Update to 3.8
[linuxjf/JF.git] / docs / LFS-BOOK / scripts / apds05.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4   <head>
5     <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
6     <title>
7       D.5. /etc/rc.d/init.d/modules
8     </title>
9     <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
10     <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
11     <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
12     "text/css" media="print" />
13   </head>
14   <body class="lfs" id="lfs-6.8">
15     <div class="navheader">
16       <h4>
17         Linux From Scratch - Version 6.8
18       </h4>
19       <h3>
20         付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
21       </h3>
22       <ul>
23         <li class="prev">
24           <a accesskey="p" href="apds04.html" title=
25           "/etc/rc.d/init.d/consolelog">前のページ</a>
26           <p>
27             /etc/rc.d/init.d/consolelog
28           </p>
29         </li>
30         <li class="next">
31           <a accesskey="n" href="apds06.html" title=
32           "/etc/rc.d/init.d/udev">次のページ</a>
33           <p>
34             /etc/rc.d/init.d/udev
35           </p>
36         </li>
37         <li class="up">
38           <a accesskey="u" href="scripts.html" title=
39           "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
40         </li>
41         <li class="home">
42           <a accesskey="h" href="../index.html" title=
43           "Linux From Scratch - Version 6.8">ホーム</a>
44         </li>
45       </ul>
46     </div>
47     <div class="wrap" lang="ja" xml:lang="ja">
48       <h1 class="sect1">
49         <a id="modules" name="modules"></a>D.5. /etc/rc.d/init.d/modules
50       </h1>
51       <pre class="screen">
52 #!/bin/sh
53 ########################################################################
54 # Begin $rc_base/init.d/modules
55 #
56 # Description : Module auto-loading script
57 #
58 # Authors     : Zack Winkles
59 #
60 # Version     : 00.00
61 #
62 # Notes       :
63 #
64 ########################################################################
65
66 . /etc/sysconfig/rc
67 . ${rc_functions}
68
69 # Assure that the kernel has module support.
70 [ -e /proc/ksyms -o -e /proc/modules ] || exit 0
71
72 case "${1}" in
73     start)
74
75         # Exit if there's no modules file or there are no
76         # valid entries
77         [ -r /etc/sysconfig/modules ] &amp;&amp;
78             egrep -qv '^($|#)' /etc/sysconfig/modules ||
79             exit 0
80
81         boot_mesg -n "Loading modules:" ${INFO}
82
83         # Only try to load modules if the user has actually given us
84         # some modules to load.
85         while read module args; do
86
87             # Ignore comments and blank lines.
88             case "$module" in
89                 ""|"#"*) continue ;;
90             esac
91
92             # Attempt to load the module, making
93             # sure to pass any arguments provided.
94             modprobe ${module} ${args} &gt;/dev/null
95
96             # Print the module name if successful,
97             # otherwise take note.
98             if [ $? -eq 0 ]; then
99                 boot_mesg -n " ${module}" ${NORMAL}
100             else
101                 failedmod="${failedmod} ${module}"
102             fi
103         done &lt; /etc/sysconfig/modules
104
105         boot_mesg "" ${NORMAL}
106         # Print a message about successfully loaded
107         # modules on the correct line.
108         echo_ok
109
110         # Print a failure message with a list of any
111         # modules that may have failed to load.
112         if [ -n "${failedmod}" ]; then
113             boot_mesg "Failed to load modules:${failedmod}" ${FAILURE}
114             echo_failure
115         fi
116         ;;
117     *)
118         echo "Usage: ${0} {start}"
119         exit 1
120         ;;
121 esac
122
123 # End $rc_base/init.d/modules
124 </pre>
125     </div>
126     <div class="navfooter">
127       <ul>
128         <li class="prev">
129           <a accesskey="p" href="apds04.html" title=
130           "/etc/rc.d/init.d/consolelog">前のページ</a>
131           <p>
132             /etc/rc.d/init.d/consolelog
133           </p>
134         </li>
135         <li class="next">
136           <a accesskey="n" href="apds06.html" title=
137           "/etc/rc.d/init.d/udev">次のページ</a>
138           <p>
139             /etc/rc.d/init.d/udev
140           </p>
141         </li>
142         <li class="up">
143           <a accesskey="u" href="scripts.html" title=
144           "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
145         </li>
146         <li class="home">
147           <a accesskey="h" href="../index.html" title=
148           "Linux From Scratch - Version 6.8">ホーム</a>
149         </li>
150       </ul>
151     </div>
152   </body>
153 </html>