Install latest Kernel from source in Fedora/RHEL/Centos

by
Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0

This will show you how to install latest kernel from source in fedora/RHEL/CentOS


This was tested and is workintg fine in Fedora 11 .

The release of my Fedora system was 2.6.29.6-217.2.3 I checked it through the following command.

 [root@localhost src]# uname -a.

1.Download source from kernel.org
# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.5tar.bz2

2.Unpack the source file

#tar xvjf linux-2.6.30.5.tar.bz2

3.Create configuration file
First be sure that packages like kernel-headers kernel-devel and gcc are installed, if not :

 # yum install kernel-devel kernel-headers gcc -y
# cd linux-2.6.30.5
 # cp /usr/src/kernels/ 2.6.29.6-217.2.7.fc11.i586/.config . (dont forget dot   in the  eind of the line)
 [root@test1 linux-2.6.30.5]# make oldconfig

HOSTCC scripts/basic/fixdep

scripts/basic/fixdep.c: In function âtrapsâ:

scripts/basic/fixdep.c:377: warning: dereferencing type-punned pointer will break strict-aliasing rules

scripts/basic/fixdep.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules

HOSTCC scripts/basic/docproc

HOSTCC scripts/basic/hash

HOSTCC scripts/kconfig/conf.o

HOSTCC scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c

SHIPPED scripts/kconfig/lex.zconf.c

SHIPPED scripts/kconfig/zconf.hash.c

HOSTCC scripts/kconfig/zconf.tab.o

HOSTLD scripts/kconfig/conf

scripts/kconfig/conf -o arch/x86/Kconfig

.config:3811:warning: symbol value ‘m’ invalid for GFS2_FS_LOCKING_DLM

*

* Restart config…

*

*

* General setup

4.Compile kernel and copy the new kernel to the /boot directory

# make dep
 # make clean
 # make bzImage
 # cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.30.5
 # chmod a+x /boot/vmlinuz-2.6.30.5
 # cp System.map /boot/System.map-2.6.30.5

5.Compile and install kernel modules

# make modules (take  a long time;  be  patient)
 # make modules_install

6.Create a new initial ramdisk

# mkinitrd /boot/initrd-2.6.30.5.img 2.6.30.5

7.Update GRUB
Edit the /boot/grub/menu.lit file, add the following lines into it.

 # vi /boot/grub/menu.lst

title Fedora (2.6.30.5)
root (hd0,0)
kernel /vmlinuz-2.6.30.5 ro root=/dev/mapper/VolGroup-lv_root rhgb quiet
initrd /initrd-2.6.30.5.img

8.Reboot and verify

[root@test1 ~]# uname -a

Linux test1.unixmen.com 2.6.30.5 #1 SMP Tue Aug 18 10:38:23 EDT 2009 i686 i686 i386 GNU/Linux

For questions please refer to our Q/A forum at : http://ask.unixmen.com/

Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0