| 1 |
MODPROBE(8) "kmod" "modprobe" |
| 2 |
|
| 3 |
# NAME |
| 4 |
|
| 5 |
modprobe - Add and remove modules from the Linux Kernel |
| 6 |
|
| 7 |
# SYNOPSIS |
| 8 |
|
| 9 |
*modprobe* [*-v*] [*-V*] [*-C* _config-file_] [*-n*] [*-i*] [*-q*] [*-b*] [_modulename_] |
| 10 |
\ \ \ \ \ \ \ \ \ \[_module parameters_...] |
| 11 |
|
| 12 |
*modprobe* [*-r*] [*-v*] [*-n*] [*-i*] [_modulename_...] |
| 13 |
|
| 14 |
*modprobe* [*-c*] |
| 15 |
|
| 16 |
*modprobe* [*--dump-modversions*] [_filename_] |
| 17 |
|
| 18 |
# DESCRIPTION |
| 19 |
|
| 20 |
*modprobe* intelligently adds or removes a module from the Linux kernel: note |
| 21 |
that for convenience, there is no difference between \_ and - in module names |
| 22 |
(automatic underscore conversion is performed). *modprobe* looks in the module |
| 23 |
directory @DISTCONFDIR@/`uname -r` for all the modules and other files, except |
| 24 |
for the optional configuration files (see *modprobe.d*(5)). *modprobe* will also |
| 25 |
use module options specified on the kernel command line in the form of |
| 26 |
<module>.<option> and blacklists in the form of modprobe.blacklist=<module>. |
| 27 |
|
| 28 |
Note that unlike in 2.4 series Linux kernels (which are not supported by this |
| 29 |
tool) this version of *modprobe* does not do anything to the module itself: the |
| 30 |
work of resolving symbols and understanding parameters is done inside the |
| 31 |
kernel. So module failure is sometimes accompanied by a kernel message: see |
| 32 |
*dmesg*(8). |
| 33 |
|
| 34 |
*modprobe* expects an up-to-date modules.dep.bin file as generated by the |
| 35 |
corresponding *depmod* utility shipped along with *modprobe* (see *depmod*(8)). |
| 36 |
This file lists what other modules each module needs (if any), and *modprobe* |
| 37 |
uses this to add or remove these dependencies automatically. |
| 38 |
|
| 39 |
If any arguments are given after the _modulename_, they are passed to the kernel |
| 40 |
(in addition to any options listed in the configuration file). |
| 41 |
|
| 42 |
When loading modules, _modulename_ can also be a path to the module. If the path |
| 43 |
is relative, it must explicitly start with "./". Note that this may fail when |
| 44 |
using a path to a module with dependencies not matching the installed *depmod* |
| 45 |
database. |
| 46 |
|
| 47 |
# OPTIONS |
| 48 |
|
| 49 |
*-a*, *--all* |
| 50 |
Insert all module names on the command line. |
| 51 |
|
| 52 |
*-b*, *--use-blacklist* |
| 53 |
This option causes *modprobe* to apply the *blacklist* commands in the |
| 54 |
configuration files (if any) to module names as well. It is usually used |
| 55 |
by *udev*(7). |
| 56 |
|
| 57 |
*-C* _directory_, *--config*=_directory_ |
| 58 |
This option overrides the default configuration directory. See |
| 59 |
*modprobe.d*(5). |
| 60 |
|
| 61 |
This option is passed through *install* or *remove* commands to other |
| 62 |
*modprobe* commands in the MODPROBE_OPTIONS environment variable. |
| 63 |
|
| 64 |
*-c*, *--showconfig* |
| 65 |
Dump out the effective configuration from the config directory and exit. |
| 66 |
|
| 67 |
*--dump-modversions* |
| 68 |
Print out a list of module versioning information required by a module. |
| 69 |
This option is commonly used by distributions in order to package up a |
| 70 |
Linux kernel module using module versioning deps. |
| 71 |
|
| 72 |
*-d*, *--dirname* |
| 73 |
Root directory for modules, / by default. |
| 74 |
|
| 75 |
*--first-time* |
| 76 |
Normally, *modprobe* will succeed (and do nothing) if told to insert a |
| 77 |
module which is already present or to remove a module which isn't |
| 78 |
present. This is ideal for simple scripts; however, more complicated |
| 79 |
scripts often want to know whether *modprobe* really did something: this |
| 80 |
option makes *modprobe* fail in the case that it actually didn't do |
| 81 |
anything. |
| 82 |
|
| 83 |
*--force-vermagic* |
| 84 |
Every module contains a small string containing important information, |
| 85 |
such as the kernel and compiler versions. If a module fails to load and |
| 86 |
the kernel complains that the "version magic" doesn't match, you can use |
| 87 |
this option to remove it. Naturally, this check is there for your |
| 88 |
protection, so using this option is dangerous unless you know what |
| 89 |
you're doing. |
| 90 |
|
| 91 |
This applies to any modules inserted: both the module (or alias) on the |
| 92 |
command line and any modules on which it depends. |
| 93 |
|
| 94 |
*--force-modversion* |
| 95 |
When modules are compiled with CONFIG_MODVERSIONS set, a section |
| 96 |
detailing the versions of every interfaced used by (or supplied by) the |
| 97 |
module is created. If a module fails to load and the kernel complains |
| 98 |
that the module disagrees about a version of some interface, you can use |
| 99 |
*--force-modversion* to remove the version information altogether. |
| 100 |
Naturally, this check is there for your protection, so using this option |
| 101 |
is dangerous unless you know what you're doing. |
| 102 |
|
| 103 |
This applies to any modules inserted: both the module (or alias) on the |
| 104 |
command line and any modules on which it depends. |
| 105 |
|
| 106 |
*-f*, *--force* |
| 107 |
Try to strip any versioning information from the module which might |
| 108 |
otherwise stop it from loading: this is the same as using both |
| 109 |
*--force-vermagic* and *--force-modversion*. Naturally, these checks are |
| 110 |
there for your protection, so using this option is dangerous unless you |
| 111 |
know what you are doing. |
| 112 |
|
| 113 |
This applies to any modules inserted: both the module (or alias) on the |
| 114 |
command line and any modules on which it depends. |
| 115 |
|
| 116 |
*-i*, *--ignore-install*, *--ignore-remove* |
| 117 |
This option causes *modprobe* to ignore *install* and *remove* commands |
| 118 |
in the configuration file (if any) for the module specified on the |
| 119 |
command line (any dependent modules are still subject to commands set |
| 120 |
for them in the configuration file). Both *install* and *remove* commands |
| 121 |
will currently be ignored when this option is used regardless of whether |
| 122 |
the request was more specifically made with only one or other (and not |
| 123 |
both) of *--ignore-install* or *--ignore-remove*. See *modprobe.d*(5). |
| 124 |
|
| 125 |
*-n*, *--dry-run*, *--show* |
| 126 |
This option does everything but actually insert or delete the modules |
| 127 |
(or run the install or remove commands). Combined with *-v*, it is |
| 128 |
useful for debugging problems. For historical reasons both *--dry-run* |
| 129 |
and *--show* actually mean the same thing and are interchangeable. |
| 130 |
|
| 131 |
*-q*, *--quiet* |
| 132 |
With this flag, *modprobe* won't print an error message if you try to |
| 133 |
remove or insert a module it can't find (and isn't an alias or |
| 134 |
*install*/*remove* command). However, it will still return with a non-zero |
| 135 |
exit status. The kernel uses this to opportunistically probe for modules |
| 136 |
which might exist using request_module. |
| 137 |
|
| 138 |
*-R*, *--resolve-alias* |
| 139 |
Print all module names matching an alias. This can be useful for |
| 140 |
debugging module alias problems. |
| 141 |
|
| 142 |
***-r*, *--remove* |
| 143 |
This option causes *modprobe* to remove rather than insert a module. If |
| 144 |
the modules it depends on are also unused, *modprobe* will try to remove |
| 145 |
them too. Unlike insertion, more than one module can be specified on the |
| 146 |
command line (it does not make sense to specify module parameters when |
| 147 |
removing modules). |
| 148 |
|
| 149 |
There is usually no reason to remove modules, but some buggy modules |
| 150 |
require it. Your distribution kernel may not have been built to support |
| 151 |
removal of modules at all. |
| 152 |
|
| 153 |
*-w* _TIMEOUT_MSEC_, *--wait*=_TIMEOUT_MSEC_ |
| 154 |
This option causes *modprobe -r *to continue trying to remove a module |
| 155 |
if it fails due to the module being busy, i.e. its refcount is not 0 at |
| 156 |
the time the call is made. Modprobe tries to remove the module with an |
| 157 |
incremental sleep time between each tentative up until the maximum wait |
| 158 |
time in milliseconds passed in this option. |
| 159 |
|
| 160 |
*-S* _version_, *--set-version*=_version_ |
| 161 |
Set the kernel version, rather than using *uname*(2) to decide on the |
| 162 |
kernel version (which dictates where to find the modules). |
| 163 |
|
| 164 |
*--show-depends* |
| 165 |
List the dependencies of a module (or alias), including the module |
| 166 |
itself. This produces a (possibly empty) set of module filenames, one |
| 167 |
per line, each starting with "insmod" and is typically used by |
| 168 |
distributions to determine which modules to include when generating |
| 169 |
initrd/initramfs images. *Install* commands which apply are shown |
| 170 |
prefixed by "install". It does not run any of the install commands. Note |
| 171 |
that *modinfo*(8) can be used to extract dependencies of a module from the |
| 172 |
module itself, but knows nothing of aliases or install commands. |
| 173 |
|
| 174 |
*-s*, *--syslog* |
| 175 |
This option causes any error messages to go through the syslog mechanism |
| 176 |
(as LOG_DAEMON with level LOG_NOTICE) rather than to standard error. |
| 177 |
This is also automatically enabled when stderr is unavailable. |
| 178 |
|
| 179 |
This option is passed through *install* or *remove* commands to other |
| 180 |
*modprobe* commands in the MODPROBE_OPTIONS environment variable. |
| 181 |
|
| 182 |
*-V*, *--version* |
| 183 |
Show version of program and exit. |
| 184 |
|
| 185 |
*-v*, *--verbose* |
| 186 |
Print messages about what the program is doing. Usually *modprobe* only |
| 187 |
prints messages if something goes wrong. |
| 188 |
|
| 189 |
This option is passed through *install* or *remove* commands to other |
| 190 |
*modprobe* commands in the MODPROBE_OPTIONS environment variable. |
| 191 |
|
| 192 |
# ENVIRONMENT |
| 193 |
|
| 194 |
The MODPROBE_OPTIONS environment variable can also be used to pass command line |
| 195 |
arguments to *modprobe*. The format is intentionally left undocumented, since |
| 196 |
the use by third-party tools and scripts is discouraged. |
| 197 |
|
| 198 |
The environment variable originates with the implementation of the install |
| 199 |
rules. |
| 200 |
|
| 201 |
# COPYRIGHT |
| 202 |
|
| 203 |
This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. |
| 204 |
|
| 205 |
# SEE ALSO |
| 206 |
|
| 207 |
*modprobe.d*(5), *insmod*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8) |
| 208 |
|
| 209 |
# BUGS |
| 210 |
|
| 211 |
Please direct any bug reports to kmod's issue tracker at |
| 212 |
https://github.com/kmod-project/kmod/issues/ alongside with version used, steps |
| 213 |
to reproduce the problem and the expected outcome. |
| 214 |
|
| 215 |
# AUTHORS |
| 216 |
|
| 217 |
Numerous contributions have come from the linux-modules mailing list |
| 218 |
<[email protected]> and Github. If you have a clone of kmod.git |
| 219 |
itself, the output of *git-shortlog*(1) and *git-blame*(1) can show you the |
| 220 |
authors for specific parts of the project. |
| 221 |
|
| 222 |
*Lucas De Marchi* <[email protected]> is the current maintainer of the |
| 223 |
project. |