.\" Generated by scdoc 1.11.3 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "DEPMOD" "8" "2025-03-28" "kmod" "depmod" .PP .SH NAME .PP depmod - Generate modules.\&dep and map files.\& .PP .SH SYNOPSIS .PP \fBdepmod\fR [\fB-b\fR \fIbasedir\fR] [\fB-m\fR \fImoduledir\fR] [\fB-o\fR \fIoutdir\fR] [\fB-e\fR] [\fB-E\fR \fIModule.\&symvers\fR] [\fB-F\fR \fISystem.\&map\fR] [\fB-n\fR] [\fB-v\fR] [\fB-A\fR] [\fB-P\fR \fIprefix\fR] [\fB-w\fR] [\fIversion\fR] .PP \fBdepmod\fR [\fB-e\fR] [\fB-E\fR \fIModule.\&symvers\fR] [\fB-F\fR \fISystem.\&map\fR] [\fB-n\fR] [\fB-v\fR] [\fB-P\fR \fIprefix\fR] [\fB-w\fR] [\fIversion\fR] [\fIfilename\fR.\&.\&.\&] .PP .SH DESCRIPTION .PP 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.\& .PP \fBdepmod\fR creates a list of module dependencies by reading each module under //\fIversion\fR.\& By default is /lib/modules and is empty.\& See options below to override when needed.\& It determines what symbols each module exports and needs.\& This list is written to \fBmodules.\&dep\fR, 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).\& \fBdepmod\fR also creates a list of symbols provided by modules in the file named modules.\&symbols and its binary hashed version, modules.\&symbols.\&bin.\& Finally, \fBdepmod\fR 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).\& .PP If a \fIversion\fR is provided, then that kernel version'\&s module directory is used rather than the current kernel version (as returned by \fBuname -r\fR).\& .PP .SH OPTIONS .PP \fB-a\fR, \fB--all\fR .RS 4 Probe all modules.\& This option is enabled by default if no file names are given in the command-line.\& .PP .RE \fB-A\fR, \fB--quick\fR .RS 4 This option scans to see if any modules are newer than the \fBmodules.\&dep\fR file before any work is done: if not, it silently exits rather than regenerating the files.\& .PP .RE \fB-b\fR \fIbasedir\fR, \fB--basedir\fR=\fIbasedir\fR .RS 4 Override the base directory where modules are located.\& If your modules are not currently in the (normal) directory /lib/modules/\fIversion\fR, but in a staging area, you can specify a \fIbasedir\fR which is prepended to the directory name.\& This \fIbasedir\fR is stripped from the resulting \fBmodules.\&dep\fR 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 \fBdepmod\fR again later.\& .PP If a relative path is given, it'\&s relative to the current working directory.\& .PP Example: .RS 4 depmod -b /my/build/staging/dir/ .PP .RE This expects all input files under \fI/my/build/staging/dir/lib/modules/$(uname -r)\fR and generates index files under that same directory.\& .PP .RE \fB-m\fR \fImoduledir\fR, \fB--moduledir\fR=\fImoduledir\fR .RS 4 Override the module directory , which defaults to /lib/modules prefix set at build time.\& This is useful when building \fBmodules.\&dep\fR file in \fIbasedir\fR for a system that uses a different prefix, e.\&g.\& \fI/usr/lib/modules\fR vs \fI/lib/modules\fR.\& .PP Relative and absolute paths are accepted, but they are always relative to the \fIbasedir\fR.\& .PP Examples: .RS 4 depmod -b /tmp/build -m /kernel-modules .br depmod -b /tmp/build -m kernel-modules .PP .RE This expects all input files under \fI/tmp/build/kernel-modules/$(uname -r)\fR and generates index files under that same directory.\& .PP Without an accompanying \fB-b\fR argument, the moduledir is relative to \fI/\fR.\& Example: .PP .RS 4 depmod -m foo/bar .PP .RE This expects all input files under \fI/foo/bar/$(uname -r)\fR and generates index files under the same directory.\& Unless libkmod is prepared to handle that arbitrary location, it won'\&t work in runtime.\& .PP .PP .RE \fB-o\fR \fIoutdir\fR, \fB--outdir\fR=\fIoutdir\fR .RS 4 Set the output directory where \fBdepmod\fR will store any generated file.\& \fIoutdir\fR serves as a root to that location, similar to how \fIbasedir\fR is used.\& Also this setting takes precedence and if used together with \fIbasedir\fR it will result in the input being that directory, but the output being the one set by \fIoutdir\fR.\& .PP If a relative path is given, it'\&s relative to the current working directory.\& .PP Example: .RS 4 depmod -o /my/build/staging/dir/ .PP .RE This expects all input files under \fI/lib/modules/$(uname -r)\fR and generates index files under \fI/my/build/staging/dir/lib/modules/$(uname -r)\fR.\& .PP .RE \fB-C\fR \fIfile\fR \fIor\fR \fIdirectory\fR, \fB--config\fR=\fIfile\fR \fIor\fR \fIdirectory\fR .RS 4 This option overrides the default configuration files.\& See \fBdepmod.\&d\fR(5).\& .PP .RE \fB-e\fR, \fB--errsyms\fR .RS 4 When combined with the \fB-F\fR 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.\& .PP .RE \fB-E\fR \fIModule.\&symvers\fR, \fB--symvers\fR=\fIModule.\&symvers\fR .RS 4 When combined with the \fB-e\fR option, this reports any symbol versions supplied by modules that do not match with the symbol versions provided by the kernel in its \fIModule.\&symvers\fR.\& This option is mutually incompatible with \fB-F\fR.\& .PP .RE \fB-F\fR \fISystem.\&map\fR, \fB--filesyms\fR=\fISystem.\&map\fR .RS 4 Supplied with the \fISystem.\&map\fR produced when the kernel was built, this allows the \fB-e\fR option to report unresolved symbols.\& This option is mutually incompatible with \fB-E\fR.\& .PP .RE \fB-h\fR, \fB--help\fR .RS 4 Print the help message and exit.\& .PP .RE \fB-n\fR, \fB--show\fR, \fB--dry-run\fR .RS 4 This sends the resulting \fBmodules.\&dep\fR and the various map files to standard output rather than writing them into the module directory.\& .PP .RE \fB-P\fR .RS 4 Some architectures prefix symbols with an extraneous character.\& This specifies a prefix character (for example '\&_'\&) to ignore.\& .PP .RE \fB-v\fR, \fB--verbose\fR .RS 4 In verbose mode, \fBdepmod\fR will print (to stdout) all the symbols each module depends on and the module'\&s file name which provides that symbol.\& .PP .RE \fB-V\fR, \fB--version\fR .RS 4 Show version of program and exit.\& See below for caveats when run on older kernels.\& .PP .RE \fB-w\fR .RS 4 Warn on duplicate dependencies, aliases, symbol versions, etc.\& .PP .RE .SH COPYRIGHT .PP This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.\& Portions Copyright Jon Masters, and others.\& .PP .SH SEE ALSO .PP \fBdepmod.\&d\fR(5), \fBmodprobe\fR(8), \fBmodules.\&dep\fR(5) .PP .SH BUGS .PP 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.\& .PP .SH AUTHORS .PP Numerous contributions have come from the linux-modules mailing list and Github.\& If you have a clone of kmod.\&git itself, the output of \fBgit-shortlog\fR(1) and \fBgit-blame\fR(1) can show you the authors for specific parts of the project.\& .PP \fBLucas De Marchi\fR is the current maintainer of the project.\&