In Ubuntu it is assumed a kernel for generic x86 support should be about as fast as a kernel suited for your arch.
So lets see how true this is.
I am not going to benchmark anything, I just want to see if the feel is snappier and/or quicker, and if compiling a kernel is worth the effort for the average user.
I used ‘How To Compile A Kernel – The Ubuntu Way‘ as a template for compiling a personalized kernel so read it for more detailed information.
The only change I made in the configuration file was setting the arch to Athlon/Duron/K7 suited for my AMD Athlon(TM) XP 2200+ @ 1800 Mhz processor.
The test is done on Ubuntu Gutsy Gibbon tribe4.
First I created a root terminal to prevent having to key in sudo all the time:
Made sure the needed packages were installed:
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
Then installed the kernel-source:
apt-get install linux-source
Then go to the directoy where the source is located (installed):
Unpack (in my case) linux-source-2.6.22.tar.bz2
tar xjfv linux-source-2.6.22.tar.bz2
Make a symbolic link of the unpacked linux source and giving it the name linux:
ln -s linux-source-2.6.22 linux
Go into the linux folder with the command:
Copy the config-file into linux so it can be used as a template for the compilation of the kernel,
In my case this is config-2.6.22-9-generic:
cp /boot/config-2.6.22-9-generic ./.config
Now I can set up the desired arch for my kernel with starting up the menuconfig:
First thing to is importing the config-file that is copied into linux so it can be used.
When all this is done: select exit and save, the configuration is now finished.
Now its time to make the needed debian packages which can be installed after compilation.
Depending on your processor this can take several hours. The name of the kernel wil be in this case tuxicityk7 : (- -append-to-version=-tuxicityk7)
fakeroot make-kpkg – -initrd – -append-to-version=-tuxicityk7 kernel_image kernel_headers
After having watched ‘The Godfather‘, the compilation and the creation of the packages is done.
The created Debian packages are located in /usr/src:
2 packages are installed with the command:
dpkg -i linux-image-220.127.116.11-tuxicityk7_18.104.22.168-tuxicityk7-10.00.Custom_i386.deb linux-headers-22.214.171.124-tuxicityk7_126.96.36.199-tuxicityk7-10.00.Custom_i386.deb
Wow, long names, but hey what can you do.
Grub will also be updated, and the new kernel will show up in the grub menu when rebooted.
After reboot I keyed in ‘uname -r’ in a terminal and got 188.8.131.52-tuxicityk7 as a result. :-)
Is it worth the effort for the average user? No absolutely not, If I would use Ubuntu tomorrow with the generic kernel I probably would not notice the difference.
If you like tweaking, go for it.
Images are made on Ubuntu Gutsy Gibbon with the alt-print screen button, theme on the images is Clearlooks, with a Clearlooks2-Squared-Berries Window border, except for 2.png which I downloaded from the link I mentioned earlier.