hi all
its chanda here sharing with u how to build new kernel2.x.xx . Initially i was thinking building kernel is impossible but after going through many references its not as difficult as building jvm.. :) So start it simultaneously with me....
1.Before building kernel first check for the following utilities on your machine.
you should have compiler,linker,make and binutility. These are the following commands to check them.
a.gcc --version --> check for the availability of C compiler
b.ld -v --> for binutility
c.make --version -->for make
d.fdformat --version -->for util-linux package
e.depmod -v --> for module-init tool
f.showmount --version --> for nfs utils
2.after checking these components download stable version of kernel from http://www.kernel.org/ which is in tems of Linux-kernel-2.6.26.tar.bz2 file.
3. untar the file in /usr/src directory using the command
/usr/src#tar -xjvf Linux-kernel-2.6.26.tar.bz2
It will produce Linux-kernel-2.6.26 folder in /usr/src
4. goto /boot directory for geting old configuration file and copying it to the untar folder Linux-kernel-2.6.26
#cd /boot
search for the config file using command
#ls config*
which will display config-2.x.xx-xx file
#cp config-2.x.xx-xx /usr/src/Linux-kernel-2.6.26/.config
5. Now we are going to configure kernel using one of the following commands
#make manuconfig
#make gconfig
#make xconfig
Use any one of these. These commands will ask you about configuration options..
It will popup new window containig many options to be configured. Select proper option which you require. Save the file from File menu and quit it..you will be on shell prompt showing the message "#configuration is written to file.config"
6. Now set dependencies using command
#make dep (we are in /usr/src) or(/usr/src/Linux-kernel-2.x.xx)
It just take a second
7.Then do cleaning for remove unnecessary files using
#make clean
8. create bzImage for the new kernel using command
# make bzImage
copy this bzImage to /boot/bzImage-2.x.xx
#cp /usr/src/Linux-kernel-2.x.xx/arch/i386(or x86)/boot/bzImage /boot/bzImage-2.x.xx
9. Now real steps ie compiling kernel by installing module and compiling them
#make modules
#make modules_install
#make install
Last command will install modules in /lib/modules
10. Now last step is checking for the new entry of new kernel we built in bootloader. So for this you have to check which bootloader you are using..grub or LILO by typing
#ls -F /boot grep grub
and
#ls /etc/lilo.conf
If its grub then new kernel entry is automatically added in /boot.grub.menu.lst just above old kernel. Some lines are as follows
title Redhat Enterprise Linux server 2.x.xx
root (hd0,x)
...........
.....
same entry for old kernel
....
.....
savedefault
boot
11.after checking this reboot your machine and select proper kernel from manu list
Or
11. if you are using LILO bootloader then edit /etc/lilo.conf file and add following section
image = /boot/bzImage-2.xx.xx
label = new
read-only
root=/dev/hdax
save the file and quit
12 and type #lilo on shell prompt
13.reboot machine and boot through new kernel.. and enjoy your own kernel of your own configuration..
Monday, April 9, 2007
Subscribe to:
Post Comments (Atom)
1 comment:
yeahhhhh.....its gr8 dear
Best thing abt this kernel lect is tht u hv given the details frm starting...
I know this will be vryyy usefull for all .......speacially for my type of ppl :)
keep it on :)
Post a Comment