Compile the Kernel on Debian etch

Compiling the kernel from source on Debian is actually pretty simple thing to do.

This guide has been tested on standard etch installation but will probably work on other versions and debian-like operating systems. The system is easy to break if not done right, compile and install the kernel at your own risk!

Install required packages

apt-get install kernel-package libncurses5-dev fakeroot wget build-essential

Download Kernel sources

You can see a list of available kernels here:

cd /usr/src

Extract the kernel and create a symlink

tar zxvf linux-2.6.26.tar.gz
ln -s linux-2.6.26 linux
cd /usr/src/linux

Configure kernel

Copy the old config file and configure the kernel

make clean && make mrproper
cp /boot/config-`uname -r` ./.config
make menuconfig

In the menu do this to load the old configuration file

1. Load an Alternate Configuration File
2. Type .config if not already in the textbox
3. Ok
4. Do any changes to the kernel modules
5. Click Exit
6. Click Yes when asked if you want to save

Build the kernel

make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

The build can take long time so be patient

Install the new kernel


Get a list of files in the /usr/src to find correct deb files

cd /usr/src
ls -l

Do the actual install with dpkg. You will always have to install the linux-image package but linux-headers are optional and are only available if already installed on your system.

dpkg -i linux-headers-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb
dpkg -i linux-image-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb



Leave a Reply

Your email address will not be published.