depmod: export static device node information to modules.devname
[mit.git] / doc / modprobe.sgml
blob85330e1636693a8c0b8cfc0d7be81e27aa10ffe1
1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2 <!ENTITY debian "<productname>Debian GNU/Linux</productname>">
3 <!ENTITY docbook "<productname>DocBook</productname>">
4 <!ENTITY sgml "<abbrev>SGML</abbrev>">
5 ]>
7 <!-- Stolen from manual page for docbook-to-man, DocBook source file
8 (C) 1999 W. Borgert debacle@debian.org
10 $Id: docbook-to-man.sgml,v 1.8 2002/04/27 15:28:02 debacle Exp $ -->
12 <refentry>
13 <refentryinfo>
14 <address>
15 <email>jcm@jonmasters.org</email>
16 </address>
17 <author>
18 <firstname>Jon</firstname>
19 <surname>Masters</surname>
20 </author>
21 <date>2010-03-01</date>
22 </refentryinfo>
23 <refmeta>
24 <refentrytitle>modprobe</refentrytitle>
25 <manvolnum>8</manvolnum>
26 </refmeta>
27 <refnamediv>
28 <refname>modprobe</refname> <refpurpose>program to add and remove modules from the Linux Kernel</refpurpose>
29 </refnamediv>
30 <refsynopsisdiv>
31 <cmdsynopsis>
32 <command>modprobe</command>
33 <arg><option>-v</option></arg>
34 <arg><option>-V</option></arg>
35 <arg><option>-C <replaceable>config-file</replaceable></option></arg>
36 <arg><option>-n</option></arg>
37 <arg><option>-i</option></arg>
38 <arg><option>-q</option></arg>
39 <arg><option>-b</option></arg>
40 <arg><replaceable>modulename</replaceable></arg>
41 <arg rep='repeat'><option><replaceable>module parameters</replaceable></option></arg>
42 </cmdsynopsis>
43 <cmdsynopsis>
44 <command>modprobe</command>
45 <arg>-r</arg>
46 <arg><option>-v</option></arg>
47 <arg><option>-n</option></arg>
48 <arg><option>-i</option></arg>
49 <arg rep='repeat'><option><replaceable>modulename</replaceable></option></arg>
50 </cmdsynopsis>
51 <cmdsynopsis>
52 <command>modprobe</command>
53 <arg>-l</arg>
54 <arg>-t <replaceable>dirname</replaceable></arg>
55 <arg><option><replaceable>wildcard</replaceable></option></arg>
56 </cmdsynopsis>
57 <cmdsynopsis>
58 <command>modprobe</command>
59 <arg>-c</arg>
60 </cmdsynopsis>
61 <cmdsynopsis>
62 <command>modprobe</command>
63 <arg>--dump-modversions</arg> <arg><replaceable>filename</replaceable></arg>
64 </cmdsynopsis>
65 </refsynopsisdiv>
66 <refsect1>
67 <title>Description</title>
69 <para>
70 <command>modprobe</command> intelligently adds or removes a
71 module from the Linux kernel: note that for convenience, there
72 is no difference between _ and - in module names (automatic
73 underscore conversion is performed).
74 <command>modprobe</command> looks in the module directory
75 <filename>/lib/modules/`uname -r`</filename> for all
76 the modules and other files, except for the optional
77 <filename>/etc/modprobe.conf</filename> configuration file and
78 <filename>/etc/modprobe.d</filename> directory
79 (see <citerefentry>
80 <refentrytitle>modprobe.conf</refentrytitle><manvolnum>5</manvolnum>
81 </citerefentry>). <command>modprobe</command> will also use module
82 options specified on the kernel command line in the form of
83 &lt;module&gt;.&lt;option&gt;.
84 </para>
85 <para>
86 Note that unlike in 2.4 series Linux kernels (which are not supported
87 by this tool) this version of <command>modprobe</command> does not
88 do anything to the module itself: the work of resolving symbols
89 and understanding parameters is done inside the kernel. So
90 module failure is sometimes accompanied by a kernel message: see
91 <citerefentry>
92 <refentrytitle>dmesg</refentrytitle><manvolnum>8</manvolnum>
93 </citerefentry>.
94 </para>
95 <para>
96 <command>modprobe</command> expects an up-to-date
97 <filename>modules.dep.bin</filename> file (or fallback human
98 readable <filename>modules.dep</filename> file), as generated
99 by the corresponding <command>depmod</command> utility shipped
100 along with <command>modprobe</command> (see
101 <citerefentry><refentrytitle>depmod</refentrytitle><manvolnum>8</manvolnum>
102 </citerefentry>). This file lists what other modules each
103 module needs (if any), and <command>modprobe</command> uses this
104 to add or remove these dependencies automatically.
105 </para>
106 <para>
107 If any arguments are given after the
108 <replaceable>modulename</replaceable>, they are passed to the
109 kernel (in addition to any options listed in the configuration
110 file).
111 </para>
112 </refsect1>
113 <refsect1>
114 <title>OPTIONS</title>
115 <variablelist>
116 <varlistentry>
117 <term><option>-a</option> <option>--all</option>
118 </term>
119 <listitem>
120 <para>Insert all module names on the command line.
121 </para>
122 </listitem>
123 </varlistentry>
124 <varlistentry>
125 <term><option>-b</option> <option>--use-blacklist</option>
126 </term>
127 <listitem>
128 <para>
129 This option causes <command>modprobe</command> to apply the
130 <command>blacklist</command> commands in the configuration files
131 (if any) to module names as well. It is usually used by
132 <citerefentry>
133 <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
134 </citerefentry>.
135 </para>
136 </listitem>
137 </varlistentry>
138 <varlistentry>
139 <term><option>-C</option> <option>--config</option>
140 </term>
141 <listitem>
142 <para>This option overrides the default configuration directory/file
143 (<filename>/etc/modprobe.d</filename> or
144 <filename>/etc/modprobe.conf</filename>).
145 </para>
146 <para>
147 This option is passed through <command>install</command>
148 or <command>remove</command> commands to other
149 <command>modprobe</command> commands in the
150 MODPROBE_OPTIONS environment variable.
151 </para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><option>-c</option> <option>--showconfig</option>
156 </term>
157 <listitem>
158 <para>Dump out the effective configuration from the config directory
159 and exit.
160 </para>
161 </listitem>
162 </varlistentry>
163 <varlistentry>
164 <term><option>--dump-modversions</option>
165 </term>
166 <listitem>
167 <para>
168 Print out a list of module versioning information required by a
169 module. This option is commonly used by distributions in order to
170 package up a Linux kernel module using module versioning deps.
171 </para>
172 </listitem>
173 </varlistentry>
174 <varlistentry>
175 <term><option>-d</option> <option>--dirname</option>
176 </term>
177 <listitem>
178 <para>
179 Directory where modules can be found,
180 <filename>/lib/modules/<replaceable>RELEASE</replaceable></filename>
181 by default.
182 </para>
183 </listitem>
184 </varlistentry>
185 <varlistentry>
186 <term><option>--first-time</option>
187 </term>
188 <listitem>
189 <para>
190 Normally, <command>modprobe</command> will succeed (and do
191 nothing) if told to insert a module which is already
192 present or to remove a module which isn't present. This is
193 ideal for simple scripts; however, more complicated scripts often
194 want to know whether <command>modprobe</command> really
195 did something: this option makes modprobe fail in the
196 case that it actually didn't do anything.
197 </para>
198 </listitem>
199 </varlistentry>
200 <varlistentry>
201 <term><option>--force-vermagic</option>
202 </term>
203 <listitem>
204 <para>
205 Every module contains a small string containing important
206 information, such as the kernel and compiler versions. If
207 a module fails to load and the kernel complains that the
208 "version magic" doesn't match, you can use this option to
209 remove it. Naturally, this check is there for your
210 protection, so this using option is dangerous unless
211 you know what you're doing.
212 </para>
213 <para>
214 This applies to any modules inserted: both the module (or
215 alias) on the command line and any modules on which it depends.
216 </para>
217 </listitem>
218 </varlistentry>
219 <varlistentry>
220 <term><option>--force-modversion</option>
221 </term>
222 <listitem>
223 <para>
224 When modules are compiled with CONFIG_MODVERSIONS set, a
225 section detailing the versions of every interfaced used
226 by (or supplied by) the module is created. If a
227 module fails to load and the kernel complains that the
228 module disagrees about a version of some interface, you
229 can use "--force-modversion" to remove the version
230 information altogether. Naturally, this check is there
231 for your protection, so using this option is dangerous
232 unless you know what you're doing.
233 </para>
234 <para>
235 This applies any modules inserted: both the module (or
236 alias) on the command line and any modules on which it depends.
237 </para>
238 </listitem>
239 </varlistentry>
240 <varlistentry>
241 <term><option>-f</option> <option>--force</option>
242 </term>
243 <listitem>
244 <para>
245 Try to strip any versioning information from the module
246 which might otherwise stop it from loading: this is the
247 same as using both <option>--force-vermagic</option> and
248 <option>--force-modversion</option>. Naturally, these
249 checks are there for your protection, so using this option
250 is dangerous unless you know what you are doing.
251 </para>
252 <para>
253 This applies to any modules inserted: both the module (or
254 alias) on the command line and any modules it on which it depends.
255 </para>
256 </listitem>
257 </varlistentry>
258 <varlistentry>
259 <term><option>-i</option> <option>--ignore-install</option> <option>--ignore-remove</option>
260 </term>
261 <listitem>
262 <para>This option causes <command>modprobe</command> to
263 ignore <command>install</command> and
264 <command>remove</command> commands in the
265 configuration file (if any) for the module specified on the
266 command line (any dependent modules are still subject
267 to commands set for them in the configuration file). Both
268 <command>install</command> and <command>remove</command>
269 commands will currently be ignored when this option is used
270 regardless of whether the request was more specifically
271 made with only one or other (and not both) of
272 <option>--ignore-install</option> or
273 <option>--ignore-remove</option>.
274 See <citerefentry>
275 <refentrytitle>modprobe.conf</refentrytitle><manvolnum>5</manvolnum>
276 </citerefentry>.
277 </para>
278 </listitem>
279 </varlistentry>
280 <varlistentry>
281 <term><option>-l</option> <option>--list</option>
282 </term>
283 <listitem>
284 <para>List all modules matching the given wildcard (or "*"
285 if no wildcard is given). This option is provided for
286 backwards compatibility and may go away in future: see
287 <citerefentry>
288 <refentrytitle>find</refentrytitle><manvolnum>1</manvolnum>
289 </citerefentry> and
290 <citerefentry>
291 <refentrytitle>basename</refentrytitle><manvolnum>1</manvolnum>
292 </citerefentry> for a more flexible alternative.
293 </para>
294 </listitem>
295 </varlistentry>
296 <varlistentry>
297 <term><option>-n</option> <option>--dry-run</option>
298 <option>--show</option>
299 </term>
300 <listitem>
301 <para>This option does everything but actually insert or
302 delete the modules (or run the install or remove
303 commands). Combined with <option>-v</option>, it is
304 useful for debugging problems. For historical reasons
305 both <option>--dry-run</option> and <option>--show</option>
306 actually mean the same thing and are interchangeable.
307 </para>
308 </listitem>
309 </varlistentry>
310 <varlistentry>
311 <term><option>-q</option> <option>--quiet</option>
312 </term>
313 <listitem>
314 <para>
315 With this flag, <command>modprobe</command> won't print an error
316 message if you try to remove or insert a module it can't find (and
317 isn't an alias or
318 <command>install</command>/<command>remove</command> command).
319 However, it will still return with a non-zero exit status. The
320 kernel uses this to opportunistically probe for modules which might
321 exist using request_module.
322 </para>
323 </listitem>
324 </varlistentry>
325 <varlistentry>
326 <term><option>-R</option> <option>--resolve-alias</option>
327 </term>
328 <listitem>
329 <para>
330 Print all module names matching an alias. This can be useful
331 for debugging module alias problems.
332 </para>
333 </listitem>
334 </varlistentry>
335 <varlistentry>
336 <term><option>-r</option> <option>--remove</option>
337 </term>
338 <listitem>
339 <para>
340 This option causes <command>modprobe</command> to remove
341 rather than insert a module. If the modules it depends on
342 are also unused, <command>modprobe</command> will try to
343 remove them too. Unlike insertion, more than one module
344 can be specified on the command line (it does not make
345 sense to specify module parameters when removing modules).
346 </para>
347 <para>
348 There is usually no reason to remove modules, but some
349 buggy modules require it. Your distribution kernel may not
350 have been built to support removal of modules at all.
351 </para>
352 </listitem>
353 </varlistentry>
354 <varlistentry>
355 <term><option>-S</option> <option>--set-version</option>
356 </term>
357 <listitem>
358 <para>
359 Set the kernel version, rather than using
360 <citerefentry><refentrytitle>uname</refentrytitle><manvolnum>2</manvolnum></citerefentry> to decide on the kernel version (which dictates where to
361 find the modules).
362 </para>
363 </listitem>
364 </varlistentry>
365 <varlistentry>
366 <term><option>--show-depends</option>
367 </term>
368 <listitem>
369 <para>
370 List the dependencies of a module (or alias), including
371 the module itself. This produces a (possibly empty) set
372 of module filenames, one per line, each starting with
373 "insmod" and is typically used by distributions to determine
374 which modules to include when generating initrd/initramfs images.
375 <command>Install</command> commands which apply are shown prefixed by
376 "install". It does not run any of the install commands. Note that
377 <citerefentry><refentrytitle>modinfo</refentrytitle><manvolnum>8</manvolnum></citerefentry>
378 can be used to extract dependencies of a module from the
379 module itself, but knows nothing of aliases or install commands.
380 </para>
381 </listitem>
382 </varlistentry>
383 <varlistentry>
384 <term><option>-s</option> <option>--syslog</option>
385 </term>
386 <listitem>
387 <para>
388 This option causes any error messages to go through the
389 syslog mechanism (as LOG_DAEMON with level LOG_NOTICE)
390 rather than to standard error. This is also automatically
391 enabled when stderr is unavailable.
392 </para>
393 <para>
394 This option is passed through <command>install</command>
395 or <command>remove</command> commands to other
396 <command>modprobe</command> commands in the
397 MODPROBE_OPTIONS environment variable.
398 </para>
399 </listitem>
400 </varlistentry>
401 <varlistentry>
402 <term><option>-t</option> <option>--type</option>
403 </term>
404 <listitem>
405 <para>Restrict <option>-l</option> to modules
406 in directories matching the
407 <replaceable>dirname</replaceable> given. This option
408 is provided for backwards compatibility and may go
409 away in future: see
410 <citerefentry>
411 <refentrytitle>find</refentrytitle><manvolnum>1</manvolnum>
412 </citerefentry>
414 <citerefentry>
415 <refentrytitle>basename</refentrytitle><manvolnum>1</manvolnum>
416 </citerefentry> for a more flexible alternative.
417 </para>
418 </listitem>
419 </varlistentry>
420 <varlistentry>
421 <term><option>-V</option> <option>--version</option>
422 </term>
423 <listitem>
424 <para>Show version of program and exit.</para>
425 </listitem>
426 </varlistentry>
427 <varlistentry>
428 <term><option>-v</option> <option>--verbose</option>
429 </term>
430 <listitem>
431 <para>
432 Print messages about what the program is doing. Usually
433 <command>modprobe</command> only prints messages if
434 something goes wrong.
435 </para>
436 <para>
437 This option is passed through <command>install</command>
438 or <command>remove</command> commands to other
439 <command>modprobe</command> commands in the
440 MODPROBE_OPTIONS environment variable.
441 </para>
442 </listitem>
443 </varlistentry>
444 </variablelist>
445 </refsect1>
446 <refsect1>
447 <title>ENVIRONMENT</title>
448 <para>
449 The MODPROBE_OPTIONS environment variable can also be used to
450 pass arguments to <command>modprobe</command>.
451 </para>
452 </refsect1>
453 <refsect1>
454 <title>COPYRIGHT</title>
455 <para>
456 This manual page originally Copyright 2002, Rusty Russell, IBM
457 Corporation. Maintained by Jon Masters and others.
458 </para>
459 </refsect1>
460 <refsect1>
461 <title>SEE ALSO</title>
462 <para>
463 <citerefentry>
464 <refentrytitle>modprobe.conf</refentrytitle><manvolnum>5</manvolnum>
465 </citerefentry>,
466 <citerefentry>
467 <refentrytitle>modprobe.d</refentrytitle><manvolnum>5</manvolnum>
468 </citerefentry>,
469 <citerefentry>
470 <refentrytitle>insmod</refentrytitle><manvolnum>8</manvolnum>
471 </citerefentry>,
472 <citerefentry>
473 <refentrytitle>rmmod</refentrytitle><manvolnum>8</manvolnum>
474 </citerefentry>,
475 <citerefentry>
476 <refentrytitle>lsmod</refentrytitle><manvolnum>8</manvolnum>
477 </citerefentry>,
478 <citerefentry>
479 <refentrytitle>modinfo</refentrytitle><manvolnum>8</manvolnum>
480 </citerefentry>
481 </para>
482 </refsect1>
483 </refentry>
485 <!-- Keep this comment at the end of the file
486 Local variables:
487 mode: sgml
488 sgml-omittag:t
489 sgml-shorttag:t
490 sgml-minimize-attributes:nil
491 sgml-always-quote-attributes:t
492 sgml-indent-step:2
493 sgml-indent-data:t
494 sgml-parent-document:nil
495 sgml-default-dtd-file:nil
496 sgml-exposed-tags:nil
497 sgml-local-catalogs:nil
498 sgml-local-ecat-files:nil
499 End: