1. the images
  2. patching the kernel
  3. building a module

The Stock Kernel

The stock debian kernel is the what you get by default after running the debian installer, and what you get if you apt-get install kernel-image-2.6-xxx.

the images

These are your choices for kernels (by package name):

  • kernel-image-2.6-386: Should run on any x86 compatible cpu.
  • kernel-image-2.6-686: If you have an intel CPU that is not a million years old, choose this one.
  • kernel-image-2.6-686-smp: For multiprocessor support.
  • kernel-image-2.6.X-686: This is the same as above, except that the full kernel version is specified (replace X with the number). When you upgrade, your kernel will not automatically get upgraded when the package maintainers feel the next version of the kernel is stable enough.
  • kernel-image-2.6-k7: for AMD based chips.
Attention!
Starting with the debian release following etch, stock kernels images for recent Linux versions, i.e. 2.6.12 and above, are no longer packaged as kernel-image-... but as linux-image-...

Also starting with the follow-up release to etch, there are now additional virtual packages which always point to the latest stock kernel image for your processor architecture, independant of whether it's a 2.4.x, 2.6.x or whatever comes after that. For example, if you have an AMD K7 single processor system, installing the linux-image-k7 virtual package will make sure you will always have the latest kernel available for your system architecture.

patching the kernel

here are all the steps for patching the stock debian kernel.

# cd /usr/src
# apt-get install kernel-source-2.6.8
# wget '/path/to/download/patch.tar.bz2'
# tar xvjf patch.tar.bz2
# tar xvjf kernel-source-2.6.8.tar.bz2
# cd kernel-source-2.6.8
# patch -p1 < ../patch.diff
# make
# make modules_install
# make bzImage
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.8
# cp System.map /boot/System.map-2.6.8
# mkinitrd -o /boot/initrd-2.6.8 2.6.8
# update-grub

building a module

# apt-get install module-assistant
# module-assistant

From that console interface, you should be able to build and install many common modules not included in the stock kernel.