Tuesday, January 16, 2007

Customized Kernel in Debian

This blog is intended to work as a guide for people who want to set up their own customized and flavored kernel without losing the debian touch a.k.a the dpkg method.

What do I need for it ?

Well first things first ! Of course you need a kernel source for it , go to www.kernel.org and get the latest one.You would also need to install fakeroot & kernel-package on your system.

Steps to follow

  • Install the kernel-package and fakeroot.
  • Get the Linux kernel tarball from some where.
  • Uncompress the tarball to a place of your choice.
  • cd into the kernel source directory.
  • Configure your kernel.Now do not expect me to dish out the details of kernel configuration in this blog as it in itself is a big topic and needs separate attention.I prefer to use
make menuconfig


  • Once you are done with configuring the kernel execute the following command in order to create your own .deb package
fakeroot make-kpkg kernel_image

  • You will have a kernel deb in the parent directory of your kernel source now (e.g. /usr/src). Install it using dpkg
dpkg -i file.deb


If you use grub here is what you need to do to get your menu.lst automatically updated.

Create a file /etc/kernel-img.conf and add the following lines:


postinst_hook = /sbin/update-grub postrm_hook = /sbin/update-grub do_bootloader = no


This will ensure update-grub is ran upon installation of any kernel packages, self-created or Debian-created.