It is always good to say that you have latest kernel running in your machine. I have upgraded kernel from debian experimental and testing repositories . That was simple and straight forward. But you get real happy when you build a kernel from the source.
This was my first experience in upgrading kernel to 3.0.4 from source and even I don't know whether I can successfully complete or not. But I did this and love to share my experience with all you guys!
Before dive in to this just walk-through this document to learn about kernel.
Download the latest kernel from Linux Kernel Archive
# wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.4.tar.bz2
Extract the kernel
# bzip2 -dc linux-3.X.tar.bz2 | tar xvf -
Move to the directory where kernel source code is extracted
# mv linux-3.0.4/
Configure your kernel
Use make menuconfig or make config for configuring your kernel. I tried make menuconfig this will give you text based menus
# make menuconfig
Make the kernel
# make bzImage
Making kernel modules
# make modules
This will compile all the modules for kernel 3.0.1
Install the modules compiled
# make modules_install
This will copy all kernel modules to /lib/modules/3.0.4.
Install the new kernel
# make install
This will copy files vmlinuz-3.0.4, initrd.img-3.0.4 and config-3.0.4 to your /boot directory.
Execute below command in your shell, if initrd.img-3.0.4 is not created.
# update-initramfs -u -k 3.0.4
Configure your Grub
This document explains how to configure new kernel in grub2. grub users please excuse. Check below link to learn more about grub2
Edit /etc/grub.d/40_custom file and add below configuration for new menu item. Please make sure that you are not removing anything which already present in this file
menuentry 'Ubuntu, with Linux 3.0.4' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set c933488a-c517-465e-9ecf-4744806b3a7a
linux /boot/vmlinuz-3.0.4 root=UUID=c933488a-c517-465e-9ecf-4744806b3a7a ro quiet splash
initrd /boot/initrd.img-3.0.4
}
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set c933488a-c517-465e-9ecf-4744806b3a7a
linux /boot/vmlinuz-3.0.4 root=UUID=c933488a-c517-465e-9ecf-4744806b3a7a ro quiet splash
initrd /boot/initrd.img-3.0.4
}
c933488a-c517-465e-9ecf-4744806b3a7a is the UUID. replace this ID with yours. For more information about UUID, wikipedia is the good source.
Use below command to find the UUID
# blkid
Update your grub configuration
# update-grub
Reboot with new kernel
Now reboot your machine. Once you boot with new kernel, execute uname -a in your shell to find the kernel version.
Linux pranavam 3.0.4 #1 SMP Sun Sep 4 12:28:48 IST 2011 i686 GNU/Linux