[ubuntu] How to compile th new 2.6.x kernel from kernel.org
리눅스 2007. 1. 12. 16:49
How To Compile the new 2.6.16 kernel from kernel.org
I just finished compiling the newest 2.6.16 kernel from kernel.org and I am getting much better performance. In what follows, I will show you how to compile and configure the latest kernel. You do not need to use the 2.6.16 kernel but it is the first kernel of the release kernel and performance patches are only made for these releases. (ex: 2.6.16, 2.6.17 NOT 2.6.16.20) Feel free to compile a kernel besides the first release cycle kernel. You do not need the patch and you can configure the kernel for maxium speed in xconfig. A tutorial to optimize the kernel you are building can be found here.
Before you begin, you will need to get a kernel
Download the 2.6.16 kernel and it's performance patch: The 2.6.16 kernel
Latest Kernel Patch Don't apply the patch if you are compiling a kernel other then 2.6.16 otherwise the kernel will not compile.
Check out kernel.org for the latest stable/release canidate kernel.
1. Install needed utilities to configure the kernel
2. Now we are going to move the kernel and unpack it.
3. Now we are going to move to /usr/src
4. Now unpack it:
5. Rename the folder: ONLY needed for 2.6.16 kernel ! You don't need to do this.
6. Now we are going to remove the link to the linux directory:
7. Make a new link to the new kernel:
8. Move to the Linux directory:
9. Make yourself root:
10. Apply the performance patch: Don't use if you are not patching the 2.6.16 kernel !
11. Now we are going to import your current kernel configuration:
12. Now import it: Make sure to replace the kernel version in this following command from the one from uname -r.
13.Configure the kernel:
Here are some performance tips from this thread.
Note: Not all the options will be the same in newer kernels.
14. Let's build the kernel: Make sure that you are in /usr/src/linux with full root access. Make sure that you are. This will build a debian file that you can install.
Now, in terminal do the following:
Note: You can replace "ck12" with anything you want. Like "k7" or "686."
15. Install the .deb fine in /usr/src. In terminal do
Now reboot and you will have a much faster system !
-------------------------------------------------------------------------
How I learned to do this:
2.6.14 Vanilla Kernel I based my tutorial on this thread. Thank you for writing this tutorial RubenGonc !
And I also learned some stuff from this thread
-------------------------------------------------------------------------
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:
Reboot and if that does not work, make sure fglrx is in the Driver section.
---------------------------------------------------------------------------------
Q: I need kernel headers for my custom kernel.
A: I updated the howto and edited the last step to build a kernel image, kernel module image, and kernel headers. Thank you to tseliot for his kernel thread because I found the command there. You can view the thread here.
------------------------------------------------------------------------------------
Q: I want to optimize my kernel ! What do I select ???
A: I just wrote this tutorial on how to configure your kernel for enhanced performance. I hope it helps.
----------------------------------------------------------------------------------------
Q: Why did you write this tutorial ?
A: I wrote this tutorial to help give back to the Ubuntu community. I've had such a good expericence with ubuntu that I want to help others. This community is great
Before you begin, you will need to get a kernel
Download the 2.6.16 kernel and it's performance patch: The 2.6.16 kernel
Latest Kernel Patch Don't apply the patch if you are compiling a kernel other then 2.6.16 otherwise the kernel will not compile.
Check out kernel.org for the latest stable/release canidate kernel.
1. Install needed utilities to configure the kernel
Quote:
sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev |
Quote:
sudo cp linux-2.6.16.tar.bz2 /usr/src |
Quote:
cd /usr/src |
Quote:
sudo tar -xvjf linux-2.6.16.tar.bz2 |
Quote:
sudo mv linux-2.6.16/ linux-2.6.16ck12 |
Quote:
sudo rm -rf linux |
Quote:
sudo ln -s /usr/src/linux-2.6.16ck12 linux |
Quote:
cd /usr/src/linux |
Quote:
sudo -s -H |
Quote:
bzcat /home/$USER/patch-2.6.16-ck12.bz2| patch -p1 |
Quote:
uname -r |
Quote:
sudo cp /boot/config-2.6.14-ck1 .config |
Quote:
make xconfig |
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 "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. |
14. Let's build the kernel: Make sure that you are in /usr/src/linux with full root access. Make sure that you are. This will build a debian file that you can install.
Now, in terminal do the following:
Quote:
make-kpkg clean make-kpkg -initrd --revision=ck12 kernel_image kernel_headers modules_image |
15. Install the .deb fine in /usr/src. In terminal do
Quote:
sudo dpkg -i <name of the file> |
-------------------------------------------------------------------------
How I learned to do this:
2.6.14 Vanilla Kernel I based my tutorial on this thread. Thank you for writing this tutorial RubenGonc !
And I also learned some stuff from this thread
-------------------------------------------------------------------------
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 |
---------------------------------------------------------------------------------
Q: I need kernel headers for my custom kernel.
A: I updated the howto and edited the last step to build a kernel image, kernel module image, and kernel headers. Thank you to tseliot for his kernel thread because I found the command there. You can view the thread here.
------------------------------------------------------------------------------------
Q: I want to optimize my kernel ! What do I select ???
A: I just wrote this tutorial on how to configure your kernel for enhanced performance. I hope it helps.
----------------------------------------------------------------------------------------
Q: Why did you write this tutorial ?
A: I wrote this tutorial to help give back to the Ubuntu community. I've had such a good expericence with ubuntu that I want to help others. This community is great

'리눅스' 카테고리의 다른 글
[ubuntu] Beryl 자동 설치하기 (0) | 2007.02.09 |
---|---|
[debian] X server 설치부터 gnome 및 한글 입력 까지 (0) | 2007.01.17 |
FreeNX - ubunut forum에서 퍼옴 (0) | 2007.01.09 |
[ubuntu] backport 리스트 추가하기 (0) | 2007.01.09 |
nvidia 드라이버 설정법 (0) | 2007.01.02 |
Posted by shellbt