Note: I didn't write this. I just edited it a bit to update it for the newest kernel version and a couple of settings that were left out which you'll need. If you follow the guide exactly, theoretically everything should 100% after compiling and booting into the kernel. This guide may help for other debian based distros as well. Good luck!
The original can be found here:
http://www.ubuntuforums.org/showthread.php?t=217657
How to compile the 2.6.17 kernel from kernel.org This guide is for the stable 2.6.17 kernel from kernel.org. It was updated for the lastest kernel on August 15th at 12:57 P.M..
IT IS STRONGLY RECOMMENDED THAT YOU COPY AND PASTE THE FIRST 4 STEPS INTO THE TERMINAL
I have finished compiling the latest 2.6.17 kernel from kernel.org and as a result, my computer has been running much faster. This is a tutorial on how to compile the 2.6.17 kernel from kernel.org. You do not need to use the 2.6.17 kernel but it is the kernel that is explained in this guide. You do not need the patch for the kernel and you can configure the kernel for maximum speed in xconfig. A tutorial to optimize the kernel you are compiling can be found here.
P.S. This howto is based on this thread here: http://www.ubuntuforums.org/showthread.php?t=157560. I give the credit for this thread to xXx 0wn3d xXx. Thanks!
- Install the utilities needed to configure the kernel and move to /usr/src
Code:
sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget && cd /usr/src
- Now we are going to download the kernel and unpack it.
Code:
- Now we are going to remove the link to the linux directory, make a new link to the new kernel, and move to the Linux directory:
Code:
sudo rm -rf linux && sudo ln -s /usr/src/linux-2.6.17.8 linux && cd /usr/src/linux
NOTE: IF YOU WILL BE PATCHING THE KERNEL FOR A PROGRAM (ex. fbsplash, bootsplash) NOW IS THE TIME TO DO IT. IF NOT, GO AHEAD TO THE NEXT STEP.
- Now we are going to import your current kernel configuration and configure the kernel:
Code:
sudo cp /boot/config-`uname -r` .config && sudo make xconfig
IMPORTANT: READ THIS POST OR THE KERNEL MAY NOT COMPILE!
Here are some performance tips:
Quote:
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 Graphics Support
-DISABLE NVIDIA RIVA IF YOU ARE USING 3RD PARTY NVIDIA DRIVERS. This has been known to cause problems
In "Device drivers" go to "Block devices" and in "IO Schedulers" leave only the "CFQ I/O scheduler" activated, which provides the best performance.
Device Drivers -> Multimedia Devices -> Digital Broadcasting Devices ->
Disable the following:
Budget cards
Budget cards with onboard CI connector
Budget cards with Budget Patch
AV7110 cards with BudgetParch
In "Kernel hacking" uncheck "Kernel debugging".
Ctrl+S to save the kernel configuration and then close the window.
NOTE: Not all the options will be the same in different kernels
- Make yourself root:
Code:
sudo -s -H
- Now time to build the kernel: Make sure that you are in /usr/src/linux with full root access. This will build a debian file that you can install.
Now in the terminal do this:
Code:
make-kpkg clean
Then this:
Code:
make-kpkg -initrd --revision=386 kernel_image kernel_headers modules_image
Note: You can replace "386" with anything you want. Like "k7" or "686."
The kernel will now compile for 1-3 hours, depending on the speed of your processor. If you have an extremely slow processor, you may have to wait 3-4 hours for the kernel to compile. In the meantime, I would go out to a movie or do something else while the kernel is compiling.
- Install the .deb files in /usr/src. There should be 2. One should be an image .deb file and the other a header .deb file. In terminal do:
Code:
dpkg -i <name of the file>
DO THIS FOR BOTH FILES.
IMPORTANT: IF YOU HAVE AN NVIDIA GRAPHICS CARD, YOU WILL HAVE TO REINSTALL THE DRIVERS FOR IT. REFER TO TROUBLESHOOTING BELOW.
- Now reboot and you will have a faster system!
Troubleshooting:
-------------------------------------------------------------------------------
Q: My Wifi Doesn't work !
A:To get wifi working, compile the new ndiswrapper from source. Follow the tutorial.
-------------------------------------------------------------------------------
Q: When I reboot I get Grub Error 22 ! WTF ???
A: You may have missed a step or messed something up. When it says Grub Loading..... press esc and you will be able to boot with another kernel. Then you should go into synaptic and uninstall the broken kernel and then reompile it.
--------------------------------------------------------------------------------
Q: How can I get fglrx and DRI working on my new kernel ?
A: Type this in terminal:
Quote:
sudo apt-get install fglrx-kernel-source
Reboot and if that does not work, make sure fglrx is in the Driver section.
---------------------------------------------------------------------------------
Q: I can't get X to load. Tried to use my xorg.conf backup and used apt-get to get the fglrx-kernel-source. What should I do?
A: You need to reinstall the drivers for your graphics card. Here is a site on how to do that (
http://doc.gwos.org/index.php/Latest_Nvidia_Dapper). It would be best to use method 1, but
skip the first 2 steps After you do that make sure to add nVidia to your /etc/modules file.
If it still doesn't work look here:
http://www.ubuntuforums.org/showpost...9&postcount=39
Note: Non-Legacy drivers!!
I still booted to X because I hadn't updated to the nVidia drivers, and I downloaded the *.run package off the nVidia website.
Moved to a console (Alt+Ctrl+Shift+F1) and shut down X using
Code:
sudo /etc/init.d/gdu stop
Ran the package as root. It says it needs a package from nVidia.com. Select yes. Replys saying cant find one, will create one instead.
Go ahead with it.
Let it install.
Back at the console, get the glx by typing
Code:
sudo apt-get install nvidia-glx
Enter
Code:
sudo nano /etc/modules
Add at the end nvidia <New line> glx
Type
Code:
sudo /etc/init.d/gdm start
Now it should load.
~sebz2005
~Brain Juice
----------------------------------------------------------------------------------
Q: When I try to patch the kernel I get:
root@localhost:/home/me/Desktop# bzcat /home/gqed76/Desktop/patch-2.6.17.6.bz2| patch -p1
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/Makefile b/Makefile
|index 1700d3f..5c568d3 100644
|--- a/Makefile
|+++ b/Makefile
--------------------------
File to patch:
A: You are not in /usr/src/linux.
Code:
cd /usr/src/linux
Now try again and it will work.
~GQed76
----------------------------------------------------------------------------------