DEPMOD(8) | depmod | DEPMOD(8) |
NAME¶
depmod - Generate modules.dep and map files.
SYNOPSIS¶
depmod [-b basedir]
[-m moduledir] [-o outdir]
[-e] [-E Module.symvers]
[-F System.map] [-n] [-v] [-A]
[-P prefix] [-w] [version]
depmod [-e] [-E Module.symvers]
[-F System.map] [-n] [-v] [-P
prefix]
[-w] [version] [filename...]
DESCRIPTION¶
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.
depmod creates a list of module dependencies by reading each module under <BASEDIR>/<MODULEDIR>/version. By default <MODULEDIR> is /lib/modules and <BASEDIR> is empty. See options below to override when needed. It determines what symbols each module exports and needs. 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). depmod also creates a list of symbols provided by modules in the file named modules.symbols and its binary hashed version, modules.symbols.bin. Finally, depmod 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).
If a version is provided, then that kernel version's module directory is used rather than the current kernel version (as returned by uname -r).
OPTIONS¶
-a, --all
-A, --quick
-b basedir, --basedir=basedir
If a relative path is given, it's relative to the current working directory.
Example:
This expects all input files under /my/build/staging/dir/lib/modules/$(uname -r) and generates index files under that same directory.
-m moduledir, --moduledir=moduledir
Relative and absolute paths are accepted, but they are always relative to the basedir.
Examples:
depmod -b /tmp/build -m kernel-modules
This expects all input files under /tmp/build/kernel-modules/$(uname -r) and generates index files under that same directory.
Without an accompanying -b argument, the moduledir is relative to /. Example:
This expects all input files under /foo/bar/$(uname -r) and generates index files under the same directory. Unless libkmod is prepared to handle that arbitrary location, it won't work in runtime.
-o outdir, --outdir=outdir
If a relative path is given, it's relative to the current working directory.
Example:
This expects all input files under /lib/modules/$(uname -r) and generates index files under /my/build/staging/dir/lib/modules/$(uname -r).
-C file or directory, --config=file or directory
-e, --errsyms
-E Module.symvers, --symvers=Module.symvers
-F System.map, --filesyms=System.map
-h, --help
-n, --show, --dry-run
-P
-v, --verbose
-V, --version
-w
COPYRIGHT¶
This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. Portions Copyright Jon Masters, and others.
SEE ALSO¶
BUGS¶
Please direct any bug reports to kmod's issue tracker at https://github.com/kmod-project/kmod/issues/ alongside with version used, steps to reproduce the problem and the expected outcome.
AUTHORS¶
Numerous contributions have come from the linux-modules mailing list <linux-modules@vger.kernel.org> and Github. If you have a clone of kmod.git itself, the output of git-shortlog(1) and git-blame(1) can show you the authors for specific parts of the project.
Lucas De Marchi <lucas.de.marchi@gmail.com> is the current maintainer of the project.
2025-03-30 | kmod |