27
27
<manvolnum>5</manvolnum>
30
<refname>modprobe.conf</refname><refname>modprobe.d</refname> <refpurpose>Configuration file/directory for modprobe</refpurpose>
30
<refname>modprobe.d</refname><refname>modprobe.conf</refname> <refpurpose>Configuration directory/file for modprobe</refpurpose>
33
33
<title>DESCRIPTION</title>
35
35
<para>Because the <command>modprobe</command> command can add or
36
remove extra more than one module, due to module dependencies,
36
remove more than one module, due to module dependencies,
37
37
we need a method of specifying what options are to be used with
38
those modules. <filename>/etc/modprobe.conf</filename> (or, if that does not exist, all files under the <filename>/etc/modprobe.d</filename> directory) specifies
39
those options, as required. It can also be used to create
40
convenient aliases: alternate names for a module. Finally, it
41
can override the normal <command>modprobe</command> behavior
42
altogether, for those with very special requirements (such as
43
inserting more than one module).
38
those modules. All files underneath the
39
<filename>/etc/modprobe.d</filename> directory which end with the
40
<filename>.conf</filename> extension specify those options as
41
required. (the <filename>/etc/modprobe.conf</filename> file can
42
also be used if it exists, but that will be removed in a future
43
version). They can also be used to create convenient aliases:
44
alternate names for a module, or they can override the normal
45
<command>modprobe</command> behavior altogether for those with
46
special requirements (such as inserting more than one module).
46
49
Note that module and alias names (like other module names) can
51
The format of <filename>modprobe.conf</filename> and files under <filename>modprobe.d</filename> is simple: one
52
command per line, with blank lines and lines starting with #
53
ignored (useful for adding comments). A \ at the end of a line
54
The format of and files under <filename>modprobe.d</filename> and
55
<filename>/etc/modprobe.conf</filename> is simple: one
56
command per line, with blank lines and lines starting with '#'
57
ignored (useful for adding comments). A '\' at the end of a line
54
58
causes it to continue on the next line, which makes the file a
58
The syntax is a simplification of <filename>modules.conf</filename>, used in 2.4 kernels and earlier.
62
63
<title>COMMANDS</title>
95
96
<replaceable>modulename</replaceable> (which might be an
96
97
alias) every time it is inserted into the kernel: whether
97
98
directly (using <command>modprobe</command>
98
<replaceable>modulename</replaceable>, or because the
99
<replaceable>modulename</replaceable> or because the
99
100
module being inserted depends on this module.
113
This is the most powerful primitive in
114
<filename>modprobe.conf</filename>: it tells
114
This is the most powerful primitive: it tells
115
115
<command>modprobe</command> to run your command instead of
116
116
inserting the module in the kernel as normal. The command
117
117
can be any shell command: this allows you to do any kind
118
118
of complex processing you might wish. For example, if the
119
module "fred" worked better with the module "barney"
120
already installed (but it didn't depend on it, so
119
module "fred" works better with the module "barney"
120
already installed (but it doesn't depend on it, so
121
121
<command>modprobe</command> won't automatically load it),
122
122
you could say "install fred /sbin/modprobe barney;
123
123
/sbin/modprobe --ignore-install fred", which would do what
124
124
you wanted. Note the <option>--ignore-install</option>,
125
125
which stops the second <command>modprobe</command> from
126
re-running the same <command>install</command> command.
126
running the same <command>install</command> command again.
127
127
See also <command>remove</command> below.
130
130
You can also use <command>install</command> to make up
131
131
modules which don't otherwise exist. For example:
132
132
"install probe-ethernet /sbin/modprobe e100 ||
133
/sbin/modprobe eepro100", which will try first the e100
134
driver, then the eepro100 driver, when you do "modprobe
133
/sbin/modprobe eepro100", which will first try to load the e100
134
driver, and if it fails, then the eepro100 driver when you do "modprobe
164
<term>include <replaceable>filename</replaceable>
168
Using this command, you can include other configuration
169
files, or whole directories, which is occasionally useful. Note that aliases in
170
the included file will override aliases previously
171
declared in the current file.
176
164
<term>blacklist <replaceable>modulename</replaceable>
194
<title>Backwards Compatibility</title>
197
There is a <command>generate_modprobe.conf</command> program
198
which should do a reasonable job of generating
199
<filename>modprobe.conf</filename> from old (2.4 or 2.2)
203
Although the syntax is similar to the older
204
<filename>/etc/modules.conf</filename>, there are many features
205
missing. There are two reasons for this: firstly, install and
206
remove commands can do just about anything, and secondly, the
207
module-init-tools modprobe is designed to be simple enough that
208
it can be easily replaced.
211
With the complexity of actual module insertion reduced to three
212
system calls (open, read, init_module), and the
213
<filename>modules.dep</filename> file being simple and open,
214
producing a more powerful modprobe variant can be done
215
independently if there is a need.
219
182
<title>COPYRIGHT</title>
221
184
This manual page Copyright 2004, Rusty Russell, IBM Corporation.