Kernel customization

First, download and install the kernel source code. The rpm name is kernel-source.rpm.

[root@localhost root]# rpm -ivh kernel-source.rpm

ð It will ask you all the necessary rpm which are must need for kernel-source.rpm.

[root@localhost root]# rpm -ivh ncurses

ð By this program it is easy to change the configuration.

[root@localhost root]# cd /usr/src/linux-2.4

ð Now we go to linux-2.4 directory and give some following commands.

[root@localhost linux-2.4]# make Xconfig

[root@localhost linux-2.4]# make menuconfig

[root@localhost linux-2.4]# make mrproper

ð Make mrproper command are used to check all the necessary rpm are installed or not and can it possible to kernel compilation?

ð Make xconfig to use an X Window system base configuration program to configure the kernel.

ð Make menuconfig is used as text mode to configure the kernel.

After make new kernel configuration, give the command,

[root@localhost linux-2.4]# make dep

[root@localhost linux-2.4]# make bzImage

[root@localhost linux-2.4]# make modules

[root@localhost linux-2.4]# make modules_install

ð After giving this above command, it will take more times and display all the working information. After completion of above commands, the module files will be stored in /lib/module directory.

Now, to know the Red hat version we can execute the command as

[root@localhost linux-2.4]# uname -u


ð It will show the Red hat version number.

[root@localhost linux-2.4]# mkinitrd


[root@localhost linux-2.4]# mkinitrd initrd1 2.4-8

ð To make initrd file. And this file will be created in the current directory and it is called module.

[root@localhost linux-2.4]# ls


.. ... .... ...

ð Now, we will copy the initrd file to "/boot" directory.

[root@localhost linux-2.4]# cp initrd1 /boot/initrd1

ð Here initrd1 is the file name of new initrd.

Another bzImage file will create which is called kernel. The path is given below.

[root@localhost root]# cd /usr/src/linux/arch/i386/boot

[root@localhost boot]# ls


... ... .... ... ...

Now we should copy the file in /boot directory with different file name. Consider file name is vmlinuz-2.4.8

[root@localhost boot]# cp bzImage /boot/vmlinuz-2.4.8

ð Now, it will copy the module file to "/boot" directory.

Now, we will make a new setting in the GRUB boot loader.

[root@localhost root]# vi /etc/grub.conf

# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,9)
# kernel /vmlinuz-version ro root=/dev/hda11
# initrd /initrd-version.img
title Red Hat Linux (2.4.20-8)
root (hd0,9)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

title Red Hat Linux (2.4.20-8)
root (hd0,9)
kernel /vmlinuz-2.4.8 ro root=LABEL=/
initrd /initrd1

title Windows
rootnoverify (hd0,0)
chainloader +1