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