HowTo: Compiling a Kernel on Debian

This howto goes over some simple steps at compiling a 2.6 Kernel on a Debian Machine

  1. apt-get install kernel-package ncurses-dev fakeroot wget bzip2
  2. cd /usr/src
  3. wget http://www.kernel.org/pub/linux/kernel/v2.6/lhttp://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2
  4. tar xjf linux-2.6.18.tar.bz2
  5. cd linux-2.6.18
  6. cp /boot/config-* /usr/src/
    1. this step copies your old configs to /usr/src so you can use them as a reference in compiling your new kernel. step 6 IS optional.
  7. cd /usr/src/linux-2.6.18; make menuconfig
  8. Select Load Alternate Configuration if you want to use the optional reference configs from step 6 - and enter the name/location of the reference config.
  9. Make any modifications to your kernel, such as architecture, filesystem, NIC, scsi drivers, so on.
  10. Exit and save your new kernel configuration.
  11. make-kpkg clean
  12. fakeroot make-kpkg –initrd –revision=custom.1.0 kernel_image
  13. if the compilationm stops run
    1. make clean
    2. make menuconfig
    3. re-inspect your loaded/chosen kernel options
    4. go back to step 11
  14. install your new kernel:
    1. dpkg -i kernel-image-2.6.18_custom.1.0_i386.deb
  15. reboot
  16. uname -a
  17. dada! Your new kernel should be here, if it isnt check lilo or grub!

Kernel Resources:

Leave a Comment