This is my personal blog. I also have a professional blog at http://siliconsparrow.com/

19 March 2009

Creating a Debian Kernel Package for v2.6.26

Filed under: Nerd Notes — adam @ 10:47 am

There are so many guides out there on how to make a Linux kernel and so many of them are out of date, I thought I should write down a simple step-by-step of the current way to do it as of early 2009.

My goal here was to compile a new kernel for a Debian 4.0 (Etch) system. You can download pre-built kernels but I wanted to modify some drivers before building it.

Anyway, you will firstly need the source code. Go to the Debian Backports Repository and grab the latest linux-source package. Before installing it, you will need to install some tools:

sudo apt-get install kernel-package fakeroot libncurses5-dev

Now we can install the source:

sudo dpkg -i linux-image-2.6.26_dvc.1.2_i386.deb

cd /usr/src

tar jxvf linux-source-2.6.26.tar.bz2

ln -s linux-source-2.6.26 linux

cd linux

Next you need to configure the kernel. A good way is to simply copy the current kernel configuration:

cp /boot/config-2.6.18-6-686 ./.config

Finally, launch the make-kpkg utility. This will configure, compile and package the kernel in a DEB package.

fakeroot make-kpkg --revision=mycustomkernel-1.0 --config menuconfig --initrd kernel_image

This will launch the kernel configuration menu first. You can make any configuration changes here but usually the defaults are fine. When it is all done you will have the completed package file in /usr/src.


Powered by WordPress