Here is a guide for you to walk you through the patching/compiling process, I hope you like it!
*Warning*
If you have truecrypt installed or any kernel modules like the rt73 usb wifi driver, it must be recomiled/installed for the new kernel, the performance is worth the time and effort. Make sure you download anything you need to recompile driver wise before you reboot to the new kernel.
*The drivers must be recompiled while using the new kernel!
This How-To will guide you through the compilation/installation of the 2.6.22 (more recent than the one distribuited with Ubuntu Feisty 7.04) with the performance patchset by Con Kolivas.
1-Download what is needed
Type in the command line:
Quote:
sudo apt-get install build-essential bin86 kernel-package sudo apt-get install libqt3-headers libqt3-mt-dev (needed for make xconfig) |
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2
Desktop Patch:
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.22/2.6.22-ck1/patch-2.6.22-ck1.bz2
Server Patch:
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.22/2.6.22-ck1/patch-2.6.22-cks1.bz2
2-Now, lets unpack the kernel source to /usr/src:
*Copy the source to /usr/src:
Code:
sudo cp linux-2.6.22.tar.bz2 /usr/src
sudo cp linux-2.6.22.tar.bz2 /usr/src
Code:
cd /usr/src
cd /usr/src
Code:
sudo tar -xvjf linux-2.6.22.tar.bz2
sudo tar -xvjf linux-2.6.22.tar.bz2
Code:
sudo mv linux-2.6.22/ linux-2.6.22cK1
sudo mv linux-2.6.22/ linux-2.6.22cK1
Code:
sudo rm -rf linux
sudo rm -rf linux
Code:
sudo ln -s /usr/src/linux-2.6.22cK1 linux
sudo ln -s /usr/src/linux-2.6.22cK1 linux
*Change to /usr/src/linux:
Code:
cd /usr/src/linux
cd /usr/src/linux
Code:
sudo -s -H
Password:
sudo -s -H
Password:
Code:
sudo bzcat /home/username/patch-2.6.22-ck1.bz2| patch -p1
sudo bzcat /home/username/patch-2.6.22-ck1.bz2| patch -p1
*Import the configuration of the running kernel:
Code:
uname -r
uname -r
Code:
sudo cp /boot/config-2.6.20-16-generic .config
sudo cp /boot/config-2.6.20-16-generic .config
*Configure the kernel:
Code:
sudo make xconfig
sudo make xconfig
In "General Setup" activate:
-Support for paging of anonymous memory (swap)
--Support for prefetching swapped memory
In "Processor type and features":
-Processor family Choose the model of your processor.
Activate:
-Preemption Model
--Voluntary Kernel Preemption (Desktop)
-High Memory Support
--off -if you have less than 1 GB of RAM
--1GB Low Memory Support -if you have 1GB of RAM
--4GB -if you have more than 1GB of RAM
-Timer frequency
--1000 Hz
In "Device drivers" go to "Block devices" and in "IO Schedulers" leave only the "CFQ I/O scheduler" activated, which provides the best performance.
In "Kernel hacking" uncheck "Kernel debugging".
Ctrl+S to save the kernel configuration and then close the window.
5-Let's build the kernel:
*In a terminal make sure you are in /usr/src/linux with full root access.
We will build a ".deb" file that can be installed in our Ubuntu system, using make-kpkg.
*In a terminal type:
Code:
make-kpkg clean
make-kpkg -initrd --revision=ck1 kernel_image
make-kpkg clean
make-kpkg -initrd --revision=ck1 kernel_image
*To install it:
Code:
sudo dpkg -i kernel-image-2.6.22*.deb
sudo dpkg -i kernel-image-2.6.22*.deb
6-Reboot and everything should be running ok!
*Try:
Code:
uname -r
uname -r
7-Nvidia graphic cards users:
To install Nvidia driver follow the guide (no need to install linux-headers as we have the source in /usr/src/linux:
http://www.ubuntuforums.org/showthre...ghlight=nvidia
Resources:
The Kernel patch homepage of Con Colivas
Discussions on CK vs CFS
What a great walkthrough. Creating the .deb takes forever lol - it's running right now. Thanks, this was a great introduction to this topic for me - a very interesting one indeed!
ReplyDeleteIf there wasn't errors this will build the kernel and a ".deb" file will be created at /usr/src.
ReplyDelete*To install it:
Code:
sudo dpkg -i kernel-image-2.6.22*.deb
Actually, mine created a file named "linux-image-2.6..." instead of "kernel-image..."
Great tutorial! But since patching my kernel, my video card won't let me select a resolution above 640x480. I followed the instructions to install an NVIDIA driver, but that just made the video card angry. :( So I went back to using Envy. I think I need to compile/install the 2.6.22-ck1 linux headers, but I don't know how.
ReplyDeleteBeside the effect to tune your ubuntu's performance it's a nice howto on baking your on kernel with the debian based make-kpkg[1]. Thx for sharing it.
ReplyDeletethe polarizer
[1] Debian Kernel-FAQ
Is it ok to use "2.6.22.6" (latest) and not "2.6.22"?
ReplyDelete