simple examples of how to

Sunday, November 6, 2011

[Linux] How to upgrade linux kernel

1. Downloading Linux kernel source

You can find Linux kernel source code in https://github.com/torvalds/linux.
In this github, you can browse, trace the history of changes, etc.

In order to download the source code, you need to install git.
For instance in ubuntu, try
$ sudo apt-get install git-core

Then,
$ git clone https://github.com/torvalds/linux.git

2. Configuring, Compiling, and Installing

In the top folder of the source code (for instance, linux-2.6.32), in order to use the configuration of the current Linux kernel, try this
$ cp /boot/config-
.config

Then, try
$ make menuconfig

in the text-based GUI, you can find a button in the below that "load configuration from .config".
This will looad the configuration of your current kernel into the download kernel source code.

Then, try
$ make && make modules && make modules_install && make install

the above sequence of commands will compile the kernel, modules, and install the modules and install the kernel. At this step, the kernel installation is onlyfor vmlinuz but not for the initrd.
In order to install initrd, try the following.
$ update-initramfs

This command will automatically find the missing part of initramfs in /boot folder and install the missing part.

Then you need to update-grub to apply the changes in the grub.
$ update-grub

That is all. Reboot now.

You will see the new kernel in the grub while booting.


No comments:

Post a Comment