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 themodules.depfile 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 resultingmodules.depfile, 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 runningdepmodagain 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/modulesprefix set at build time. this is useful when buildingmodules.depfile in basedir for a system that uses a different prefix, e.g./usr/lib/modulesvs/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 wheredepmodwill 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. seedepmod.d(5). -e,--errsymsโ when combined with the-Foption, 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. ๐ญ-EModule.symvers,--symvers=Module.symvers โ when combined with the-eoption, this reports any symbol versions supplied by modules that do not match with the symbol versions provided by the kernel in itsModule.symvers. this option is **mutually incompatible with-F. they cannot both come to the party. ๐ซ-FSystem.map,--filesyms=System.map โ supplied with theSystem.mapproduced when the kernel was built, this allows the-eoption 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 resultingmodules.depand 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,depmodwill 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.
๐ COPYRIGHT ๐
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