| 1 |
MODPROBE.D(5) "kmod" "modprobe.d" |
| 2 |
|
| 3 |
# NAME |
| 4 |
|
| 5 |
modprobe.d - Configuration directory for modprobe |
| 6 |
|
| 7 |
# SYNOPSIS |
| 8 |
|
| 9 |
@SYSCONFDIR@/modprobe.d/\*.conf |
| 10 |
|
| 11 |
/run/modprobe.d/\*.conf |
| 12 |
|
| 13 |
/usr/local/lib/modprobe.d/\*.conf |
| 14 |
|
| 15 |
@DISTCONFDIR@/modprobe.d/\*.conf |
| 16 |
|
| 17 |
/lib/modprobe.d/\*.conf |
| 18 |
|
| 19 |
# DESCRIPTION |
| 20 |
|
| 21 |
Because the *modprobe* command can add or remove more than one module, due to |
| 22 |
modules having dependencies, we need a method of specifying what options are to |
| 23 |
be used with those modules. One can also use them to create convenient aliases: |
| 24 |
alternate names for a module, or they can override the normal *modprobe* |
| 25 |
behavior altogether for those with special requirements (such as inserting more |
| 26 |
than one module). |
| 27 |
|
| 28 |
Note that module and alias names (like other module names) can have - or \_ in |
| 29 |
them: both are interchangeable throughout all the module commands as underscore |
| 30 |
conversion happens automatically. |
| 31 |
|
| 32 |
# CONFIGURATION FORMAT |
| 33 |
|
| 34 |
The configuration files contain one command per line, with blank lines and lines |
| 35 |
starting with '#' ignored (useful for adding comments). A '\\' at the end of a |
| 36 |
line causes it to continue on the next line, which makes the files a bit neater. |
| 37 |
|
| 38 |
See the COMMANDS section below for more. |
| 39 |
|
| 40 |
# CONFIGURATION DIRECTORIES AND PRECEDENCE |
| 41 |
|
| 42 |
Configuration files are read from directories in listed in SYNOPSIS in that |
| 43 |
order of precedence. Once a file of a given filename is loaded, any file of the |
| 44 |
same name in subsequent directories is ignored. |
| 45 |
|
| 46 |
All configuration files are sorted in lexicographic order, regardless of the |
| 47 |
directory they reside in. Configuration files can either be completely replaced |
| 48 |
(by having a new configuration file with the same name in a directory of higher |
| 49 |
priority) or partially replaced (by having a configuration file that is ordered |
| 50 |
later). |
| 51 |
|
| 52 |
NOTE: The configuration directories may be altered via the MODPROBE_OPTIONS |
| 53 |
environment variable. See the ENVIRONMENT section in *modprobe*(8). |
| 54 |
|
| 55 |
# COMMANDS |
| 56 |
|
| 57 |
alias _wildcard_ _modulename_ |
| 58 |
This allows you to give alternate names for a module. For example: |
| 59 |
"alias my-mod really_long_modulename" means you can use "modprobe |
| 60 |
my-mod" instead of "modprobe really_long_modulename". You can also use |
| 61 |
shell-style wildcards, so "alias my-mod\* really_long_modulename" means |
| 62 |
that "modprobe my-mod-something" has the same effect. You can't have |
| 63 |
aliases to other aliases (that way lies madness), but aliases can have |
| 64 |
options, which will be added to any other options. |
| 65 |
|
| 66 |
Note that modules can also contain their own aliases, which you can see |
| 67 |
using *modinfo*. These aliases are used as a last resort (ie. if there |
| 68 |
is no real module, *install*, *remove*, or *alias* command in the |
| 69 |
configuration). |
| 70 |
|
| 71 |
blacklist _modulename_ |
| 72 |
Modules can contain their own aliases: usually these are aliases |
| 73 |
describing the devices they support, such as "pci:123...". These |
| 74 |
"internal" aliases can be overridden by normal "alias" keywords, but |
| 75 |
there are cases where two or more modules both support the same devices, |
| 76 |
or a module invalidly claims to support a device that it does not: the |
| 77 |
*blacklist* keyword indicates that all of that particular module's |
| 78 |
internal aliases are to be ignored. |
| 79 |
|
| 80 |
install _modulename_ _command..._ |
| 81 |
This command instructs *modprobe* to run your command instead of |
| 82 |
inserting the module in the kernel as normal. The command can be any |
| 83 |
shell command: this allows you to do any kind of complex processing you |
| 84 |
might wish. For example, if the module "fred" works better with the |
| 85 |
module "barney" already installed (but it doesn't depend on it, so |
| 86 |
*modprobe* won't automatically load it), you could say "install fred |
| 87 |
/sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which |
| 88 |
would do what you wanted. Note the *--ignore-install*, which stops the |
| 89 |
second *modprobe* from running the same *install* command again. See |
| 90 |
also *remove* below. |
| 91 |
|
| 92 |
The long term future of this command as a solution to the problem of |
| 93 |
providing additional module dependencies is not assured and it is |
| 94 |
intended to replace this command with a warning about its eventual |
| 95 |
removal or deprecation at some point in a future release. Its use |
| 96 |
complicates the automated determination of module dependencies by |
| 97 |
distribution utilities, such as mkinitrd (because these now need to |
| 98 |
somehow interpret what the *install* commands might be doing. In a |
| 99 |
perfect world, modules would provide all dependency information without |
| 100 |
the use of this command and work is underway to implement soft |
| 101 |
dependency support within the Linux kernel. |
| 102 |
|
| 103 |
If you use the string "$CMDLINE_OPTS" in the command, it will be |
| 104 |
replaced by any options specified on the modprobe command line. This can |
| 105 |
be useful because users expect "modprobe fred opt=1" to pass the "opt=1" |
| 106 |
arg to the module, even if there's an install command in the |
| 107 |
configuration file. So our above example becomes "install fred |
| 108 |
/sbin/modprobe barney; /sbin/modprobe --ignore-install fred |
| 109 |
$CMDLINE_OPTS" |
| 110 |
|
| 111 |
options _modulename_ _option..._ |
| 112 |
This command allows you to add options to the module _modulename_ (which |
| 113 |
might be an alias) every time it is inserted into the kernel: whether |
| 114 |
directly (using *modprobe* _modulename_) or because the module being |
| 115 |
inserted depends on this module. |
| 116 |
|
| 117 |
All options are added together: they can come from an *option* for the |
| 118 |
module itself, for an alias, and on the command line. |
| 119 |
|
| 120 |
remove _modulename_ _command..._ |
| 121 |
This is similar to the *install* command above, except it is invoked |
| 122 |
when "modprobe -r" is run. |
| 123 |
|
| 124 |
softdep _modulename_ pre: _modules..._ post: _modules..._ |
| 125 |
The *softdep* command allows you to specify soft, or optional, module |
| 126 |
dependencies. _modulename_ can be used without these optional modules |
| 127 |
installed, but usually with some features missing. For example, a driver |
| 128 |
for a storage HBA might require another module be loaded in order to use |
| 129 |
management features. |
| 130 |
|
| 131 |
pre-deps and post-deps modules are lists of names and/or aliases of |
| 132 |
other modules that modprobe will attempt to install (or remove) in order |
| 133 |
before and after the main module given in the _modulename_ argument. |
| 134 |
|
| 135 |
Example: Assume "softdep c pre: a b post: d e" is provided in the |
| 136 |
configuration. Running "modprobe c" is now equivalent to "modprobe a b c |
| 137 |
d e" without the softdep. Flags such as --use-blacklist are applied to |
| 138 |
all the specified modules, while module parameters only apply to module |
| 139 |
c. |
| 140 |
|
| 141 |
Note: if there are *install* or *remove* commands with the same |
| 142 |
_modulename_ argument, *softdep* takes precedence. |
| 143 |
|
| 144 |
weakdep _modulename_ _modules..._ |
| 145 |
The *weakdep* command allows you to specify weak module dependencies. |
| 146 |
Those are similar to pre softdep, with the difference that userspace |
| 147 |
doesn't attempt to load that dependency before the specified module. |
| 148 |
Instead the kernel may request one or multiple of them during module |
| 149 |
probe, depending on the hardware it's binding to. The purpose of weak |
| 150 |
module is to allow a driver to specify that a certain dependency may be |
| 151 |
needed, so it should be present in the filesystem (e.g. in initramfs) |
| 152 |
when that module is probed. |
| 153 |
|
| 154 |
Example: Assume "weakdep c a b". A program creating an initramfs knows |
| 155 |
it should add a, b, and c to the filesystem since a and b may be |
| 156 |
required/desired at runtime. When c is loaded and is being probed, it |
| 157 |
may issue calls to request_module() causing a or b to also be loaded. |
| 158 |
|
| 159 |
# COMPATIBILITY |
| 160 |
|
| 161 |
A future version of kmod will come with a strong warning to avoid use of the |
| 162 |
*install* as explained above. This will happen once support for soft |
| 163 |
dependencies in the kernel is complete. That support will complement the |
| 164 |
existing softdep support within this utility by providing such dependencies |
| 165 |
directly within the modules. |
| 166 |
|
| 167 |
# COPYRIGHT |
| 168 |
|
| 169 |
This manual page originally Copyright 2004, Rusty Russell, IBM Corporation. |
| 170 |
|
| 171 |
# SEE ALSO |
| 172 |
|
| 173 |
*modprobe*(8), *modules.dep*(5) |
| 174 |
|
| 175 |
# BUGS |
| 176 |
|
| 177 |
Please direct any bug reports to kmod's issue tracker at |
| 178 |
https://github.com/kmod-project/kmod/issues/ alongside with version used, steps |
| 179 |
to reproduce the problem and the expected outcome. |
| 180 |
|
| 181 |
# AUTHORS |
| 182 |
|
| 183 |
Numerous contributions have come from the linux-modules mailing list |
| 184 |
<[email protected]> and Github. If you have a clone of kmod.git |
| 185 |
itself, the output of *git-shortlog*(1) and *git-blame*(1) can show you the |
| 186 |
authors for specific parts of the project. |
| 187 |
|
| 188 |
*Lucas De Marchi* <[email protected]> is the current maintainer of the |
| 189 |
project. |