Debian Tutorials Copy/Paste tutorials for Debian based Linux distros

23Aug/081

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: http://www.eu.kernel.org/pub/linux/kernel/v2.6/

cd /usr/src
wget http://www.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.gz

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

Reboot

reboot

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Technorati
  • email
  • Live
  • Slashdot
  • LinkedIn
  • Print
  • Tumblr
  • Twitter
  • Netvibes
  • Netvouz
  • PDF
  • Yahoo! Bookmarks
Comments (1) Trackbacks (0)
  1. thanks for this very nice how-to


Leave a comment


No trackbacks yet.