Building Kernel Modules With Module-Assistant On Debian Lenny - Page 2
On this page
3 Using Module-Assistant In Interactive Mode
Install module-assistant as follows:
aptitude install module-assistant
Before we start module-assistant in interactive mode, we should make sure that our /etc/apt/sources.list includes the contrib and non-free repositories because otherwise module-assistant might not be able to install required dependencies for the kernel module that we want to build:
vi /etc/apt/sources.list
      [...] deb http://ftp2.de.debian.org/debian/ lenny main contrib non-free deb-src http://ftp2.de.debian.org/debian/ lenny main contrib non-free deb http://security.debian.org/ lenny/updates main contrib non-free deb-src http://security.debian.org/ lenny/updates main contrib non-free [...]  | 
  
Run
aptitude update
if you had to modify /etc/apt/sources.list.
To start module-assistant in interactive mode, simply type:
m-a
You will see the following dialogue. We must make module-assistant download the headers of the current kernel, and some tools that are needed to build packages from source (such as build-essential, etc.). To do this, select PREPARE:
 
Now we update the list of available kernel modules by selecting UPDATE:

Afterwards, go to SELECT:

You will see the list of available kernel modules. Pick the one you want to build by pressing the SPACE bar (I select ndiswrapper in this example), and hit Ok:

Select BUILD on the next screen:

Select Yes to install/upgrade the selected source package:

Now the kernel module is being built:

After the build process is complete, select Yes if you want to install the module:

Alternatively, you can as well select INSTALL in this menu:

After you've installed the module, select BACK to go back to the list of available modules:

Select Cancel to leave the list and go back to the main menu:

In the main menu, choose EXIT to leave module-assistant:

Now that the module is installed, we can load it into our kernel as follows:
modprobe ndiswrapper
To check if it really got loaded, run:
lsmod | grep ndiswrapper
The output should be similar to this one:
server1:~# lsmod | grep ndiswrapper
  ndiswrapper           152348  0
  usbcore               118160  1 ndiswrapper
  server1:~#
To make sure that the module gets loaded automatically whenever you boot the system, you can add it to /etc/modules:
vi /etc/modules
      [...] ndiswrapper  | 
  
That's it!
4 Links
- Debian: http://www.debian.org/