Difference between revisions of "Centos-kernel"

From Bashlinux
Jump to: navigation, search
(Redirected page to CentOS Kernel setup)
 
Line 1: Line 1:
 
#REDIRECT [[CentOS Kernel setup]]
__NOTITLE__
 
__NOTOC__
 
= 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 <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.
 
# cd /usr/src/linux
 
# sed -i "s/^EXTRAVERSION =/EXTRAVERSION = -`uname -r | cut -d '-' -f 2`/" Makefile
 

Latest revision as of 22:28, 6 June 2015