Upgrading Kernel to 3.3.5


Here I’m upgrading the existing kernel 2.6 to 3.3.5. So, here is the steps I followed to upgrade:

Download the stable kernel from http://boot.kernel.org/

wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.5.tar.bz2

Extract the tar file

tar -xvjf linux-3.3.5.tar.bz2

Change to the extracted folder linux-3.3.5

cd linux-3.3.5

Make sure you have installed all the required packages to upgrade the Kernel. In case if you haven’t, use yum to install those as follows:

yum install kernel-headers kernel-devel gcc

Copy the config file to the current directory.

cp /usr/src/kernels/3.2.12-3.2.4.amzn1.x86_64/.config .

.config file is used for kernel compliation; Don’t forget the . at the end of the command

Now it’s time to run ‘make oldconfig’ command. You’ll be asked a lot of questions. I just kept on pressing enter key except one place where you’ll be asked the processor type. So select the appropriate processor you are using. For rest of the questions you can simply press enter to accept the defaults.

make oldconfig

In case the command ‘make’ is not working, you have to install the development tools as follows:

yum groupinstall “Development Tools”

make clean
make bzImage

{This will take a while to complete. bzImage stands for big compressed kernel image found under directory like somepath/arch/i386/boot/bzImage moved to /boot and renamed as vmlinuz. In short, bzImage and vmlinuz are the same.}

cp arch/x86_64/boot/bzImage /boot/vmlinuz3
chmod a+x /boot/vmlinuz3
cp System.map /boot/System.map3
{system.map – Used by kernel if it needs to recover from fatal errors.}

make modules

{This will again take a lot of time to complete.}

make modules_install

{check /lib/modules for the newly installed kernel version}

mkinitrd /boot/initrd-3.3.5.img 3.3.5

{initrd is used to mount real root file system}

Now it’s time to update grub. So open /boot/grub/grub.conf and change the values of kernel and initrd parameters as kernel /vmlinuz3 and /initrd-3.3.5.img as shown in the figure. Now save this file and reboot your machine.

vi /boot/grub/grub.conf

default=0
timeout=5
password –md5 $1$n6/cJ0$UoUbLOTOsQqUOLlUUqa6b0
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (Upgraded to Kernel 3.3.5)
root (hd0,0)
kernel /vmlinuz3 ro root=/dev/mapper/vg_centos-lv_root rd_LVM_LV=vg_centos/lv_root rd_LVM_LV=vg_centos/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us nomodeset crashkernel=auto rhgb quiet
initrd /initrd-3.3.5.img

:wq!

Once rebooted, you can verify your kernel by issuing ‘uname -r’ command. If it is showing 3.3.5 then the task is completed successfully.

That’s it. Happy Compiling!!!

———————————————————-
Using the same above procedure, I have created a video on upgrading Kernel from version 2.6.32 to 3.4.2. Check the video below:

Advertisements

One response to “Upgrading Kernel to 3.3.5

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s