Skip to main content

Linux Kernel Upgrade

Published: August 12, 2016 Updated: May 25, 2026 Larry Qu 3 min read

Experiment Title

Upgrading the Linux system kernel on CentOS.

Experiment Description

On CentOS 6.5 Final, the kernel version is 2.6.32. Check the kernel version using the uname command: uname -r The target kernel version to upgrade to is 2.6.38.6.

Environment Preparation

  • CentOS 6.5 Final system
  • Install compilation environment
yum groupinstall "Development Tools" "Development Libraries" -y
  • Operate as root user

Command Description

Configure the modules to use through a text menu, generating the .config file in the current directory.

make menuconfig

Compile

make

Install kernel modules to /lib/modules directory

make modules_install

Install the kernel

make install

Start Compilation

  • Extract the kernel to /usr/src/ and create a symbolic link to the linux directory
# tar -jxvf linux-2.6.38.6.tar.bz2 -C /usr/src
# cd /usr/src
# ln -sv linux-2.6.38.6
# ls -l
lrwxrwxrwx. 1 root root 15 Aug 24 19:06 linux -> linux-2.6.38.6/
drwxrwxr-x. 24 root root 4096 Aug 24 21:44 linux-2.6.38.6
# make menuconfig
# make modules_install
# make install
# reboot

After the system reboots, select the new kernel from the boot menu. The kernel upgrade is now complete.

Analysis and Summary

What does the make modules_install command install?

It creates a directory 2.6.38.6 under /lib/modules and places kernel modules there. Let’s take a detailed look.

[root@dev24 modules]# pwd
/lib/modules
[root@dev24 modules]# ls
2.6.32-431.el6.x86_64 2.6.38.6
[root@dev24 modules]# cd 2.6.38.6/
[root@dev24 2.6.38.6]# ls
build modules.builtin modules.ieee1394map modules.order modules.symbols.bin
kernel modules.ccwmap modules.inputmap modules.pcimap modules.usbmap
modules.alias modules.dep modules.isapnpmap modules.seriomap source
modules.alias.bin modules.dep.bin modules.ofmap modules.symbols
[root@dev24 2.6.38.6]# ls kernel/
Documentation arch crypto drivers fs kernel lib mm net sound
[root@dev24 2.6.38.6]# ls kernel/kernel/
trace
[root@dev24 2.6.38.6]# ls kernel/kernel/trace/
ring_buffer_benchmark.ko
[root@dev24 2.6.38.6]# ls kernel/drivers/
acpi cdrom edac hwmon isdn mfd pci rtc uio watchdog
ata char firewire i2c leds misc pcmcia scsi usb xen
atm cpufreq firmware idle md mmc platform ssb uwb
auxdisplay crypto gpio ieee802154 media mtd power staging vhost
block dca gpu infiniband memstick net pps target video
bluetooth dma hid input message parport regulator tty virtio
[root@dev24 2.6.38.6]# ls kernel/fs
autofs4 cifs dlm ext2 fat gfs2 jffs2 nfs nls udf
btrfs configfs ecryptfs ext3 fscache jbd lockd nfs_common squashfs xfs
cachefiles cramfs exportfs ext4 fuse jbd2 mbcache.ko nfsd ubifs

What does the make install command install?

Use the find command to check which files were created (modified) in the /boot directory.

[root@dev24 boot]# find . -ctime -2
.
./System.map-2.6.38.6
./System.map
./vmlinuz-2.6.38.6
./vmlinuz
./grub
./grub/grub.conf
./initramfs-2.6.38.6.img

Linux startup mainly depends on two files: vmlinuz (kernel file) and initramfs (initial file system). The grub file is the system bootloader, and grub.conf contains the boot configuration.

[root@dev24 boot]# cat grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_ctos-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.38.6)
root (hd0,0)
kernel /vmlinuz-2.6.38.6 ro root=/dev/mapper/vg_ctos-lv_root rd_NO_LUKS rd_LVM_LV=vg_ctos/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_ctos/lv_swap rd_NO_DM rhgb quiet
initrd /initramfs-2.6.38.6.img
title CentOS (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_ctos-lv_root rd_NO_LUKS rd_LVM_LV=vg_ctos/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_ctos/lv_swap rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.el6.x86_64.img

We can see that the grub.conf file now includes boot information for 2.6.38. So during startup, there will be two options — whether to boot using the 2.6.32 kernel or the 2.6.38 kernel. The upgrade is now complete.

Comments

👍 Was this article helpful?