Thursday, May 20, 2010

Compiling Linux Kernel:Ubuntu

STEP 1: Download latest kernel from http://kernel.org
STEP 2:Extract the downloaded tar file
#tar -xvf linux-2.6.XXXX -C /usr/src#cd /usr/src
STEP 3:Configure Kernel
Make sure development tools "gcc compiler " got installed
#apt-get install gcc
Now type the following command and we can select different options as per our need#make menuconfig
STEP 4:Compilation of kernel
Initially create a compressed kernel image,
#make
Now start compiling to kernel modules
#make modules
Install kernel modules
#make modules_install
STEP 5:Install Kernel
#make install
The above command will install three files into /boot directory
->System.map-2.6.xx
->config-2.6.xx
->vmlinuz-2.6.xx
STEP 6:Creating initrd image
Create using following commands
# cd /boot# mkinitrd -o initrd.img-2.6.xx 2.6.xx
STEP 7:Modify Grub configuration file - /boot/grub/menu.lst
STEP 8:Update the grub
# update-grub
STEP 9:Reboot