Blog » Blog Entry

Debian GNU/Linux Kernel Howto

December 3, 2006

Here's a quick howto for building a recent 2.6 Linux kernel on your Debian box:

Do all this as root:

su -

Make sure you have the required tools and libraries:

apt-get install module-init-tools initrd-tools procps libncurses5-dev kernel-package fakeroot

Download and unarchive a kernel:

cd /usr/src
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.bz2
tar jxvf linux-2.6.19.tar.bz2
cd linux-2.6.19

I base my new kernel on a known working configuration, then I trim it down from there. Check to see what configurations you have in /boot:

ls /boot/config*

Configure your new kernel source using your chosen config file:

make menuconfig

Select "Load an Alternate Configuration File", enter your config file path, for example I used /boot/config-2.6.8-3-k7.

Build the kernel and package it:

make-kpkg clean
fakeroot make-kpkg --revision=mykernel.1.0 kernel_image

Install the new kernel:

dpkg -i kernel-image-2.6.19_mykernel.1.0_i386.deb

Make an initrd image so lots of important stuff is there on boot:

cd /boot/
mkinitrd -o /boot/initrd.img-2.6.19 2.6.19

Update grub's config to include the initrd image:

vi /boot/grub/menu.lst
add "initrd /initrd.img-2.6.19"
Tags: debian, linux, kernel, howto

« Debian rc.local howto Rubyonrails select helper »

Add a comment:

Title:

Comment:

Name:

Email: