How to Compile the Linux Kernel in GNU/Debian and Ubuntu
NOTE: Tested in GNU/Debian Sid. Ubuntu versions should also work.
OBTAIN KERNEL SOURCE CODE:
Obviously the first step is obtaining the source code.
It is recommended to place and build linux kernel source code in /usr/src directory, although it is not required.
We create our "Linux_Kernel_Source" directory for this task.
$mkdir Linux_Kernel_Source
$cd Linux_Kernel_Source
Linux kernel source code is freely available in Internet:
http://www.kernel.org
specifically, version 2.6:
http://www.kernel.org/pub/linux/kernel/v2.6
We download and uncompress latest source code (2.6.31 when this article was written):
#aptitude install wget bzip2
# packages needed to get the kernel source code and uncompress it.
$wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.tar.bz2
Uncompress the source:
$tar xvjf linux-2.6.31.tar.bz2
/usr/src/linux is a symlink to linux sources or at least linux kernel headers. It is required.
#ln -s linux-2.6.31 /usr/src/linux
$cd linux-2.6.31
KERNEL CONFIGURATION: