Difference between revisions of "Centos-kernel"

From Bashlinux
Jump to: navigation, search
Line 1: Line 1:
  +
__NOTITLE__
 
__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 under '' ... /source/SRPMS''
+
* Download the sources from the main repository, usually is placed under '' ... /source/SRPMS''
 
<pre><nowiki>
 
 
# cd /usr/local/src
 
# cd /usr/local/src
 
# wget http:// ... /source/SRPMS/kernel-2.6.xxxxx.src.rpm
 
# wget http:// ... /source/SRPMS/kernel-2.6.xxxxx.src.rpm
 
* Install with rpm command
</nowiki></pre>
 
 
# Install with rpm command
 
 
<pre><nowiki>
 
 
# yum install rpm-build
 
# yum install rpm-build
 
# useradd mockbuild
 
# useradd mockbuild
 
# rpm -ivh kernel-2.6.xxxxx.src.rpm
 
# rpm -ivh kernel-2.6.xxxxx.src.rpm
 
* Go to the sources and build the kernel source folder structure
</nowiki></pre>
 
 
# Go to the sources and build the kernel source folder structure
 
 
<pre><nowiki>
 
 
# cd /usr/src/redhat
 
# cd /usr/src/redhat
 
# rpmbuild -bp SPECS/kernel-2.6.spec
 
# rpmbuild -bp SPECS/kernel-2.6.spec
 
* Move the sources to the default location
</nowiki></pre>
 
 
# Move the sources to the default location
 
 
<pre><nowiki>
 
 
# mv /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i386 /usr/src/
 
# 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
 
# ln -sf /usr/src/linux-2.6.18.i386 /usr/src/linux
</nowiki></pre>
 
 
   
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.
+
The folder <tt>/usr/src/linux</tt> 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 <tt>EXTRAVERSION</tt> variable to match the version of current installed kernel.
 
<pre><nowiki>
 
 
# cd /usr/src/linux
 
# cd /usr/src/linux
 
# sed -i "s/^EXTRAVERSION =/EXTRAVERSION = -`uname -r | cut -d '-' -f 2`/" Makefile
 
# sed -i "s/^EXTRAVERSION =/EXTRAVERSION = -`uname -r | cut -d '-' -f 2`/" Makefile
</nowiki></pre>
 

Revision as of 02:01, 6 June 2015

__NOTITLE__

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.

  • 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
  • Install with rpm command
# yum install rpm-build
# useradd mockbuild
# rpm -ivh kernel-2.6.xxxxx.src.rpm
  • 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