DizmalBlog

Building a new Linux kernel under Debian

Building a new Linux kernel is covered in many places and has been made a very easy process by the developers and maintainers of the code. The one piece of the puzzle that i was somehow mssing for a while was creating the initial root device (or initrd) for the new kernel I had just built.

Debian make it easy to build the whole kernel, modules and initrd into a package which you can then install, but I find this too much. Okay, if you have got everything configured just right and you are happy to create a final package that you can archive and reuse, but not if you are in a development or configuration cycle tuning settings or changing code. In this case it is not acceptable to have to compile everything from scratch and create a package to install. I only wanted to change to add or change one line in a module and re-install it. In most cases I prefer a more manual approach, without everything being hidden behind a smoke screen.

Assuming the kernel is rev 2.6.x.y The commands I use are:

  • make menuconfig
  • make bzImage
  • make modules
  • make install
  • make modules_install
  • mkinitrd -o /boot/initrd.img-2.6.x.y 2.6.x.y

The Debian command to build the kernel, modules and initrd into an installable package is:

  • make-kpkg –rootcmd fakeroot –initrd kernel_image

This creates a package that can then be installed with

  • dpkg -i

Leave a Reply

DizmalBlog is is proudly powered by Wordpress
Navigation Theme by GPS Gazette