MODULE-ASSISTANT(8)
πΈ NAME πΈ
so the page you're reading is MODULE-ASSISTANT(8), and the star of the show is module-assistant β it manages kernel modules packages β¨ bestie this tool is everything if you've ever needed to build a kernel module, no cap.
π SYNOPSIS π
module-assistant [ -fihnqstv ] [ -k source/headers directory ] [ -l kernel versions ] { update | search | prepare | auto-install | list | list-available | list-installed | auto-unpacked | get | unpack | build | install | clean | purge | fakesource } [ pkg ... ]
m-a ...
π DESCRIPTION π
module-assistant is THE command-line tool for handling module-source packages that have been prepared for the Debian distribution. it literally helps users build and install module package(s) easily for one or more custom kernels π«Ά
unless the -h or --help option is given, one of the commands below should be present to invoke a function explicitly. and if no (or no valid) command is specified, and the dialog tool is available, a simple graphical user interface will pop up and guide you through the available functionality. cute, right? π
β οΈ NOTE: don't even think about using some randomlinux-source-x.y.zpackage contents (or alinux-x.y.ztarball from the Internet) to specify the kernel source for your currently running kernel. Don't! π those source is not exactly what have been used to build the running kernel and its configuration most likely does not match yours. you need the configured kernel source directory or at least the derivedlinux-headers-...package containing the kernel configuration for the exact kernel version (complete version string). if you do not understand anything of the above, run"m-a prepare"and/or look at the description and contents of somelinux-headers-...package. please run themodule-assistant preparecommand once before you do anything else. periodt. β¨
for some packages, linux-headers (reduced source) is not enough. you will have the choice to run a completely customized kernel, or to recreate the source that have been used to build the current one. the fakesource function may be useful, see below π
in order to configure a kernel source properly, you need to make sure that the file version.h is generated. to get it, configure the options as usual (make menuconfig etc.) and run make dep (for kernel 2.4.x) or make prepare (for newer ones). iykyk π
π¦ COMMANDS π¦
most commands require a specification of the package names that they should be applied on. pkg can be a single word (package name) or multiple names. the word all will be expanded to the list of all available packages, the word alli to the list of currently installed (source) packages, and the word allu will be expanded to the list of packages that seem to be installed and unpacked in the base source directory π if a source package with the given name is not available, module-assistant (abbreviated: m-a) will extend the package name with the popular suffixes like -kernel, -driver, -module, -source and combinations of them π
multiple commands can be specified in one invocation, e.g.:
m-a clean,get,build arla cdfs
which is the short way to write:
module-assistant clean arla-modules-source ; module-assistant clean cdfs-src ; module-assistant get arla-modules-source cdfs-src ; module-assistant build arla-modules-source cdfs-src
(or similar) π
if you do not like the dialog/whiptail GUI, feel free to use the -t switch to disable it π
update
update is used to resynchronize the version index files from their sources. this happens with helper scripts provided by the packages. module-assistant has a default built-in list of the packages that it should look for, but other packages can be registered by module-assistant if the maintainer adds the helper script β¨
prepare
tries to determine the name of the required linux-headers package (either the one matching the currently running kernel or for the versions specified with -l), installs it if needed and creates the /usr/src/linux symlink if needed. also installs the build-essential package to ensure that a sane compiler environment is established π₯
fakesource
experimental function which tries to determine the name of the required/compatible linux-source package, installs it, modifies the Makefile to look like the original source and runs configuration routines as needed.
π Warning: DO NOT RELY ON THE RESULTING SOURCE. it may be very different from the original version.
list | list-available | la
list-available (abbreviated with la) presents a list of details about specified packages, including installed version, installable versions and recently built binary packages. if the package names are omitted, shows all known packages. with -v, prints long package paths π
list-installed | li
synonym to list alli. acts like list-available but limits the list to the installed source packages π
search
synonym to list -s. looks for locally compiled packages first and (if none found) searches for alternative installation candidates with apt-cache π
get
get followed by the package list installs the package source, downloading source packages when needed π₯
unpack
unpack is followed by one or more previously-installed source packages that should be extracted from their source tarballs into build directories π§
build
build is followed by one or more source packages that should be built. it chooses the kernel source appropriate for the currently running kernel unless different directories have been specified. if the build fails, look for the most recent log file in /var/cache/modass (or the user-specified location) π
install
install is followed by one or more packages desired for installation. the last built package for the current running kernel is chosen β¨
auto-install | a-i
auto-install is followed by one or more packages desired for installation. it will run prepare to configure your system to build packages, get the package source, try to build it for the current kernel and install it. you can use alli or allu shortcuts to select all installed modules source packages or only those that have been unpacked before (similar to the make-kpkg tool normally does, looking in $MODULE_LOC) π
auto-build | a-b
like auto-install but does not install the package immediately π
clean
clean clears the build directories of the kernel packages π§Ή
purge
purge clears the information cache of a source package and removes all binary packages locally built from it (that module-assistant knows about).
π¨ USE WITH CARE!
β¨ OPTIONS β¨
-t,--text-modeβ show pure build/install/update logs, no progress bars π-k,--kernel-dirβ the kernel source directories to be used for builds. you can specify multiple directories with multiple options or separated by commas or line separators, e.g.:
-k "`echo /usr/src/linux-headers-*`"
the kernel versions detected in these directories are automatically added to the list of target kernel versions (see --kvers-list for details) π
-l,--kvers-listβ list of kernel version strings (as inKVERS) to act on. if omitted, the version string of the currently running kernel is inserted. if--kernel-dirspecifies additional source directories, the kernel versions that belong to them will be inserted too.
the locations of the kernel source (or headers) that belong to this kernel versions are either detected by a lookup in the "usual" locations on Linux systems, or they must be specified with the --kernel-dir option π¦
-v,--verboseβ shows a bit more information, like full paths of the binary packages π-n,--no-rebuildβ if a package that is to be generated does already exist in the target directory (maybe in on older version),-nprevents from building the package again.
the default behaviour is to skip when exactly the same file (with the same filename) is to be generated as the one that already exists, and the new filename could be detected before starting the build process (depends on the module package) π
-f,--forceβ never look for target file (in another version) and force a build. for thegetcommand, download a newer version of a package even if it is already installed πͺ-u,--userdirβ all relevant environment variables with paths will be redirected to new directories under the one specified with this option π-i,--non-interβ when the package build was not successful, just continue with other candidates. by default,module-assistantwill suggest to examine the build log. this option may also modify the behaviour ofdpkgandapt-getto reduce the need for human interaction and install build dependencies as needed π€-o,--unpack-onceβ try to not unpack twice. the option needs to be also specified when the package is being unpacked for the first time.
π§ͺ experimental option, don't rely on it.
-O,--not-unpackβ never unpack the source tarball. useful after manual manipulation of module source π-q,--quietβ suppress some of the noisy messages during the processing π€«-S,--sudo-cmdβ a replacement command for superuser commands to be used instead ofsudoπ-s,--apt-searchβ seesearchcommand for details π-h,--helpβ prints the usage overview π
πΈ ENVIRONMENT VARIABLES πΈ
ok so bestie, you can export these little guys to change how the build scripts act π but lowkey, heads up: some packages are gonna straight-up ignore them or interpret them in their own lil way π every package is a different girl, yk?
KPKG_DEST_DIRβ this one tells everyone where the finished Debian package should get installed. BUT β so many packages ignore it and just dump the files into the directory above the kernel source dir, or above the current directory instead. iconic behaviour honestly πKERNELDIRSβ sets or extends the list of kernel source/header directories that m-a should build modules for π§ check the-koption for the deets.SIGNCHANGESβ if this is set,.changesfiles get generated (it calls thekdist_imagerule instead ofkdist) and thendebsign(orgpg, orpgp) runs to sign those changes β¨ very official of you.KMAINT|DEBFULLNAME|DEBNAMEβ the realname of whoever's building the package π«Ά (only matters for the.changesfile, so it's giving main-character credits energy).KEMAIL|DEBEMAILβ the email address of whoever's building the package π (again, only interesting for the.changesfile).MODULE_LOCβ a whole different location for the already-extracted module source directories π default is/usr/src/modules.MA_VARDIRβ a different spot for cached data, used by the helper scripts frommodule-assistantπ default is/var/cache/modass.MA_APTCMDβ the command to download and install packages, used instead ofapt-getπMOD_SRCDIRβ a different location for module source tarballs π default is/usr/src.ROOT_CMDβ a wrapper command to execute stuff as root π₯ if you're not root,fakerootgets chosen automatically. this variable has to be interpreted by individual packages, so some of them will just ignore it π BUT you can still runmodule-assistantfrom inside theROOT_CMDwrapper, so likeβ¦ slay.
π NON-ROOT USAGE π
okay so the tea β β module-assistant can work without being root. no cap. BUT:
- you can't use
apt-getordpkgto install packages π - you can't write to
/var/cache/modasson a normal Debian system
so basically the get, install, auto-install and prepare commands are taboo for regular users π«β¨
BUT WAIT π«Ά ifsudois installed, it'll get invoked for theapt-getanddpkgoperations. problem solved, bestie.
all the remaining commands β except list β need extra environment variables so the target paths move to places the user can actually write to π§ and you can trim them all down to one specific location (a writable directory) with the -u switch π
π FILES π
/usr/share/modass/packages/*β the list of helper scripts shipped right inside themodule-assistantpackage π¦/usr/share/modass/overrides/*β helper scripts that get installed by other packages π
π SEE ALSO π
make-kpkg(1), /usr/share/doc/module-assistant/README
π BUGS π
go look at the module-assistant bug page β <URL:http://bugs.debian.org/src:module-assistant> π
and if you actually wanna report a bug in module-assistant, pls use the reportbug(1) command, okay? don't just yell into the void π
π’ RETURN CODES π’
0β success π we ate.1..249β various errors during the build process π it's giving chaos.254β problem with permissions π255β fixable error after user intervention π οΈ
β¨ TODO β¨
the dream list, bestie:
- Quicklist (fast output without details) β‘
- Integration into APT and/or into the init system π
- "Aggressive" debianisation using the templates set (to generate a package with guessed name from any source that looks like being compatible with kernel 2.6 build system) π
- Automatic transformation of kernel sources to generate
.udebpackages π¦
π AUTHOR π
Module-Assistant was written by Eduard Bloch <blade@debian.org> for the Debian distribution π absolute legend behaviour, fr fr.
and that's the whole page babes π«Ά this gem is from the module-assistant manual, dated 06 September 2003, filed under MODULE-ASSISTANT(8) β yes she's been iconic since 2003 and she's still serving π
β¨ go build some modules, you got this π
π¦ where this page comes from
- debian trixie: module-assistant 0.11.14 Β· GPL-2.0-or-later
- ubuntu questing: module-assistant 0.11.14
- ubuntu resolute: module-assistant 0.11.14build1 Β· GPL-2.0-or-later
- ubuntu stonking: module-assistant 0.11.14+nmu1 Β· 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