DEPMOD(8)

๐Ÿ’– DEPMOD โ€” the depmod(8) glow-up ๐Ÿ’–

okay bestie, sit down, hydrate, and get ready โ€” this is the manual page for depmod, aka the lil icon that builds your kernel module dependency map. it lives in section 8, which means it's a sysadmin-type tool. she's giving main character energy and she's lowkey essential. ๐ŸŽ€


โœจ 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 ๐Ÿฆ‹

so. Linux kernel modules can provide services โ€” we call them "symbols" โ€” for other modules to use, and they do that with one of the EXPORT_SYMBOL variants in the code. if a second module uses that symbol, then bestie, that second module clearly depends on the first one. it's a whole friendship web and honestly? the 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. check the options below to override when needed. she figures out what symbols each module exports and needs, then writes that list to modules.dep, plus 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). obsessed, honestly. ๐Ÿ’…

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 โ€” Probe all modules. this one is enabled by default if no file names are given in the command-line.
  • -A, --quick โ€” 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. queen of not doing unnecessary work, we stan. โœจ
  • *-b *basedir, --basedir=basedir โ€” Override the base directory <BASEDIR> where modules are located. if your modules are not currently in the (normal) directory /lib/modules/version, but in a staging area, you can specify a basedir which is prepended to the directory name. this basedir 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.

if a relative path is given, it's relative to the current working directory.

Example:

depmod -b /my/build/staging/dir/

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 โ€” Override the module directory <MODULEDIR>, which defaults to /lib/modules prefix set at build time. this is useful when building modules.dep file in basedir for a system that uses a different prefix, e.g. /usr/lib/modules vs /lib/modules.

relative and absolute paths are accepted, but they are always relative to the basedir.

Examples:

depmod -b /tmp/build -m /kernel-modules
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:

depmod -m foo/bar

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 โ€” Set the output directory where depmod will store any generated file. outdir serves as a root to that location, similar to how basedir is used. also this setting takes precedence and if used together with basedir it will result in the input being that directory, but the output being the one set by outdir. she said "my output, my rules". ๐Ÿ’…

if a relative path is given, it's relative to the current working directory.

Example:

depmod -o /my/build/staging/dir/

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 โ€” Override the default configuration files. see depmod.d(5).
  • -e, --errsyms โ€” when combined with the -F 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. not the vibe. ๐Ÿ˜ญ
  • -E Module.symvers, --symvers=Module.symvers โ€” when combined with the -e 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 -F. they cannot both come to the party. ๐Ÿšซ
  • -F System.map, --filesyms=System.map โ€” supplied with the System.map produced when the kernel was built, this allows the -e option to report unresolved symbols. this option is **mutually incompatible with -E. same rule, bestie. ๐Ÿšซ
  • -h, --help โ€” Print the help message and exit.
  • -n, --show, --dry-run โ€” sends the resulting modules.dep and the various map files to standard output rather than writing them into the module directory. peek but don't touch. ๐Ÿซถ
  • -P โ€” some architectures prefix symbols with an extraneous character. this specifies a prefix character (for example '_') to ignore.
  • -v, --verbose โ€” in verbose mode, depmod will print (to stdout) all the symbols each module depends on and the module's file name which provides that symbol. she'll tell you everything, she's an open book. ๐Ÿ“–โœจ
  • -V, --version โ€” Show version of program and exit. see below for caveats when run on older kernels.
  • -w โ€” Warn on duplicate dependencies, aliases, symbol versions, etc.

this manual page originally Copyright 2002, Rusty Russell, IBM Corporation. portions Copyright Jon Masters, and others. iconic lineage fr fr.


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

depmod.d(5), modprobe(8), modules.dep(5)


๐Ÿ’€ 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. give them the receipts bestie, they need all three. ๐ŸŽ€


๐Ÿซถ 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. shoutout to the maintainer, holding it down. ๐Ÿ™Œ


and that's the whole page, bestie! โœจ this one came from kmod, dated 2026-10-30, and yeah it's the DEPMOD(8) page โ€” you're all caught up, go forth and map those modules. ๐Ÿ’–๐ŸŒธ๐Ÿฆ‹๐Ÿ’…๐ŸŽ€

๐Ÿ“ฆ where this page comes from
  • arch rolling: kmod 34.3-1 ยท LGPL-2.1-or-later AND GPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms