How do I compile and install a kernel from source?

C. Linus Hicks lhicks at nc.rr.com
Fri Sep 3 06:09:26 UTC 2004


On Wed, 2004-09-01 at 23:23, Andrew Konosky wrote:
> I have been installing the kernel rpms with yum/synaptic, but I have 
> read that the "vanilla" kernels, which I am guessing are the original 
> source-code versions, have more features, but are sometimes less stable 
> becuase thet are not edited for specific distributions. Is this correct?
> 
> I would like to compile the latest kernel version from source just to 
> see how it's done and also to see if the "vanilla" kernel is stable 
> enough for my system. Once it is compiled, will I have to manually add 
> the kernel to the grub config file? Any tips/tricks I should know about 
> when compiling a custom kernel?

I have found it useful to read the README file in the root of the kernel
sources tar file. It includes information about applying kernel patches.
Also, the file Documentation/Changes has things like minimum revisions
required for compiling and running a specific kernel.

It's a good idea to check out the makefile in the root (of the kernel
sources) as well. Set EXTRAVERSION on line 4 to something unique so you
don't overwrite any of your existing modules directories. I think the
install target still uses lilo by default, but I believe it gives you
the option of having your own installkernel script, and you may want to
uncomment where it sets INSTALL_PATH.

If you happen to be following the work of a specific developer because
of what you've read in lkml or elsewhere, you can usually find their
patches in /pub/linux/kernel/people on kernel.org.

Enjoy!
-- 
C. Linus Hicks <lhicks at nc.rr.com>





More information about the users mailing list