Tuesday, July 26, 2011

Kernel Compilation

Kernel Compilation
KERNEL DOWNLOAD: Download the latest one
http://www.kernel.org/pub/linux/kernel/v2.6/
linux-2.6.20.tar.bz2
tar jxf linux-2.6.20.tar.bz2
http://www.linuxelectrons.com/News/HowTO/20040315152255759

for i in `lsmod | awk {'print $1'}`; do find /lib/modules/2.4.27-grsec/kernel/ -iname ${i}.o ; done | wc
lsmod | wc

for i in `lsmod | awk {'print $1'}`; do find /lib/modules/2.4.28-grsec/kernel/ -iname ${i}.o ; done |wc

In 2.6 kernel
for i in `lsmod | awk {'print $1'}`; do find /lib/modules/2.6.20/kernel/ -iname ${i}.ko ; done


cd /usr/src/linux-2.6.24
make clean
make mrproper
make menuconfig

in general tab
==> Processor Type and Features
==> High Memory support
==> select 64 bit
go to general
==> Power management
==> Disable Cpu Scaling
go to general
==> Networking
==> Networking option
==> network packet filtering framework -> netfilter
==> enable network packet filtering debugging
==> core net filtering
==> select all as modules
come back
==> IP net filter
==> select All
go to general
==> Decice Drivers
==> Serail ATA LibATA or Serial ATA Parallel ATA
==> Select all INTEL as modules
==> select libata
==> Select Intel ESB|IDH|PIIX3|PATA
go to genral
==> FileSystem
==> make sure ext2/ext3 enabled
go back to general
==> Quota support On

make
make modules_install
make install

To boot once with the currently compiled kernel use below. Further reboots will be done on the existing kernel.

echo "savedefault --default=2 --once" | grub --batch
reboot

Remember to replace "2" to match your own config!

No comments:

Post a Comment