Debian Codegraph @

upstream/debian-unstable/man8/depmod.8

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