Howto: Kernel Building in Debian Sarge (3.1)

I’ve tried and tried to build my own custom kernel over the past year or so, usually only to stop in frustration because of some small part of the process not working.

This is all different now.

I found out that using the took make-kpkg makes things way easier. In fact I configured, compiled, and installed kernel 2.6.15 in about 30 minutes including the time that it took me to build it.

Here’s the process that I followed to achieve this:

  1. Get required packages apt-get install libncurses5-dev fakeroot bzip2 kernel-package
  2. Get latest kernel package from The latest one at the time of this post is linux-2.6.15.tar.bz2.
  3. Decompress the kernel archive (tar -xjvf linux-2.6.15.tar.bz2)
  4. Start the kernel configuration tool (make menuconfig)
  5. I should mention that it was way easier for me to load my existing kernel configuration, which was located at /boot/config-(kernel version here).

  6. make-kpkg clean
  7. fakeroot make-kpkg –initrd –revision=myfirstkernelbuild_v.0.1 kernel_image
  8. This runs make-kpkg as root, while making it so that initrd can load the kernekl. –revision is just the revision of the kernel, and kernel_image is just the name of the kernel that you’re building.

    The output of this command is kernel-image-2.6.15_myfirstkernelbuild_v.0.1.deb

  9. Install the kernel (dpkg -i kernel-image-2.6.15_myfirstkernelbuild_v.0.1.deb)
  10. Restart the computer (init 6)
  11. If this process worked the output of uname -r should be 2.6.15.

    Let me know if you have any problems.

    Jon Howe

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright ยฉ 2024