This document was created by man2html using the manual pages.
Section: Linux Module Support (8)
Updated: January 26, 2002
Return to NetAdminTools
depmod - handle dependency descriptions for loadable kernel modules
[-C configfile] [-F kernelsyms] [-b basedirectory]
depmod [-enqrsuv] [-F kernelsyms] module1.o module2.o ...
utilities are intended
to make a Linux modular kernel manageable for all users,
administrators and distribution maintainers.
creates a "Makefile"-like dependency file, based on the symbols it finds
in the set of modules mentioned on the command line
or from the directories specified in the configuration file.
This dependency file is later used by
to automatically load the correct module or stack of modules.
The normal use of
is to include the line
somewhere in the rc-files
so that the correct module dependencies will be available
immediately after booting the system.
Note that the option
is now optional.
For boot-up purposes, the option
might be more appropriate since that makes depmod silent about
It is also possible to create the dependency file immediately
after compiling a new kernel.
If you do "depmod -a 2.2.99"
when you have compiled kernel 2.2.99 and
its modules the first time, while still running e.g. 2.2.98, the file will
be created in the correct place.
In this case however,
the dependencies on the kernel will not be guaranteed to be correct.
See the options
-F, -C and -b
above for more information on handling this.
While building the relationship between modules and the symbols
exported by other modules,
does not consider the GPL status of the modules nor of the exported
symbols. That is, depmod will not flag an error if a module without a
GPL compatible license refers to a GPL only symbol (EXPORT_SYMBOL_GPL
in the kernel). However insmod will refuse to resolve GPL only symbols
for non-GPL modules so the actual load will fail.
- -a, --all
Search for modules in all directories specified in the (optional)
- -A, --quick
Compare file timestamps and, if necessary, act like
This option only updates the dependency file if anything has changed.
- -e, --errsyms
Show all the unresolved symbols for each module.
- -h, --help
Display a summary of options and immediately exit.
- -n, --show
Write the dependency file on stdout instead of in the /lib/modules tree.
- -q, --quiet
Tell depmod to keep quiet and not to complain about missing symbols.
- -r, --root
Some users compile modules under a non-root userid then install the
modules as root. This process can leave the modules owned by the
non-root userid, even though the modules directory is owned by root.
If the non-root userid is compromised, an intruder can overwrite
existing modules owned by that userid and use this exposure to
bootstrap up to root access.
By default, modutils will reject attempts to use a module that is not
owned by root. Specifying -r will suppress the error and allow root to
load modules that are not owned by root.
Use of -r is a major security exposure and is not recommended.
- -s, --syslog
Write all error messages via the syslog daemon instead of stderr.
- -u, --unresolved-error
depmod 2.4 does not set a return code when there are any unresolved
symbols. The next major release of modutils (2.5) will set a return
code for unresolved symbols. Some distributions want a non-zero return
code in modutils 2.4 but that change might cause problems for users who
expect the old behaviour. If you want a non-zero return code in depmod
2.4, specify -u. depmod 2.5 will silently ignore the
-u flag and will always give a non-zero return code for unresolved
- -v, --verbose
Show the name of each module as it is being processed.
- -V, --version
Display the version of depmod.
The following options are useful for people managing distributions:
- -b basedirectory, --basedir basedirectory
If the directory tree
containing the sub-trees of modules is moved somewhere else in order to
handle modules for a different environment, the
option tells depmod where to find the moved image of the
The file references in the depmod output file that is built,
will not contain the
This means that when the file tree is moved back from
in the final distribution, all references will be correct.
- -C configfile, --config configfile
Use the file
The environment variable
can also be used to select a different
configuration file from the default
- When environment variable
is set, modutils will use its value instead of the machine field from
the uname() syscall.
This is mainly of use when you are compiling 64 bit modules in 32 bit
user space or vice versa, set
to the type of the modules being built.
Current modutils does not support full cross build mode for modules, it
is limited to choosing between 32 and 64 bit versions of the host
- -F kernelsyms,--filesyms kernelsyms
When building dependency files for a different kernel than the currently
running kernel, it is important that
uses the correct set of kernel symbols to resolve the kernel references
in each module.
These symbols can either be a copy of
from the other kernel,
or a copy of the output from
If your kernel uses versioned symbols, it is best to
use a copy of the
output, since that file contains the symbol versions of the kernel
symbols. However you can use a
even with versioned symbols.
The behavior of
can be adjusted by the (optional) configuration file
for a complete description.
Each time you compile a new kernel, the command "make modules_install"
will create a new directory, but won't change the default.
When you get a module unrelated to the kernel distribution
you should place it in one of the version-independent directories
This is the default strategy, which can be overridden in
/etc/modules.conf (alternatively but deprecated /etc/conf.modules)
modules.conf(5), modprobe(8), modinfo(8),
depmod [ -V | --version ] should exit immediately. Instead, it
prints the version information and behaves as if no options were given.
Jacques Gelinas (email@example.com)
Bjorn Ekwall (firstname.lastname@example.org)
- SEE ALSO
Return to NetAdminTools,