downloads
 drivers & firmware


PDA

View Full Version : How to compile the Linux kernel (redhat Enterprise version)


   
 
 
Unregistered
08-08-2005, 10:02 AM
Hello,

Plz tell the steps that has to be followed to compile the Linux kernel.

Thanks in advance
regrds,
Stephen

Unregistered
02-23-2006, 08:34 PM
First you have to have the source code of your kernel installed (this is the non-compiled code).
Second is the issue are you compiling the existing kernel with updated modules or inline code? Or are you wanting to upgrade to another kernel?

If the first you need to cd to /usr/src/linux*
if the source kernel is installed then you should be able from this location to call up the existing kernel's settings using I think make configure (but please check the 'manual' though I know they lack a lot at times.

This will only allow you to see what settings you have and what are availble, you should not at this point re-compile or change any settings. To do that you first have to input at command line mrproper (again check manual) this makes sure the kernel is set up to date. And then you go through the make configure and all the rest. At the end when you have changed settings you can save and the 'manual' again should give you instructions as to how to compile.

The major issues with most newbies is whether or not the source code has been installed when you did your own install. Many 'manuals' are not clear about this being necessary for compiling your kernel or even being able to see what it contains and what is available. This is often an issue with the disk space available because this code is generally very large. Another issue is that you need gcc installed which is used to compile the updated kernel and sometimes this is missing.

But with both the source code and gcc you should be able to compile the existing kernel.

As for new kernels or upgrades, etc. I have done that but don't remember all the ins and outs. First out you have to get the source code on your computer and it is usually compressed. Sometimes it will decompress then immediately erase itself. If this happens you have to put in a compound command for both decompressing the file and for making it a .tar or archive. This is done through the use of a pipe |. Like the following line:

gunzip2 /download/linux-#.#.#.gz /backup | tar xvf linux-#.#.#.tar; or something like this (again I need to read the manual). The issue here is you need to know how big the download will be and also how much free disk (df at the command line) you have; because unlike MSWindows, Linux will not tell you when you don't have enough room for the download. It will try to download and decompress the file and if that fills up the disk too bad it will probably go down and change the settings in CMOS for the hard drive and then you will think that your drive has crashed (but usually all you need to do is input in CMOS the right figures again to reboot successfully).

Next is the issue where you put the new kernel. Sometimes it actually has to be in the / directory to work.

Anyway as you can see: recompiling a kernel or compiling a new is somewhat involved; and also involves how much disk space you have, and whether or not you initially installed the source code and gcc.

If this intimidates you I would suggest that you get something like an old 2.0 kernel package called Caldera Open Linux and try that if your computer is not too fast for it. Other than that you should probably look at Xandros which probably has a similar set up as Open Linux where they have a menu item called COAS where it helps you change and then update your kernel (OpenLinux only uses modules to do this). I don't like using Partition Magic which both these distributions have (in some forms use) but otherwise there is probably more help in either about re-compiling a kernel than in RedHat.