Posted by: kezhong | July 19, 2009

Building a New Kernel

Linux is probably the only operating system that has a new kernel every so often. The most common reason to upgrade a kernel is to take advantage of some newer device drivers to handle some specific devices or you need to upgrade due to a bug in the kernel.

The release of my Fedora system was I checked it through the following command.
# uname –r 

Then I upgraded it to 2.6.30 as below steps. 

1.Download source from
# cd /usr/src
# wget 

2.Unpack the source file
#tar xvjf linux-2.6.30.tar.bz2 

3.Create configuration file
Firstly, I installed the “kernel-devel”, “kernel-headers”, and “gcc” packages.
# yum install kernel-devel kernel-headers gcc -y
# cd linux-2.6.30
# cp /usr/src/kernels/ .
# make oldconfig 

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
# chmod a+x /boot/vmlinuz-2.6.30
# cp /boot/ 

5.Compile and install kernel modules
# make modules
# make modules_install 

6.Create a new initial ramdisk
# mkinitrd /boot/initrd-2.6.30.img 2.6.30
Note: The format of the mkinitrd command: mkinitrd <image file> <kernel version> 

7.Update GRUB
Edit the /boot/grub/menu.list file, add the following lines into it.
# vi /boot/grub/menu.list
title Fedora (2.6.30)
            root (hd0,0)
            kernel /vmlinuz-2.6.30 ro root=/dev/mapper/VolGroup-lv_root rhgb quiet
            initrd /initrd-2.6.30.img 

8.Reboot and verify

SYA710 Building a New Kernel



  1. Nice post Steven !!!

  2. cool.. there is online kernal patch available too.. go try it, and let me know how stable it is, hehe..

    • what an indolent guy! hehe!

  3. Also can do as
    5.Compile and install kernel modules
    # make modules
    # make modules_install
    # make install
    Then chmod a+x /boot/vmlinuz-2.6.30

  4. 1. cd /usr/src/kernel
    2. wget “”
    3. tar xvfj linux-
    4. cd linux-
    5. make clean && make mrproper
    6. make menuconfig
    7 make clean
    8. make -j 7 bzImage
    9. make -j 7 modules
    10. make -j 7 modules_install
    11. make install

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: