File: modules.conf.5

package info (click to toggle)
modutils 2.3.11-13.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,156 kB
  • ctags: 1,038
  • sloc: ansic: 10,567; sh: 2,120; lex: 484; makefile: 479; yacc: 362
file content (600 lines) | stat: -rw-r--r-- 16,308 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
.\"/* Copyright 1999 Bjorn Ekwall <bj0rn@blox.se>
.\" This program is distributed according to the Gnu General Public License.
.\" See the file COPYING in the base distribution directory
.\"
.TH MODULES.CONF 5 "07 December 1999"
.UC 4
.SH NAME
modules.conf \- configuration file for loading kernel modules
.SH DESCRIPTION
The behaviour of
.B modprobe(8)
(and
.B depmod(8)
)
can be modified by the (optional) configuration file
.B /etc/modules.conf.
.PP
The configuration file consists of a set of lines.
.br
All empty lines, and all text on a line after a '#', will be ignored.
.br
Lines may be continued by ending the line with a '\\'.
.br
The remaining lines should all conform to one of the following formats:
.nf

  [add] above module module_list
  alias alias_name result
  [add] below module module_list
  define VARIABLE WORD
  depfile=A_PATH
  else
  elseif EXPRESSION
  endif
  if EXPRESSION
  include PATH_TO_CONFIG_FILE
  insmod_opt=GENERIC_OPTIONS_TO_INSMOD
  install module command ...
  keep
  [add] options module MODULE_SPECIFIC_OPTIONS
  path=A_PATH
  path[TAG]=A_PATH
  [add] probe name module_list
  [add] probeall name module_list
  post-install module command ...
  post-remove module command ...
  pre-install module command ...
  pre-remove module command ...
  remove module command ...
.fi
.PP
All arguments to a directive will be processed to handle
shell meta-characters,
which means that "shell tricks" like wild-cards
and commands enclosed in back-quotes can be used:
.nf

  path[misc]=/lib/modules/1.1.5?/local
  path[net]=/lib/modules/`uname \-r`/net

.fi
Directives may be repeated multiple times.
Note that some directives can have an optional prefix:
.I add.
When this prefix is used, the new module_list will be
.B added
to the previous module_list instead of replacing it.
.SH SEMANTICS
.B A_PATH
is the fully qualified path to the target.
It is possible to use shell meta-characters in
.B A_PATH
including command output, such as
.I \`uname \-r\`
and
.I \`kernelversion\`.
.br
These two commands are also understood internally in these utilities
as meaning the version number of the current kernel and the current
kernel version respectively (e.g.: 2.2.3 and 2.2).
.PP
.B WORD
is a sequence if non-white characters.
If ' " or ` is found in the string, all characters up to the
matching ' " or ` will also be included, even whitespace.
Every
.B WORD
will then be expanded w.r.t. meta-characters.
If the expanded result gives more than one word then only
the first word of the result will be used.
.PP
EXPRESSION below can be:
.TP
.I "WORD compare_op WORD"
where compare_op is one of ==, !=, <, <=, >= or >.
The string values of the WORDs are compared.
.TP
.I "\-n WORD compare_op WORD"
where compare_op is one of ==, !=, <, <=, >= or >.
The numeric values of the WORDs are compared.
.TP
.I WORD
If the expansion of WORD fails, or if the
expansion is "0" (zero), "false" or "" (empty)
then the expansion has the value FALSE.
Otherwise the expansion has the value TRUE
.TP
.I "\-f FILENAME"
Test if the file FILENAME exists.
.TP
.I \-k
Test if "autoclean" is enabled (i.e. called from the kernel).
.TP
.I "! EXPRESSION"
A negated expression is also an expression.
.SH SYNTAX
This is a description of the legal directives.
.TP
.I "define VARIABLE WORD"
Do a
.I putenv("VARIABLE=WORD").
Variables can be created and modified by this directive.
The variables will be available in the environment, which makes them
usable for all commands executed in the current session.
.TP
.I "depfile=A_PATH"
This is the path to the dependency file that will be created by
.B depmod
and used by
.B modprobe
to find the modules and their dependent modules.
Normally the default value should be used, see below.
.TP
.I "if EXPRESSION"
If the expression is evaluated to be
.B TRUE
then all directives up to the matching
.I "else, elseif"
or
.I endif
are processed.  Otherwise they are ignored.
.I if
directives may be nested up to an internal maximum of 20.
.br
Note: please avoid having any
.B path
directives conditionally processed.
Since
.B modprobe
has enough built-in "smarts", a conditionally processed
.B path
directive will gain you nothing but confusion.  Really.
.TP
.I "else"
If the previous matching
.I if
or
.I elseif
directive evaluated its expression to be
.B FALSE
then the directives enclosed by the (optional)
.I else
directive and its matching
.I endif
directive will be processed.
.TP
.I "elseif EXPRESSION"
If the previous matching
.I if
or
.I elseif
directives evaluated their expression to be
.B FALSE
and if the expression for this directive evaluates to
.B TRUE
then the directives up to the next matching
.I "elseif, else"
or
.I endif
directive will be processed.
.TP
.I "endif"
This directive ends the chain of matching
.I "if, elseif"
or
.I else
directive(s) controlling the conditional processing of configuration
file directives.
.nf

  if EXPRESSION
      any config lines
  elseif EXPRESSION
      any config lines
  else
      any config lines
  endif

.fi
The
.I else
and
.I elseif
directives are optional.
.TP
.I "include PATH_TO_CONFIG_FILE"
To handle different platforms or configurations with a
single configuration file can be quite complex.
With the use of the
.I include
directive, conditionally processed by
.I if
directives, this is now easier to handle.
.TP
.I "insmod_opt=GENERIC_OPTIONS_TO_INSMOD"
If insmod should need some special options, not specified elsewhere,
this directive makes it possible to add such an option,
to be used for every invocation.
The standard default options to insmod does normally not have to
be modified unless some special situation needs to be handled.
.TP
.I "keep"
If this word is found on a line
.B before
any lines that contain the
.B path
descriptions, the default set of paths will be saved, and thus added to.
Otherwise the normal behaviour is that the default set will be
.B replaced
by the set of paths in the configuration file.
.TP
.I "path=A_PATH"
.TP
.I "path[TAG]=A_PATH"
The
.B A_PATH
argument specifies an additional directory to search for modules.
The
.B path
directive can carry an optional tag.
This tells us a little more about the purpose of the modules in
this directory and allows some automated operations by
.B modprobe.
The tag is appended to the "path" keyword enclosed in square brackets.
If the tag is missing, the tag "misc" is assumed.
.br
One very useful tag is
.B boot,
which can be used to mark all directories containing modules
that should be loaded at boot-time.
.TP
.I "alias alias_name result"
The "alias" directive can be used to give alias names to modules.
A line in /etc/modules.conf that looks like this:
.nf

  alias iso9660 isofs

.fi
makes it possible to write
.B "modprobe iso9660"
although there is no object file for such a module available.
.br
Note that the line:
.nf

  alias some_module off

.fi
will make modprobe ignore requests to load that module.
Another special alias is:
.nf

  alias some_module null

.fi
which will make requests for some_module always succeed, but no
module will actually be installed.
This can be used as a base for stacks created via the
.I above
and
.I below
directives.
.br
.nf

.fi
.ne 7
It is possible to have a large number of levels of
.I alias
directives, since all aliases will be recursively expanded
in order to find the physical module actually referred to.  There is an
arbitrary limit of 1000 on alias depth to detect loops like:
.nf

  alias a b
  alias b a

.fi
.br
If the final result of an
.I alias
mapping does not match the name of any module then modprobe applies
probe and probeall mappings to the result.  If those do not succeed
then the module is not found.  This makes constructs like this give
sensible results (from devfs).
.br
.nf

  alias           /dev/sg*        /dev/sg
  probeall        /dev/sg         scsi-hosts sg

.fi
.ne 7
It is legal for an alias to map module A to module B and for module
A to exist at the same time but this construct is ambiguous and is
.B not
recommended.  For historical reasons, the kernel sound system has a
module called sound.o but the sound developers also want an alias from
sound to the module for the user's sound card, e.g. "alias\ sound\ sb".
In an attempt to support this requirement but still maintain the
defined behaviour where options can be applied to aliases, modprobe
bypasses alias expansion when processing a module name if the name was
obtained via modules.dep, otherwise aliases are expanded.  This is not
guaranteed to give the expected behaviour on all combinations of
aliases and real modules, you should avoid using an alias with the same
name as a real module.
.TP
.I "[add] probe name module_list"
.TP
.I "[add] probeall name module_list"
These directives can only be used when
.I name
is the name of the module requested on the command line of
.B modprobe.
The effect is that when a request for
.I name
is made, the modules in module_list will be tried, in the specified order.
The difference between the directives is that
.I probe
will continue until the first successful module insertion, while
.I probeall
will continue until the end of the list.
The exit status reflects whether any module has been successfully
installed or not.
The optional
.I add
prefix adds the new list to the previous list instead of replacing it.
.TP
.I "[add] options module MODULE_SPECIFIC_OPTIONS"
All module names, including aliased names, can have their own
.I options
directives.
Options specified for an alias have higher priority than the options
specified for more "basic" names. This rule is used to resolve
conflicting
.I options
directives.
Options given on the command line have the highest priority.
The optional
.I add
prefix adds the new list to the previous list instead of replacing it.
If the result of an
.I alias
is not a real module then any
.I options
that were constructed from the
.I alias
chain are discarded before invoking probe[all].
.TP
.I "[add] above module module_list"
This directive makes it possible for one module to "pull in"
another set of modules on top of itself in a module stack,
as seen in the output of the
.B lsmod(8)
command.
The
.I above
directive is useful for those circumstances when the dependencies
are more complex than what can be described in the
.B modules.dep
dependency file.
This is an optimized case of the
.I post-install
and
.I pre-remove
directives.
Note that failure of installing the module will not influence the
exit status of
.B modprobe.
The optional
.I add
prefix adds the new list to the previous list instead of replacing it.
.TP
.I "[add] below module module_list"
This directive makes it possible for one module to "push"
another set of modules below itself in a module stack,
as seen in the output of the
.B lsmod(8)
command.
The
.I below
directive is useful for those circumstances when the dependencies
are more complex than what can be described in the
.B modules.dep
dependency file.
This is an optimized case of the
.I pre-install
and
.I post-remove
directives.
Note that failure of installing the module will not influence the
exit status of
.B modprobe.
The optional
.I add
prefix adds the new list to the previous list instead of replacing it.
.PP
The following directives are useful for (optionally) executing specific
commands when loading and unloading a module.  Note that even aliased
module names can have these directives,
which will be executed in the proper order together with any
directives for the unaliased module name.
.TP
.I "pre-install module command"
Execute
.I command
before installing the specified module.
See the
.I below
directive as well.
.TP
.I "install module command"
Execute
.I command
instead of the default
.B insmod
when installing the specified module.
.TP
.I "post-install module command"
Execute
.I command
after installing the specified module.
See the
.I above
directive as well.
.TP
.I "pre-remove module command"
Execute
.I command
before removing the specified module.
See the
.I above
directive as well.
.TP
.I "remove module command"
Execute
.I command
instead of the default (built-in)
.B rmmod
when removing the specified module.
.TP
.I "post-remove module command"
Execute
.I command
after removing the specified module.
See the
.I below
directive as well.
.PP
.SH DEFAULT CONFIGURATION
If the configuration file '/etc/modules.conf' is missing,
or if any directive is not overridden,
the following defaults are assumed:
.PP
  depfile=/lib/modules/`uname \-r`/modules.dep

  path[boot]=/lib/modules/boot
  path[fs]=/lib/modules/`uname \-r`/fs
  path[net]=/lib/modules/`uname \-r`/net
  path[scsi]=/lib/modules/`uname \-r`/scsi
  path[block]=/lib/modules/`uname \-r`/block
  path[cdrom]=/lib/modules/`uname \-r`/cdrom
  path[ipv4]=/lib/modules/`uname \-r`/ipv4
  path[ipv6]=/lib/modules/`uname \-r`/ipv6
  path[sound]=/lib/modules/`uname \-r`/sound
  path[fc4]=/lib/modules/`uname \-r`/fc4
  path[video]=/lib/modules/`uname \-r`/video
  path[misc]=/lib/modules/`uname \-r`/misc
  path[pcmcia]=/lib/modules/`uname \-r`/pcmcia
  path[atm]=/lib/modules/`uname \-r`/atm
  path[usb]=/lib/modules/`uname \-r`/usb
  path[ide]=/lib/modules/`uname \-r`/ide
  path[ieee1394]=/lib/modules/`uname \-r`/ieee1394

  path[fs]=/lib/modules/`kernelversion`/fs
  path[net]=/lib/modules/`kernelversion`/net
  path[scsi]=/lib/modules/`kernelversion`/scsi
  path[block]=/lib/modules/`kernelversion`/block
  path[cdrom]=/lib/modules/`kernelversion`/cdrom
  path[ipv4]=/lib/modules/`kernelversion`/ipv4
  path[ipv6]=/lib/modules/`kernelversion`/ipv6
  path[sound]=/lib/modules/`kernelversion`/sound
  path[fc4]=/lib/modules/`kernelversion`/fc4
  path[video]=/lib/modules/`kernelversion`/video
  path[misc]=/lib/modules/`kernelversion`/misc
  path[pcmcia]=/lib/modules/`kernelversion`/pcmcia
  path[atm]=/lib/modules/`kernelversion`/atm
  path[usb]=/lib/modules/`kernelversion`/usb
  path[ide]=/lib/modules/`kernelversion`/ide
  path[ieee1394]=/lib/modules/`kernelversion`/ieee1394

  path[fs]=/lib/modules/default/fs
  path[net]=/lib/modules/default/net
  path[scsi]=/lib/modules/default/scsi
  path[block]=/lib/modules/default/block
  path[cdrom]=/lib/modules/default/cdrom
  path[ipv4]=/lib/modules/default/ipv4
  path[ipv6]=/lib/modules/default/ipv6
  path[sound]=/lib/modules/default/sound
  path[fc4]=/lib/modules/default/fc4
  path[video]=/lib/modules/default/video
  path[misc]=/lib/modules/default/misc
  path[pcmcia]=/lib/modules/default/pcmcia
  path[atm]=/lib/modules/default/atm
  path[usb]=/lib/modules/default/usb
  path[ide]=/lib/modules/default/ide
  path[ieee1394]=/lib/modules/default/ieee1394

  path[fs]=/lib/modules/fs
  path[net]=/lib/modules/net
  path[scsi]=/lib/modules/scsi
  path[block]=/lib/modules/block
  path[cdrom]=/lib/modules/cdrom
  path[ipv4]=/lib/modules/ipv4
  path[ipv6]=/lib/modules/ipv6
  path[sound]=/lib/modules/sound
  path[fc4]=/lib/modules/fc4
  path[video]=/lib/modules/video
  path[misc]=/lib/modules/misc
  path[pcmcia]=/lib/modules/pcmcia
  path[atm]=/lib/modules/atm
  path[usb]=/lib/modules/usb
  path[ide]=/lib/modules/ide
  path[ieee1394]=/lib/modules/ieee1394
.PP
There are also a set of default
.I alias
and
.I options
directives.
Since this set is continously extended, no list will be given here.
The (current) default set can be viewed by using the
.B "modprobe \-c"
command with an empty
.B /etc/modules.conf
file.
.PP
All
.I options
directives specify the options needed for
a module, as in:
.nf

  modprobe de620 bnc=1

.fi
These options will be overridden by any options given
in the
.B /etc/modules.conf
file, and on the
.B modprobe
command line.
.PP
Remember that it is possible to have an
.I options
directive for aliased module names as well
as for the non-aliased name.
This is useful for e.g. the dummy module:
.nf

  alias dummy0 dummy
  options dummy0 \-o dummy0

.fi
.PP
.SH ALTERNATIVE CONFIGURATION FILE
For historical reasons, if /etc/modules.conf does not exist, modutils
will read /etc/conf.modules instead.
However the use of this historical name is depreciated and it should be
replaced with /etc/modules.conf.
This version of modutils issues a warning message if /etc/conf.modules
exists, later versions will give an error message and refuse to load
modules.
.SH SEE ALSO
depmod(8), modprobe(8), insmod(8)
.SH AUTHOR
.nf
Bjorn Ekwall <bj0rn@blox.se>
Keith Owens <kaos@ocs.com.au>