Normally in Debian when I want a new kernel I just ‘apt-get install kernel-image-2.X.X’ and the sources or headers if I need them. MepisBelle (aka Michael Dill) from our IRC channel #Linuxtalk on irc.freenode.net has a quick and easy guide for compiling your own kernel.
How to compile and install 2.6.x kernel
(…if you are already running on a 2.6.x kernel)
1. Make sure you have binutils, coreutils, libncurses5, libncurses5-dev, fakeroot and module-init-tools packages installed. You can find out by doing:
apt-get install binutils coreutils libncurses5 libncurses5-dev fakeroot module-init-tools
If they come up already installed or if any are missing you will be able to install them automatically this way
2. Download the kernel source:
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.x.tar.bz2 (replace ‘x’ with the version of the kernel you are trying to get- i.e. linux-2.6.8 linux-2.6.2 etc.)
3. Extract to /usr/src
4. Remove the sym-link ‘linux’ pointing to your old kernel directory and create a new one as follows:
cd /usr/src
rm linux
ln -s linux-2.6.x linux
5. Now create the .config file for your new kernel:
cd /usr/src/linux
make oldconfig
Choose ALL the defaults when asked about new kernel options!!
6. Create your new kernel image:
make-kpkg buildpackage -rev Custom.1 kernel_image
(You must be root here or use the fakeroot command with the above)
7. When build is complete – install it:
cd /usr/src
dpkg -i kernel-image-2.6.x_Custom.1_i386.deb
8. Edit grub:
cd /boot/grub
kwrite menu.lst
Copy the whole paragraph that has your other 2.6x kernel boot info. Paste it in UNDER the previous kernel line, then change the version numbers in the NEW entry:
ex: change 2.6.5 to 2.6.7 – etc.
WARNING: Do not remove the old kernel entry until the new kernel is tested. This your fall-back bootable kernel!!
Save the file
9. Reboot and select the new kernel at bootup.
If you have any questions or problems, join us on IRC and ask MepisBelle, he will be happy to help out :)