In this howto I will show how I compiled a custom kernel in Ubuntu 8.10 (Intrepid Ibex). First we have to install some packages:
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2;
apt-get install linux-source;
The newly installed kernel-sources are in /usr/src
cd /usr/src;
tar -xjvf linux-source-2.6.27.tar.bz2;
ln -s linux-source-2.6.27 linux;
cd linux;
After unpacking and changing to the appropriate directory we have to copy our old (kernel) .config and we are ready to go!
cp /boot/config-$(uname -r) ./.config;
make menuconfig;
Here are some screenshots of how I configured my kernel:
PS; I am on an Intel Core2 Quad Q9550 with:
- 8GB memory
- ATI HD Radeon 3600 series
- Areca ARC1210 with 4 x WD RE3 WD7502ABYS (RAID 10)
 processor type and features
|
 bus options
|
 device drivers
|
 networking support
|
 firmware drivers
|
 ubuntu supplied third-party device drivers
|
You will probably come across this bug. Adding --arch=amd64 --subarch=x86_64 when calling make-kpkg will fix it:
make-kpkg clean --arch=amd64 --subarch=x86_64;
fakeroot make-kpkg --initrd --append-to-version=-quad \
kernel_image kernel_headers --arch=amd64 --subarch=x86_64;

pin package
If everything went well, we can install our packages and make sure we pin them (although you shouldn’t need to worry if you used --append-to-version)
dpkg -i linux-headers-2.6.27.18-quad-rt_2.6.27.18-quad-10.00.Custom_amd64.deb;
dpkg -i linux-image-2.6.27.18-quad-rt_2.6.27.18-quad-10.00.Custom_amd64.deb;
If you come across this bug:
/etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at ...
Just:
sudo apt-get purge nvidia-common
sudo apt-get install nvidia-common
and everything will work like a charm!
References: