Tuesday, October 4, 2011

How to compile a linux kernel.

Compiling a new kernel on linux based distro is not a tough task. You just need to have basic knowledge of Linux programming and administration. Follow these steps:-

1) Download a kernel from kernel.org. Keep in mind, the downloaded kernel should be not be very far in version from the base kernel. To know the base kernel version, type this command "uname -r".
I tried it on Fedora 13 and downloaded the kernel 2.6.36 kernel version.
2) Extract the tar ball. ($ tar -jxvf linux-2.6.36.tar.bz2).
3) Change to newly extracted directory.
4) Execute 'make menuconfig'. Don't try to change any thing in it. Just save it (when you exit this script you will asked to save the changes).
5) Run 'make'. It will take more than an hour.
6) Run 'make modules'.
7) Run 'make modules_install'.
8) Run 'make install'.
9) Reboot your system and you will find an entry in grub boot loader. Enjoy ...)

The above are very much easy to execute. Lot's of changes can be done while configuring the kernel 'make menuconfig'. We will look at those changes in the next post.



No comments:

Post a Comment