Post: How to optimize and compile your own Linux kernel.
08-02-2011, 11:54 AM #1
gola
OVER 9000!
(adsbygoogle = window.adsbygoogle || []).push({}); Just writing this to tell you guys how to compile and optimize the linux kernel to your specific hardware, doing so can increase your performance and fix boot problems if the generic kernel is unbootable due to the size of it which can sometimes happen.

First off you'll obviously want to get the linux kernel, you can find that at You must login or register to view this content. just get the latest stable kernel and save it to your home folder in a new folder called src. At the time of writing this it's 3.0.0, which can be downloaded from You must login or register to view this content.

Next open up your terminal then type in
    cd ~/src/ && su && ls
which will first change the directory to the src folder you made in your home folder then prompt you for the root password so you can change to a super users then list the files in the directory.

Next if you've successfully downloaded the kernel, become a superuser and are in the ~/src folder then type in tar xvfj (kernel archive filename) which will extract the files from the tar archive, in this case it will be linux-3.0.tar.bz2.

Then go do cd /usr/src && ls which will show all the files and folders in /usr/src again, just to see if you've properly extracted it. If so then do cd (extracted folder name) which in this case would be linux-3.0.0.

Next you'll want to do make menuconfig, in this utility you'll be choosing what to include in the kernel and what to exclude, if you don't have much of a clue on what to exclude just exclude the file system support for the file systems you aren't using and the drivers for AMD/ATI if you intel/nvidia and exclude Intel/nvidia drivers if you use AMD/ATI.

After you've done that go to exit and go to yes to save the config then do make and it will compile..

After that's done do make modules_install.

Then type in make install.

Now you have to put your new kernel in your lilo/grub bootloader menus;

If you use lilo edit /etc/lilo.conf to
     image = /boot/vmlinuz-(version of kernel)
     title=Linux 2.6.0[FONT=courier]  title=Linux 2.6.0[/FONT]title=Linux 2.6.0[FONT=courier]         label = (Version of kernel)[/FONT]


and if you use grub edit /boot/grub/grub.conf to
    
              root (hd0,1) #  or whatever your current root is 
kernel /boot/vmlinuz-(version number) root=/dev/hda1 # (or whatever your root is)

If you're using Ubuntu, you might need to edit menu.lst or grub.cfg instead of grub.conf

And you're done, boot into your new kernel.

If you get a kernel panic you got rid of something you needed.

Just finished up doing this myself and I'm now running the 3.0 Linux Kernel Winky Winky
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo