LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   RedHat 6 Kernel Compilation (https://www.linuxquestions.org/questions/red-hat-31/redhat-6-kernel-compilation-864291/)

danib1 02-22-2011 08:28 AM

RedHat 6 Kernel Compilation
 
hi
i have installed Redhat 6 , i am trying to compile the kernel. i found some instruction over the net but rpm packages were build.
can anyone post an HOWTO compile the kernel on RedHat 6

misconfiguration 02-23-2011 09:06 AM

Could you please explain why exactly you're trying to recompile the kernel? If RHEL 6 is installed you have a proper working compiled version of a kernel. If you need to extend functionality to the kernel and actually have a need for recompiling you need to grab the source from http://kernel.org or RedHat's Repositories, as they also publish the source RPM's.

Otherwise you should be set - when you install // update from an RPM this is a pre-compiled version of a kernel.

jmanjohn612 03-23-2011 09:03 AM

Looking through the .config file there are many (EXPERIMENTAL) selections within the config and I would ask why? Experimental by nature seems risky to include, and "Preemption Model (No Forced Preemption (Desktop)) --->" is the default setting...why not set it to "Server"? Also, if there is a large amount of memory, why is it recommended to use 65536 for "(4096) Low address space to protect from user allocation" yet default is 4096? There are many settings that make me ask why. AMD vs Intel and why both are present?

I need a better understanding:-(

manyrootsofallevil 03-23-2011 11:05 AM

Quote:

Originally Posted by danib1 (Post 4267311)
hi
i have installed Redhat 6 , i am trying to compile the kernel. i found some instruction over the net but rpm packages were build.
can anyone post an HOWTO compile the kernel on RedHat 6

It's reasonably easy.
  1. Grab the src rpm from red hat ftp site (ftp://ftp.redhat.com/pub/redhat/linu...r/en/os/SRPMS/)
  2. install said rpm with rpm -i kernel-2.6.32-71.18.2.el6.src.rpm. (assuming you get the lastest) This will create an rpmbuild directory on your user's home (I think, I've only tried it there)
  3. Go to rpmbuild/SPECS
  4. run rpmbuild -bp kernel.spec
  5. Go to rpmbuild/BUILD/kernel version/kernel version
  6. Run make config or make menuconfig (you can run a x version of this make xconfig (KDE) or make gconfig (GNOME))
  7. run make rpm
  8. wait

As misconfiguration pointed out, you already have a kernel so there is no need to do this.

The crucial step, I guess, is make menuconfig, as this allows you to customize the kernel.

Bear in mind that the compilation is quite time consuming and will use a few GB (4-5 GB)

saurin 08-14-2012 04:43 PM

how to upgrade the kernel image after compilation?

manyrootsofallevil 08-15-2012 01:49 AM

Quote:

Originally Posted by saurin (Post 4754213)
how to upgrade the kernel image after compilation?

I would advise against it

Just install a new kernel. This way you can test the new kernel and go back to the old one if you so wish


All times are GMT -5. The time now is 05:25 AM.