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