Phil's Debian Kernel Howto

Build the kernel

Building a kernel as a debian package is very easy, and very similar to the standard source build.
  1. If using nvidia, install the nvidia-kernel-source, and untar the file it leaves in /usr/src
  2. Get base config from last kernel
    $ cd $KERNELSOURCE # Replace this with your kernel source dir
    $ cp /boot/config-`uname -r` .config
    $ make oldconfig
  3. Check config
    $ make menuconfig
  4. Build the kernel. From the kernel source directory, do:
    $ make-kpkg --rootcmd fakeroot --append-to-version `hostname` -rev phil.1 kernel-image modules-image
    Or, for SMP:
    $ make-kpkg --rootcmd fakeroot --append-to-version `hostname`-smp -rev phil.1 kernel-image modules-image
           # Note here I want to keep mulitple systems with different kernels but similar
           # version numbers under apt control, so I decided I want the kernel to be 
           # called "2.6.6rider" and the version to be "phil.1" where "rider" is a
           # machine name.

Install the Kenrel

You've now built the kernel, and any supported 3rd-party modules. You can now install these now.
  1. Install the debs
    $ cd ..; sudo dpkg -i kernel-image-2.6.6`hostname`_phil.1_i386.deb nvidia-kernel-2.6.6`hostname`_1.0.5336-9+phil.1_i386.deb
  2. Modify lilo.conf, and then run lilo:
    $ sudo lilo
  3. Reboot

Build newer 3rd-party modules

Now, if a newer nvidia-kernel-source package comes out, rather than go through this process, there's a simpler way to build it: use the module-assistant package:
  1. module-assistant auto-install nvidia
That will extract, build, and install the new nvidia drivers for you as a debian package. You only need to rmmod/modprobe to get the new driver loaded.

The old way...

This is how I used to build my kernels. It's cludgy, more steps, and doens't provided package management.
  1. Get a base config from last kernel
    $ make oldconfig
  2. Check config
    $ make menuconfig
  3. Compile
    $ make
  4. Install
    $ sudo make install
  5. Install modules
    $ sudo make modules_install
  6. Modify /etc/lilo.conf, and then run lilo
    $ sudo lilo
  7. Reboot
  8. Compile/install new nvidia driver manually.

This page is © Phil Dibowitz 2001 - 2007