Translation(s): English - Fran├žais - Italiano


module-assistant is an extremely powerful, but underdocumented tool to build Debian kernel modules. Module assistant aims to facilitate the process of building kernel modules from source. It uses source code from apt repositories and produces binary .deb packages.

This page is intended demonstrate how to use it.

Using Module-Assistant

module-assistant (often abbreviated as m-a) can be used in command line or in interactive mode.

m-a__prepare.png
module assistant's command-line mode

m-a__interactive.png
module-assistant interactive mode

To keep it simple, we run all the commands as root, so open a terminal as root

Step 1 : Installing m-a

First we need to install module-assistant (you can re-run that command if you aren't sure).

apt-get install module-assistant

Then we get module-assistant to download the headers corresponding to the current kernel, and other 'build-essential' tools... simply run :

m-a prepare

Step 2 : Update the list of modules

That's as easy as running

m-a update

Step 3 : Build and Install the module

Finally, assuming you want the "ndiswrapper" module, simply run :

m-a a-i ndiswrapper

The "a-i" stands for "auto-install" which means "download the module source, compile it for the current kernel and install it".

Interactive mode

If you don't like typing commands, you can run module-assistant in interactive mode. simply type :

m-a

This will take you to a menu with the options: Overview, Update, Prepare, Select and Exit. Prepare will configure and install any packages you need in order to compile kernel modules (e.g. kernel headers, gcc, etc). The Select menu takes you to a screen where you can select which modules you want to compile.

m-a__interactive1.png

Select the modules using the arrow keys and the space bar. Press return when you are done.

m-a__interactive2.png

This will take you to the final menu where you will be given options to build and install the modules. Note: You can use Synaptic to remove any modules you have installed.

m-a__interactive3.png

FAQ

Where can i find more help ?

reading the manpage is a good start (run man module-assistant), some other documentation are available in /usr/share/doc/module-assistant/.

An installed module package does not show up in "m-a list"

This might be caused by the module package not creating or containing a control script in /usr/share/modass/packages. After creating one there (possibly by linking default.sh or generic.sh), m-a update needs to be called for the change to show up in m-a list.

How can i get a list of available package ?

use  m-a -t list | grep -E '^[^ ].*\(' | cut -d " " -f 1 | sort
If you want the package description, use:

for x in $( m-a -t list | grep -E '^[^ ].*\(' | cut -d " " -f 1 | sort ) ; do  echo Package: $x ; (apt-cache show $x  | grep -E '^(Description|Package| )' ) 2>&1  ; echo  ; done | uniq  > /tmp/m-a