• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version='1.0'?>
2<!--*-nxml-*-->
3<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5<refentry id="depmod">
6  <refentryinfo>
7    <title>depmod</title>
8    <productname>kmod</productname>
9
10    <authorgroup>
11      <author>
12        <contrib>Developer</contrib>
13        <firstname>Jon</firstname>
14        <surname>Masters</surname>
15        <email>jcm@jonmasters.org</email>
16      </author>
17      <author>
18        <contrib>Developer</contrib>
19        <firstname>Robby</firstname>
20        <surname>Workman</surname>
21        <email>rworkman@slackware.com</email>
22      </author>
23      <author>
24        <contrib>Developer</contrib>
25        <firstname>Lucas</firstname>
26        <surname>De Marchi</surname>
27        <email>lucas.de.marchi@gmail.com</email>
28      </author>
29    </authorgroup>
30  </refentryinfo>
31
32  <refmeta>
33    <refentrytitle>depmod</refentrytitle>
34    <manvolnum>8</manvolnum>
35  </refmeta>
36
37  <refnamediv>
38    <refname>depmod</refname>
39    <refpurpose>
40      Generate <filename>modules.dep</filename> and map files.
41    </refpurpose>
42  </refnamediv>
43
44  <refsynopsisdiv>
45    <cmdsynopsis>
46      <command>depmod</command>
47      <arg><option>-b <replaceable>basedir</replaceable></option></arg>
48      <arg><option>-e</option></arg>
49      <arg><option>-E <replaceable>Module.symvers</replaceable></option></arg>
50      <arg><option>-F <replaceable>System.map</replaceable></option></arg>
51      <arg><option>-n</option></arg>
52      <arg><option>-v</option></arg>
53      <arg><option>-A</option></arg>
54      <arg><option>-P <replaceable>prefix</replaceable></option></arg>
55      <arg><option>-w</option></arg>
56      <arg><option><replaceable>version</replaceable></option></arg>
57    </cmdsynopsis>
58
59    <cmdsynopsis>
60      <command>depmod</command>
61      <arg><option>-e</option></arg>
62      <arg><option>-E <replaceable>Module.symvers</replaceable></option></arg>
63      <arg><option>-F <replaceable>System.map</replaceable></option></arg>
64      <arg><option>-n</option></arg>
65      <arg><option>-v</option></arg>
66      <arg><option>-P <replaceable>prefix</replaceable></option></arg>
67      <arg><option>-w</option></arg>
68      <arg><option><replaceable>version</replaceable></option></arg>
69      <arg rep='repeat'><option><replaceable>filename</replaceable></option></arg>
70    </cmdsynopsis>
71  </refsynopsisdiv>
72
73  <refsect1><title>DESCRIPTION</title>
74    <para>
75      Linux kernel modules can provide services (called "symbols") for other
76      modules to use (using one of the EXPORT_SYMBOL variants in the code).  If
77      a second module uses this symbol, that second module clearly depends on
78      the first module.  These dependencies can get quite complex.
79    </para>
80    <para> <command>depmod</command> creates a list of module dependencies by
81      reading each module under
82      <filename>/lib/modules/</filename><replaceable>version</replaceable> and
83      determining what symbols it exports and what symbols it needs.  By
84      default, this list is written to <filename>modules.dep</filename>, and a
85      binary hashed version named <filename>modules.dep.bin</filename>, in the
86      same directory.  If filenames are given on the command line, only those
87      modules are examined (which is rarely useful unless all modules are
88      listed).  <command>depmod</command> also creates a list of symbols
89      provided by modules in the file named
90      <filename>modules.symbols</filename> and its binary hashed version,
91      <filename>modules.symbols.bin</filename>.  Finally,
92      <command>depmod</command> will output a file named
93      <filename>modules.devname</filename> if modules supply special device
94      names (devname) that should be populated in /dev on boot (by a utility
95      such as systemd-tmpfiles).
96    </para>
97    <para> If a <replaceable>version</replaceable> is provided, then that kernel
98      version's module directory is used rather than the current kernel version
99      (as returned by <command>uname -r</command>).
100    </para>
101  </refsect1>
102  <refsect1><title>OPTIONS</title>
103    <variablelist>
104      <varlistentry>
105        <term>
106          <option>-a</option>
107        </term>
108        <term>
109          <option>--all</option>
110        </term>
111        <listitem>
112          <para>
113            Probe all modules. This option is enabled by default if no
114            file names are given in the command-line.
115          </para>
116        </listitem>
117      </varlistentry>
118      <varlistentry>
119        <term>
120          <option>-A</option>
121        </term>
122        <term>
123          <option>--quick</option>
124        </term>
125        <listitem>
126          <para>
127            This option scans to see if any modules are newer than the
128            <filename>modules.dep</filename> file before any work is done:
129            if not, it silently exits rather than regenerating the files.
130          </para>
131        </listitem>
132      </varlistentry>
133      <varlistentry>
134        <term>
135          <option>-b <replaceable>basedir</replaceable></option>
136        </term>
137        <term>
138          <option>--basedir <replaceable>basedir</replaceable></option>
139        </term>
140        <listitem>
141          <para>
142            If your modules are not currently in the (normal) directory
143            <filename>/lib/modules/</filename><replaceable>version</replaceable>,
144            but in a staging area, you can specify a
145            <replaceable>basedir</replaceable> which is prepended to the
146            directory name.  This <replaceable>basedir</replaceable> is
147            stripped from the resulting <filename>modules.dep</filename> file,
148            so it is ready to be moved into the normal location. Use this
149            option if you are a distribution vendor who needs to pre-generate
150            the meta-data files rather than running depmod again later.
151          </para>
152        </listitem>
153      </varlistentry>
154      <varlistentry>
155        <term>
156          <option>-C</option>
157        </term>
158        <term>
159          <option>--config <replaceable>file or directory</replaceable></option>
160        </term>
161        <listitem>
162          <para>
163            This option overrides the default configuration directory at
164            <filename>/etc/depmod.d/</filename>.
165          </para>
166        </listitem>
167      </varlistentry>
168      <varlistentry>
169        <term>
170          <option>-e</option>
171        </term>
172        <term>
173          <option>--errsyms</option>
174        </term>
175        <listitem>
176          <para>
177            When combined with the <option>-F</option> option, this reports any
178            symbols which a module needs which are not supplied by other
179            modules or the kernel.  Normally, any symbols not provided by
180            modules are assumed to be provided by the kernel (which should be
181            true in a perfect world), but this assumption can break especially
182            when additionally updated third party drivers are not correctly
183            installed or were built incorrectly.
184          </para>
185        </listitem>
186      </varlistentry>
187      <varlistentry>
188        <term>
189          <option>-E</option>
190        </term>
191        <term>
192          <option>--symvers</option>
193        </term>
194          <listitem>
195            <para>
196              When combined with the <option>-e</option> option, this
197              reports any symbol versions supplied by modules that do
198              not match with the symbol versions provided by the
199              kernel in its <filename>Module.symvers</filename>.
200              This option is mutually incompatible with <option>-F</option>.
201            </para>
202          </listitem>
203      </varlistentry>
204      <varlistentry>
205        <term>
206          <option>-F</option>
207        </term>
208        <term>
209          <option>--filesyms <replaceable>System.map</replaceable></option>
210        </term>
211        <listitem>
212          <para>
213            Supplied with the <filename>System.map</filename> produced when the
214            kernel was built, this allows the <option>-e</option> option to
215            report unresolved symbols.  This option is mutually incompatible
216            with <option>-E</option>.
217          </para>
218        </listitem>
219      </varlistentry>
220      <varlistentry>
221        <term>
222          <option>-h</option>
223        </term>
224        <term>
225          <option>--help</option>
226        </term>
227        <listitem>
228          <para>
229            Print the help message and exit.
230          </para>
231        </listitem>
232      </varlistentry>
233      <varlistentry>
234        <term>
235          <option>-n</option>
236        </term>
237        <term>
238          <option>--show</option>
239        </term>
240        <term>
241          <option>--dry-run</option>
242        </term>
243        <listitem>
244          <para>
245            This sends the resulting modules.dep and the various map files to
246            standard output rather than writing them into the module directory.
247          </para>
248        </listitem>
249      </varlistentry>
250      <varlistentry>
251        <term>
252          <option>-P</option>
253        </term>
254        <listitem>
255          <para>
256            Some architectures prefix symbols with an extraneous character.
257            This specifies a prefix character (for example '_') to ignore.
258          </para>
259        </listitem>
260      </varlistentry>
261      <varlistentry>
262        <term>
263          <option>-v</option>
264        </term>
265        <term>
266          <option>--verbose</option>
267        </term>
268        <listitem>
269          <para>
270            In verbose mode, <command>depmod</command> will print (to stdout)
271            all the symbols each module depends on and the module's file name
272            which provides that symbol.
273          </para>
274        </listitem>
275      </varlistentry>
276      <varlistentry>
277        <term>
278          <option>-V</option>
279        </term>
280        <term>
281          <option>--version</option>
282        </term>
283        <listitem>
284          <para>
285            Show version of program and exit. See below for caveats when
286            run on older kernels.
287          </para>
288        </listitem>
289      </varlistentry>
290      <varlistentry>
291        <term>
292          <option>-w</option>
293        </term>
294        <listitem>
295          <para>
296            Warn on duplicate dependencies, aliases, symbol versions, etc.
297          </para>
298        </listitem>
299      </varlistentry>
300    </variablelist>
301  </refsect1>
302
303  <refsect1><title>COPYRIGHT</title>
304    <para>
305      This manual page originally Copyright 2002, Rusty Russell,
306      IBM Corporation. Portions Copyright Jon Masters, and others.
307    </para>
308  </refsect1>
309
310  <refsect1><title>SEE ALSO</title>
311    <para>
312      <citerefentry>
313        <refentrytitle>depmod.d</refentrytitle><manvolnum>5</manvolnum>
314      </citerefentry>,
315      <citerefentry>
316        <refentrytitle>modprobe</refentrytitle><manvolnum>8</manvolnum>
317      </citerefentry>,
318      <citerefentry>
319        <refentrytitle>modules.dep</refentrytitle><manvolnum>5</manvolnum>
320      </citerefentry>
321    </para>
322  </refsect1>
323</refentry>
324