Recompiling linux kernel, why?

Giscardo

Senior member
May 31, 2000
724
0
0
I was just curious as to why one needs to recompile the kernel in linux. What advantages does it gain you? Also, are there any options you can set/enable when you do it, that will add optimizations to make linux faster on Athlons (as opposed to how the OS is configured when you first install it). Is it a good idea to recompile the kernel if i just moved from a celeron to a new mobo and an Athlon CPU, and new video card, and CD Burner? Please post any relevant links yuo may have as well. THanks
 

DaHitman

Golden Member
Apr 6, 2001
1,158
0
0
Why Compile a New Kernel?
You may be thinking "But why recompile it? It works fine as it is." There are three reasons for a recompile. Firstly, you may have some hardware that is so new that there's no kernel module for it in on your distribution CD. Secondly, you may have come across some kind of bug which is fixed in a revision of the operating system. Lastly, you may have some new software which requires a newer version of the operating system.


Why should I compile my own kernel?

If you've just installed Linux, there was a kernel with your distribution. Why should you recompile it?

Most often there is a reason for you to compile your own kernel. First, you might have some hardware not supported in your current kernel, forcing you to compile your own.

Second, you might want to compile your own kernel because the one you have has too much hardware support compiled in. As an example, if you have a system with only (E)IDE harddisks, you don't your kernel to support several SCSI controllers. The same goes for odd hardware like CDROM:s connected to soundblaster sound cards and other similar things.

Recompiling your kernel will make it smaller, taking upp less memory. On todays computers that's often not a problem, since they have enough memory anyway.

Security is another aspect. Sometimes some security related bug is found in the kernel code, and a fix is released as a patch or in the next kernel release. When you recompile your kernel your computer won't be vulnerable to that security problem any more.




Here is some more help:

** VERY GOOD ARTICLE:

http://www.linuxnetmag.com/en/issue4/m4kernel1.html

http://www.linuxplanet.com/linuxplanet/tutorials/202/1/

http://csel.cs.colorado.edu/udp/admin/linux-howto.html

http://www.linuxlookup.com/html/guides/kernel.html

http://linuxfocus.org/English/July2001/article209.shtml

http://www.linux.com/develop/newsitem.phtml?sid=1&aid=12464

http://www.linux.com/newsitem.phtml?sid=60&aid=8841

http://www.linuxgazette.com/issue68/ghosh.html
 

MGMorden

Diamond Member
Jul 4, 2000
3,348
0
76
Yes, you can compile a kernel to be faster on your target processor (Athlon or P4 or whatever). As to your question about a new video card, if you've compiled and setup your own kernel then generally it will be setup for your particular stuff so recompiling (again) is often required, and even if it isn't it's still a good idea. If you're running a stock kernel then you can usually just do the swap since they have virtually all modules compiled. In short though recompiling the kernel (a properly configured one that is) makes the system just a little faster.