Kernel Recompilation


Here I am giving some steps how to complie kernel? By default RedHat will not support the ntfs partitions mounting. So we will do kernel recompilation and get the job done.

Step1 : Before Compiling the kernel the following packages should be installed in order to compile kernel
a. Glib-devel
b. Gcc
c. Ncurscs-devel
d. Binutils
e. Kernel-sourcecode

Step2 : Download the latest kernel from http://www.kernel.org/ and copy the .tar.bz2 file to /usr/src folder
#cd /usr/src
#wget
http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.25.4.tar.bz2
#ls

Here you have to see the downloaded file from the kernel.org

Step3 : Now unzip the compressed kernel in the same folder it self
#tar xvfj linux-2.6.25.4.tar.bz2
#ls
Now here you will find a folder with name
linux-2.6.25.4
#cd linux-2.6.25.4

Step4 : If you have compiled any kernels previously first you have to clear any unwanted enteris in source kernel
#make mrproper

Step5 : Before recompiling the new kernel we have to take the backup of the old kernel in order to restore it. If in case you face any issues with the new kernel
#make oldconfig
This backed up kernel configs are stored in /usr/src/kernel/.config

Step6 : So now every thing is fine the left part is to compile kernel, to do that we have to execute the following command
#make menuconfig

About this command : Actually kernel have so many modules(like process management, memory management, network management, filesystem management, device managemn) etc, So this command will give a menu kind of list where you can select the different modules.

Linux kernel is Modular kernel, so all the management parts what I have discussed will not be loaded in to kernel at once, The menu will show some check marks.

Type1 : Square brackets []
If you want the module to be part of kernel select it

For example :

[*] indicates yes
[]
indicates
no

And this <> type of brackets are used to mention wether that option should be a module or built in.

For example :

< > for a feature indicates that feature is not included in the kernel
the feature is inculeded in kernel but it’s a module.
<*>the feature is inculeded in kernel as a built in feature.

So when you execute the above command you will get a menu in this menu select the filesystem->ntfs file system. And save it (here I am giving clear idea about how to select the filesystem type you do your R&D work and get the things done).

Step7 : So now we have to compile this kernel with added features and to create a bz image file
#make

Note : This step will take more time say some 15 to 30 min depends on the features you have selected

Step8 : Once again we have to say to kernel which are reloadable modules by executing the following command
#make modules_install

Step9 : Now we have to execute the follwing command to copy this kernel image to /boot and edit the grub.conf file so that from next boot
#make install
That’s it its done

Some links for your additional :

http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
http://www.nongnu.org/lpi-manuals/lpi-102/html/ch01s03.html
http://www.netbsd.org/docs/guide/en/chap-kernel.html
http://www.geekcomix.com/cgi-bin/classnotes/wiki.pl?UNIX02/Kernel_Recompilation

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Related Posts by Categories



    2 comments:

    XT said...

    NICE TO SEE REGULAR UPDATES

    KEEP POSTING DUDE

    Surendra Kumar Anne said...

    Thanks for the comments man

    Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here