| 1 |
DEPMOD(8) "kmod" "depmod" |
| 2 |
|
| 3 |
# NAME |
| 4 |
|
| 5 |
depmod - Generate modules.dep and map files. |
| 6 |
|
| 7 |
# SYNOPSIS |
| 8 |
|
| 9 |
*depmod* [*-b* _basedir_] [*-m* _moduledir_] [*-o* _outdir_] [*-e*] [*-E* _Module.symvers_] |
| 10 |
\ \ \ \ \ \ \ \[*-F* _System.map_] [*-n*] [*-v*] [*-A*] [*-P* _prefix_] [*-w*] [_version_] |
| 11 |
|
| 12 |
*depmod* [*-e*] [*-E* _Module.symvers_] [*-F* _System.map_] [*-n*] [*-v*] [*-P* _prefix_] |
| 13 |
\ \ \ \ \ \ \ \[*-w*] [_version_] [_filename_...] |
| 14 |
|
| 15 |
# DESCRIPTION |
| 16 |
|
| 17 |
Linux kernel modules can provide services (called "symbols") for other modules |
| 18 |
to use (using one of the EXPORT_SYMBOL variants in the code). If a second module |
| 19 |
uses this symbol, that second module clearly depends on the first module. These |
| 20 |
dependencies can get quite complex. |
| 21 |
|
| 22 |
*depmod* creates a list of module dependencies by reading each module under |
| 23 |
<BASEDIR>/<MODULEDIR>/_version_. By default <MODULEDIR> is @MODULE_DIRECTORY@ |
| 24 |
and <BASEDIR> is empty. See options below to override when needed. It determines |
| 25 |
what symbols each module exports and needs. This list is written to |
| 26 |
*modules.dep*, and a binary hashed version named modules.dep.bin, in the same |
| 27 |
directory. If filenames are given on the command line, only those modules are |
| 28 |
examined (which is rarely useful unless all modules are listed). *depmod* also |
| 29 |
creates a list of symbols provided by modules in the file named modules.symbols |
| 30 |
and its binary hashed version, modules.symbols.bin. Finally, *depmod* will |
| 31 |
output a file named modules.devname if modules supply special device names |
| 32 |
(devname) that should be populated in /dev on boot (by a utility such as |
| 33 |
systemd-tmpfiles). |
| 34 |
|
| 35 |
If a _version_ is provided, then that kernel version's module directory is used |
| 36 |
rather than the current kernel version (as returned by *uname -r*). |
| 37 |
|
| 38 |
# OPTIONS |
| 39 |
|
| 40 |
*-a*, *--all* |
| 41 |
Probe all modules. This option is enabled by default if no file names |
| 42 |
are given in the command-line. |
| 43 |
|
| 44 |
*-A*, *--quick* |
| 45 |
This option scans to see if any modules are newer than the |
| 46 |
*modules.dep* file before any work is done: if not, it silently exits |
| 47 |
rather than regenerating the files. |
| 48 |
|
| 49 |
*-b* _basedir_, *--basedir*=_basedir_ |
| 50 |
Override the base directory <BASEDIR> where modules are located. |
| 51 |
If your modules are not currently in the (normal) directory |
| 52 |
@MODULE_DIRECTORY@/_version_, but in a staging area, you can specify a |
| 53 |
_basedir_ which is prepended to the directory name. This _basedir_ is |
| 54 |
stripped from the resulting *modules.dep* file, so it is ready to be |
| 55 |
moved into the normal location. Use this option if you are a |
| 56 |
distribution vendor who needs to pre-generate the meta-data files rather |
| 57 |
than running *depmod* again later. |
| 58 |
|
| 59 |
If a relative path is given, it's relative to the current working |
| 60 |
directory. |
| 61 |
|
| 62 |
Example: |
| 63 |
depmod -b /my/build/staging/dir/ |
| 64 |
|
| 65 |
This expects all input files under |
| 66 |
_/my/build/staging/dir@MODULE_DIRECTORY@/$(uname -r)_ and generates |
| 67 |
index files under that same directory. |
| 68 |
|
| 69 |
*-m* _moduledir_, *--moduledir*=_moduledir_ |
| 70 |
Override the module directory <MODULEDIR>, which defaults to |
| 71 |
@MODULE_DIRECTORY@ prefix set at build time. This is useful when |
| 72 |
building *modules.dep* file in _basedir_ for a system that uses a |
| 73 |
different prefix, e.g. _/usr/lib/modules_ vs _/lib/modules_. |
| 74 |
|
| 75 |
Relative and absolute paths are accepted, but they are always relative |
| 76 |
to the _basedir_. |
| 77 |
|
| 78 |
Examples: |
| 79 |
depmod -b /tmp/build -m /kernel-modules++ |
| 80 |
depmod -b /tmp/build -m kernel-modules |
| 81 |
|
| 82 |
This expects all input files under |
| 83 |
_/tmp/build/kernel-modules/$(uname -r)_ and generates index files under |
| 84 |
that same directory. |
| 85 |
|
| 86 |
Without an accompanying *-b* argument, the moduledir is relative to _/_. |
| 87 |
Example: |
| 88 |
|
| 89 |
depmod -m foo/bar |
| 90 |
|
| 91 |
This expects all input files under _/foo/bar/$(uname -r)_ and generates |
| 92 |
index files under the same directory. Unless libkmod is prepared to |
| 93 |
handle that arbitrary location, it won't work in runtime. |
| 94 |
|
| 95 |
|
| 96 |
*-o* _outdir_, *--outdir*=_outdir_ |
| 97 |
Set the output directory where *depmod* will store any generated file. |
| 98 |
_outdir_ serves as a root to that location, similar to how _basedir_ is |
| 99 |
used. Also this setting takes precedence and if used together with |
| 100 |
_basedir_ it will result in the input being that directory, but the output |
| 101 |
being the one set by _outdir_. |
| 102 |
|
| 103 |
If a relative path is given, it's relative to the current working |
| 104 |
directory. |
| 105 |
|
| 106 |
Example: |
| 107 |
depmod -o /my/build/staging/dir/ |
| 108 |
|
| 109 |
This expects all input files under |
| 110 |
_@MODULE_DIRECTORY@/$(uname -r)_ and generates index files under |
| 111 |
_/my/build/staging/dir@MODULE_DIRECTORY@/$(uname -r)_. |
| 112 |
|
| 113 |
*-C* _file_ _or_ _directory_, *--config*=_file_ _or_ _directory_ |
| 114 |
This option overrides the default configuration files. See |
| 115 |
*depmod.d*(5). |
| 116 |
|
| 117 |
*-e*, *--errsyms* |
| 118 |
When combined with the *-F* option, this reports any symbols which a |
| 119 |
module needs which are not supplied by other modules or the kernel. |
| 120 |
Normally, any symbols not provided by modules are assumed to be provided |
| 121 |
by the kernel (which should be true in a perfect world), but this |
| 122 |
assumption can break especially when additionally updated third party |
| 123 |
drivers are not correctly installed or were built incorrectly. |
| 124 |
|
| 125 |
*-E* _Module.symvers_, *--symvers*=_Module.symvers_ |
| 126 |
When combined with the *-e* option, this reports any symbol versions |
| 127 |
supplied by modules that do not match with the symbol versions provided |
| 128 |
by the kernel in its _Module.symvers_. This option is mutually |
| 129 |
incompatible with *-F*. |
| 130 |
|
| 131 |
*-F* _System.map_, *--filesyms*=_System.map_ |
| 132 |
Supplied with the _System.map_ produced when the kernel was built, this |
| 133 |
allows the *-e* option to report unresolved symbols. This option is |
| 134 |
mutually incompatible with *-E*. |
| 135 |
|
| 136 |
*-h*, *--help* |
| 137 |
Print the help message and exit. |
| 138 |
|
| 139 |
*-n*, *--show*, *--dry-run* |
| 140 |
This sends the resulting *modules.dep* and the various map files to |
| 141 |
standard output rather than writing them into the module directory. |
| 142 |
|
| 143 |
*-P* |
| 144 |
Some architectures prefix symbols with an extraneous character. This |
| 145 |
specifies a prefix character (for example '\_') to ignore. |
| 146 |
|
| 147 |
*-v*, *--verbose* |
| 148 |
In verbose mode, *depmod* will print (to stdout) all the symbols each |
| 149 |
module depends on and the module's file name which provides that symbol. |
| 150 |
|
| 151 |
*-V*, *--version* |
| 152 |
Show version of program and exit. See below for caveats when run on |
| 153 |
older kernels. |
| 154 |
|
| 155 |
*-w* |
| 156 |
Warn on duplicate dependencies, aliases, symbol versions, etc. |
| 157 |
|
| 158 |
# COPYRIGHT |
| 159 |
|
| 160 |
This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. |
| 161 |
Portions Copyright Jon Masters, and others. |
| 162 |
|
| 163 |
# SEE ALSO |
| 164 |
|
| 165 |
*depmod.d*(5), *modprobe*(8), *modules.dep*(5) |
| 166 |
|
| 167 |
# BUGS |
| 168 |
|
| 169 |
Please direct any bug reports to kmod's issue tracker at |
| 170 |
https://github.com/kmod-project/kmod/issues/ alongside with version used, steps |
| 171 |
to reproduce the problem and the expected outcome. |
| 172 |
|
| 173 |
# AUTHORS |
| 174 |
|
| 175 |
Numerous contributions have come from the linux-modules mailing list |
| 176 |
<[email protected]> and Github. If you have a clone of kmod.git |
| 177 |
itself, the output of *git-shortlog*(1) and *git-blame*(1) can show you the |
| 178 |
authors for specific parts of the project. |
| 179 |
|
| 180 |
*Lucas De Marchi* <[email protected]> is the current maintainer of the |
| 181 |
project. |