AIM: Upgrade the Linux Kernel to 2.6.39
Note:
1. Before upgrade: the kernel is 2.6.38-8 (ubuntu-11.04)
2. After upgrade: the kernel is 2.6.39
Before kernel compilation make sure the following list of components are installed on the system.
1. gcc compiler and related tools
2. ncurses (new curses) library
3. initramfs tools
Note: User should be superuser to use some of the commands mentioned below.
If gcc compiler and tools are not installed then use the following command to install development tools
# apt-get install gcc
If ncurses library is not installed then use the following command to install
# apt-get install libncurses5-dev
Check and make sure that initramfs tools are available at the following location
/etc/initramfs-tools/
Steps to get the kernel and compile it:
1. Download the kernel version 2.6.39 from the following location
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.bz2
2. Go to the location where the kernel is downloaded. Use the following command to extract the tar file to the location /usr/src
# tar -xjvf linux-2.6.39.tar.bz2 -C /usr/src/
3. Go to the following location to compile kernel.
# cd /usr/src/linux-2.6.39/
Note: If you go thru the README file in the location /usr/src/linux-2.6.39/, it suggests the following
"Do NOT use the /usr/src/linux area! This area has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be."
I suggest you to please read and understand the README file before installing/compiling the kernel.
4. Before configuring the kernel, create a folder kernelbuild at home location
# cd /home/
# mkdir kernelbuild
5. Configure kernel,
# cd /usr/src/linux-2.6.39
# make O=/home/kernelbuild/ menuconfig
Note: A user interface would pop-up to select the kernel configuration. At this point of time, I am not sure what configuration is required. So, I 'exit'ed. While exiting it prompts the following statement,
Do you wish to save your new configuration? <ESC><ESC>
to continue.
Here, select the option 'Yes'.
6. Build/Compile kernel,
# make O=/home/kernelbuild/
7. Install kernel modules,
# make O=/home/kernelbuild/ modules_install install
Note: This generates an updated grub.cfg file at the location /boot/grub/. Note that initrd image location would not be available for the generated linux image at this time. (e.g., here the generated linux image is vmlinuz-2.6.39 at /boot/)
8. Before kernel installation,
# make oldconfig
Note: It asks permission for new config files. I have selected 'y' or 'm'. Select an appropriate config file option as per your requirement.
9. Install kernel,
# make
10. Create an initrd image,
# cd /boot/
# update-initramfs -c -k 2.6.39
Note: It generates initrd.img-2.6.39
# update-grub
Note: Makes entry of initrd image location for kernel 2.6.39 in grub.cfg file located at /boot/grub/
11. Restart the machine,
# reboot
Now, your machine is ready with an option to boot with new kernel 2.6.39.
Note:
1. Before upgrade: the kernel is 2.6.38-8 (ubuntu-11.04)
2. After upgrade: the kernel is 2.6.39
Before kernel compilation make sure the following list of components are installed on the system.
1. gcc compiler and related tools
2. ncurses (new curses) library
3. initramfs tools
Note: User should be superuser to use some of the commands mentioned below.
If gcc compiler and tools are not installed then use the following command to install development tools
# apt-get install gcc
If ncurses library is not installed then use the following command to install
# apt-get install libncurses5-dev
Check and make sure that initramfs tools are available at the following location
/etc/initramfs-tools/
Steps to get the kernel and compile it:
1. Download the kernel version 2.6.39 from the following location
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.bz2
2. Go to the location where the kernel is downloaded. Use the following command to extract the tar file to the location /usr/src
# tar -xjvf linux-2.6.39.tar.bz2 -C /usr/src/
3. Go to the following location to compile kernel.
# cd /usr/src/linux-2.6.39/
Note: If you go thru the README file in the location /usr/src/linux-2.6.39/, it suggests the following
"Do NOT use the /usr/src/linux area! This area has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be."
I suggest you to please read and understand the README file before installing/compiling the kernel.
4. Before configuring the kernel, create a folder kernelbuild at home location
# cd /home/
# mkdir kernelbuild
5. Configure kernel,
# cd /usr/src/linux-2.6.39
# make O=/home/kernelbuild/ menuconfig
Note: A user interface would pop-up to select the kernel configuration. At this point of time, I am not sure what configuration is required. So, I 'exit'ed. While exiting it prompts the following statement,
Do you wish to save your new configuration? <ESC><ESC>
to continue.
Here, select the option 'Yes'.
6. Build/Compile kernel,
# make O=/home/kernelbuild/
7. Install kernel modules,
# make O=/home/kernelbuild/ modules_install install
Note: This generates an updated grub.cfg file at the location /boot/grub/. Note that initrd image location would not be available for the generated linux image at this time. (e.g., here the generated linux image is vmlinuz-2.6.39 at /boot/)
8. Before kernel installation,
# make oldconfig
Note: It asks permission for new config files. I have selected 'y' or 'm'. Select an appropriate config file option as per your requirement.
9. Install kernel,
# make
10. Create an initrd image,
# cd /boot/
# update-initramfs -c -k 2.6.39
Note: It generates initrd.img-2.6.39
# update-grub
Note: Makes entry of initrd image location for kernel 2.6.39 in grub.cfg file located at /boot/grub/
11. Restart the machine,
# reboot
Now, your machine is ready with an option to boot with new kernel 2.6.39.