Difference between revisions of "Centos-kernel"

From Bashlinux
Jump to: navigation, search
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
= CentOS Kernel setup ==
+
= CentOS Kernel setup =
 
== How to install the CentOS Kernel Sources ==
 
== How to install the CentOS Kernel Sources ==
   
 
The following procedure explains how to install an use the kernel sources used by CentOS, this procedure also applies for Fedora, but please note that the kernel version is different and maybe the spec file has not kernel number.
 
The following procedure explains how to install an use the kernel sources used by CentOS, this procedure also applies for Fedora, but please note that the kernel version is different and maybe the spec file has not kernel number.
# Download the sources from the main repository, usually is placed on ''http:// ... /source/SRPMS''
+
# Download the sources from the main repository, usually is placed under '' ... /source/SRPMS''
 
 
 
<pre><nowiki>
 
<pre><nowiki>

Revision as of 21:52, 4 February 2010

CentOS Kernel setup

How to install the CentOS Kernel Sources

The following procedure explains how to install an use the kernel sources used by CentOS, this procedure also applies for Fedora, but please note that the kernel version is different and maybe the spec file has not kernel number.

  1. Download the sources from the main repository, usually is placed under ... /source/SRPMS
 # cd /usr/local/src
 # wget http:// ... /source/SRPMS/kernel-2.6.xxxxx.src.rpm
 
  1. Install with rpm command
 # yum install rpm-build
 # useradd mockbuild
 # rpm -ivh kernel-2.6.xxxxx.src.rpm
 
  1. Go to the sources and build the kernel source folder structure
 # cd /usr/src/redhat
 # rpmbuild -bp SPECS/kernel-2.6.spec
 
# Move the sources to the default location

 # mv /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i386 /usr/src/
 # ln -sf /usr/src/linux-2.6.18.i386 /usr/src/linux
 


The folder `/usr/src/linux` wil have the current CentOS kernel with all the patches and fixes made by their development team. In order to keep untouched the kernel version and avoid conflicts at the time to add new modules, fixes, patches or whatever to the kernel, set the `EXTRAVERSION` variable to match the version of current installed kernel.

 # cd /usr/src/linux
 # sed -i "s/^EXTRAVERSION =/EXTRAVERSION = -`uname -r | cut -d '-' -f 2`/" Makefile