Monday, July 9, 2007

Lets Compile the KERNEL

step 1 Get source from http://www.kernel.org/pub/linux/kernel/v2.6/ say linux-2.6.18.6.bz2
step 2 unzip it $tar -jxvf linux-2.6.18.6.bz2 , cd to the dir linux-2.6.18.6
or use bunzip2
step 3 Configuration : it saves in .config file
a use oldconfig file cp /boot/config-2.6.16 .config
make oldconfig
make congif or make menuconfig (pseudo graphical)
or make xconfig (graphical)

step 4 make
step 5 make modules_install (copies modules to /lib/modules/VERSION)
step 6 make install (copies vmzlinux image , initrd and system map file to /boot )
also modifies grub.conf(/boot/grub/menu.lst) makes entry for this new kernel

Top kernel Makefile does folllowing things
Reads configuration from .config.
Updates include/linux/version.h
Sets symlink include/asm to our architecture.
Builds include/linux/autoconf.h
Builds include/linux/config.h
Invokes make –f scripts/Makefile.build obj=subdir for each subdirectory