Google Plus

Install latest Kernel from source in Fedora/RHEL/Centos

Written by Mel Kham on . Posted in Linux tutorials

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

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • Ris

    Very interesting and helpful article, thanks.

  • Charles

    :?:
    Hello the line
    cp /usr/src/kernels/ 2.6.29.6-217.2.7.fc11.i586/.config .

    Can you please advise me?

    thanks.

    [b]
    [color=yellow]Output:[/color]
    [/b]
    [code]

    [color=red][root@test2 linux-2.6.30.5]$ cp /usr/src/kernels/2.6.29.6-217.2.7.fc11.i586/.config .
    cp: cannot stat `/usr/src/kernels/2.6.29.6-217.2.7.fc11.i586/.config': No such file or directory

    [root@test2 linux-2.6.30.5]$ cp /usr/src/kernels/ 2.6.29.6-217.2.7.fc11.i586/.config .
    cp: omitting directory `/usr/src/kernels/'
    cp: cannot stat `2.6.29.6-217.2.7.fc11.i586/.config': No such file or directory
    [leaf@grapes linux-2.6.30.5][/code]$
    [/color]

  • Pirat9

    Charles:
    Copy the laste kernel that u have in :
    /usr/src/kernels/.
    this example was for my installed kernel . Maybe you have other kernel version!!
    Please try again and let us know .

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Ladi Oyekanmi

|

Could you please assist in step by step on how to install nagios on solaris

Adhraa

|

Greate tutorial :)

pigmej

|

Just one thing:

What about pep8 in your python code ? How can you give ‘tutorials’ on quite popular website, of such a bad quality ?

Amit Rai

|

I just renamed shared.xml and it logged in and created a new shared.xml.

DB Griffin

|

Larry Page is not being completely honest! The manner in which the PRISM program/project works does not need access from company administrators or owners, so called “direct access”; the access to the information is already there. These tech company CEOs take for granted the actual intelligence of most end users of their products. All it takes is a little digging and reading to go from ignorant to informed on these things especially on exactly how the internet works/functions in the U.S.A. I find Larry Page’s remarks just as laughable as Al Gore’s claim to “inventing” the internet/world wide web!

If you, as an end user, are reading this post; I challenge you to research these matters yourself. It really is quite simple with all the “information sites” that exist on the web today ie Wikipedia, & other online encyclopedias that actually list source material, as well as highly respected tech sites and blogs that also list their source material. Be warned: this is only the tip of the iceberg and these tech CEOs know and understand this; they are scrambling in attempt to perform DAMAGE CONTROL to save the company and what little trust thay have left from their products end users/consumers.

Am I a skeptic? I believe someone has to be or needs to be at this point in time! If your not just a little skeptical of the government, tech companies, and the people that are in charge of these agencies and companies; you need to be, even if just a little skeptic. For your own personal protection and security! I know I was a part of this community for over 14 years!

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .