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)
![make menuconfig - processor type and features make menuconfig - processor type and features](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_proc-150x150.png?x31449) processor type and features
|
![make menuconfig - bus options make menuconfig - bus options](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_bus-150x150.png?x31449) bus options
|
![make menuconfig - device drivers make menuconfig - device drivers](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_dev-150x150.png?x31449) device drivers
|
![make menuconfig - networking support make menuconfig - networking support](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_net-150x150.png?x31449) networking support
|
![make menuconfig - firmware drivers make menuconfig - firmware drivers](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_firmware-150x150.png?x31449) firmware drivers
|
![make menuconfig - ubuntu supplied third-party device drivers make menuconfig - ubuntu supplied third-party device drivers](https://blog.tersmitten.nl/wp-content/uploads/2009/12/kernel_ubuntu-150x150.png?x31449) 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;
![synaptic pin package synaptic pin package](https://blog.tersmitten.nl/wp-content/uploads/2009/12/synaptic_pin-150x150.png?x31449)
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: