Empowering your IT Initiatives

HBI has a proven track record of meeting demanding quality and delivery schedules in highly competitive markets.
Linux Home PREV TOC NEXT
Compiled by Skylab & Amit Mund

 

 
Kernel Recompilation

Need for kernel recompilation

Kernel recompilation is essential when we have to add some additional features to the existing kernel. For instance, mounting the NTFS file system of windows.

Process of Recompilation

To recompile the kernel we have to install the source code from the Red hat installtion cd.It comes as a RPM package.To install the kernel get into the
# rpm -ivh kernel-source *
* defines your kernel
To reconfigure we must be in the bash shell

Goto

/usr/src/linux -*(your kernel version)
and type # make mrproper
If kernel recompilation is done earlier, it cleans up all the files. This prepares you for the new kernel reconfiguration.

then type


# make Xconfig

in GNOME or KDE desktop
Through the graphical interface you can select the required modules.The main advantage of Xconfig is that, it allows you to select only those areas of the kernel you want to change.
If Xconfig is not started try with
# make menuconfig

Tips or essentials in kernel recompilation

processor type should be selected
ext3 file system should be selected.It is normally unselected in menuconfig.
<*> compile into kernel
<m> compile as module






save the changes.

Then type

# make dep
All the dependencies packages will be checked .Then prepare the source tree.

Then type

# make clean
It will prepare the source tree

then

# make bzImage
It takes time depending on the system configuration.The recompiled kernel will be in /usr/src/linux*/arch/i386/boot as compressed image.

then run

# make modules.
Modules are compiled as loadable modules using this option
then run
# make modules _install
After some time our system is ready for booting with the new kernel.
To add the kernel in boot loader.
We can use either GRUB or LILO boot loader for the new kernel.
First copy the new image in the /boot directory
# cp /usr/src/linux*/arch/i386/boot/bzImage /boot/bzImage

then

edit the grub.conf files.
#vi /boot/grub/grub.conf
Add the entries
title RedHat linux
root (hd0,4)
kernel /bzImage

Reboot the system. In the grub loader select the new kernel and boot. Now you are with the recompiled kernel.
Linux Home
PREV
TOC NEXT