1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
'\" t
.\" Title: depmod
.\" Author: Jon Masters <jcm@jonmasters.org>
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 02/09/2023
.\" Manual: depmod
.\" Source: kmod
.\" Language: English
.\"
.TH "DEPMOD" "8" "02/09/2023" "kmod" "depmod"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
depmod \- Generate modules\&.dep and map files\&.
.SH "SYNOPSIS"
.HP \w'\fBdepmod\fR\ 'u
\fBdepmod\fR [\fB\-b\ \fR\fB\fIbasedir\fR\fR] [\fB\-o\ \fR\fB\fIoutdir\fR\fR] [\fB\-e\fR] [\fB\-E\ \fR\fB\fIModule\&.symvers\fR\fR] [\fB\-F\ \fR\fB\fISystem\&.map\fR\fR] [\fB\-n\fR] [\fB\-v\fR] [\fB\-A\fR] [\fB\-P\ \fR\fB\fIprefix\fR\fR] [\fB\-w\fR] [\fB\fIversion\fR\fR]
.HP \w'\fBdepmod\fR\ 'u
\fBdepmod\fR [\fB\-e\fR] [\fB\-E\ \fR\fB\fIModule\&.symvers\fR\fR] [\fB\-F\ \fR\fB\fISystem\&.map\fR\fR] [\fB\-n\fR] [\fB\-v\fR] [\fB\-P\ \fR\fB\fIprefix\fR\fR] [\fB\-w\fR] [\fB\fIversion\fR\fR] [\fB\fIfilename\fR\fR...]
.SH "DESCRIPTION"
.PP
Linux kernel modules can provide services (called "symbols") for other modules to use (using one of the EXPORT_SYMBOL variants in the code)\&. If a second module uses this symbol, that second module clearly depends on the first module\&. These dependencies can get quite complex\&.
.PP
\fBdepmod\fR
creates a list of module dependencies by reading each module under
/lib/modules/\fIversion\fR
and determining what symbols it exports and what symbols it needs\&. By default, this list is written to
modules\&.dep, and a binary hashed version named
modules\&.dep\&.bin, in the same directory\&. If filenames are given on the command line, only those modules are examined (which is rarely useful unless all modules are listed)\&.
\fBdepmod\fR
also creates a list of symbols provided by modules in the file named
modules\&.symbols
and its binary hashed version,
modules\&.symbols\&.bin\&. Finally,
\fBdepmod\fR
will output a file named
modules\&.devname
if modules supply special device names (devname) that should be populated in /dev on boot (by a utility such as systemd\-tmpfiles)\&.
.PP
If a
\fIversion\fR
is provided, then that kernel version\*(Aqs module directory is used rather than the current kernel version (as returned by
\fBuname \-r\fR)\&.
.SH "OPTIONS"
.PP
\fB\-a\fR, \fB\-\-all\fR
.RS 4
Probe all modules\&. This option is enabled by default if no file names are given in the command\-line\&.
.RE
.PP
\fB\-A\fR, \fB\-\-quick\fR
.RS 4
This option scans to see if any modules are newer than the
modules\&.dep
file before any work is done: if not, it silently exits rather than regenerating the files\&.
.RE
.PP
\fB\-b \fR\fB\fIbasedir\fR\fR, \fB\-\-basedir \fR\fB\fIbasedir\fR\fR
.RS 4
If your modules are not currently in the (normal) directory
/lib/modules/\fIversion\fR, but in a staging area, you can specify a
\fIbasedir\fR
which is prepended to the directory name\&. This
\fIbasedir\fR
is stripped from the resulting
modules\&.dep
file, so it is ready to be moved into the normal location\&. Use this option if you are a distribution vendor who needs to pre\-generate the meta\-data files rather than running depmod again later\&.
.RE
.PP
\fB\-o \fR\fB\fIoutdir\fR\fR, \fB\-\-outdir \fR\fB\fIoutdir\fR\fR
.RS 4
Set the output directory where depmod will store any generated file\&.
\fIoutdir\fR
serves as a root to that location, similar to how
\fIbasedir\fR
is used\&. Also this setting takes precedence and if used together with
\fIbasedir\fR
it will result in the input being that directory, but the output being the one set by
\fIoutdir\fR\&.
.RE
.PP
\fB\-C\fR, \fB\-\-config \fR\fB\fIfile or directory\fR\fR
.RS 4
This option overrides the default configuration directory at
/etc/depmod\&.d/\&.
.RE
.PP
\fB\-e\fR, \fB\-\-errsyms\fR
.RS 4
When combined with the
\fB\-F\fR
option, this reports any symbols which a module needs which are not supplied by other modules or the kernel\&. Normally, any symbols not provided by modules are assumed to be provided by the kernel (which should be true in a perfect world), but this assumption can break especially when additionally updated third party drivers are not correctly installed or were built incorrectly\&.
.RE
.PP
\fB\-E\fR, \fB\-\-symvers\fR
.RS 4
When combined with the
\fB\-e\fR
option, this reports any symbol versions supplied by modules that do not match with the symbol versions provided by the kernel in its
Module\&.symvers\&. This option is mutually incompatible with
\fB\-F\fR\&.
.RE
.PP
\fB\-F\fR, \fB\-\-filesyms \fR\fB\fISystem\&.map\fR\fR
.RS 4
Supplied with the
System\&.map
produced when the kernel was built, this allows the
\fB\-e\fR
option to report unresolved symbols\&. This option is mutually incompatible with
\fB\-E\fR\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print the help message and exit\&.
.RE
.PP
\fB\-n\fR, \fB\-\-show\fR, \fB\-\-dry\-run\fR
.RS 4
This sends the resulting modules\&.dep and the various map files to standard output rather than writing them into the module directory\&.
.RE
.PP
\fB\-P\fR
.RS 4
Some architectures prefix symbols with an extraneous character\&. This specifies a prefix character (for example \*(Aq_\*(Aq) to ignore\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
In verbose mode,
\fBdepmod\fR
will print (to stdout) all the symbols each module depends on and the module\*(Aqs file name which provides that symbol\&.
.RE
.PP
\fB\-V\fR, \fB\-\-version\fR
.RS 4
Show version of program and exit\&. See below for caveats when run on older kernels\&.
.RE
.PP
\fB\-w\fR
.RS 4
Warn on duplicate dependencies, aliases, symbol versions, etc\&.
.RE
.SH "COPYRIGHT"
.PP
This manual page originally Copyright 2002, Rusty Russell, IBM Corporation\&. Portions Copyright Jon Masters, and others\&.
.SH "SEE ALSO"
.PP
\fBdepmod.d\fR(5),
\fBmodprobe\fR(8),
\fBmodules.dep\fR(5)
.SH "AUTHORS"
.PP
\fBJon Masters\fR <\&jcm@jonmasters\&.org\&>
.RS 4
Developer
.RE
.PP
\fBRobby Workman\fR <\&rworkman@slackware\&.com\&>
.RS 4
Developer
.RE
.PP
\fBLucas De Marchi\fR <\&lucas\&.de\&.marchi@gmail\&.com\&>
.RS 4
Developer
.RE
|