linux poison RSS
linux poison Email

How to compile Linux kernel

You should be root when running any of the below mentioned commands.
First go to the below link and find the latest kernel version. Currently its - linux-2.6.26

Download it using wget
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.gz

And copy it under /usr/src
# cp linux-2.6.26.tar.gz /usr/src

Go to this directory
# cd /usr/src

And extract the kernel from the compressed file. This command will create a new folder called linux-2.6.26
# tar zxf linux-2.6.26.tar.gz

Now go to the directory that contains your new kernel
# cd linux-2.6.26

And get your old configuration
# make oldconfig

If you have qt libraries installed on your system run # make xconfig. This is the graphical configuration system through which you will make all the necessary changes in your kernel. If you have only ncurses installed you may run # make menuconfig
# make xconfig or # make menuconfig

When you have configured everything run make to start compiling your kernel
# make

Then run make modules_install to install your new modules created above.
# make modules_install

And finally create all the necessary files under /boot and also configure grub to include your new kernel
# make install

Reboot and from grub choose the new kernel! If anything goes wrong it means you have made a mistake in the kernel configuration. Boot in with your old kernel and run again make xconfig to do the appropriate changes.
# reboot


0 comments:

Post a Comment

Related Posts with Thumbnails