web analytics

Kernel Compilation

KERNEL RECOMPILATION
+++++++++++++++++++++

Mainly 2 purposes:

1. Reduce the size of the kernel
2. Activation and deactivation of support for devices.

Packages to be checked when upgrading from 2.4 to 2.6
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

o Gnu C 2.91.66 # gcc –version
o Gnu make 3.77 # make –version
o binutils 2.9.1.0.25 # ld -v
o util-linux 2.10o # fdformat –version
o modutils 2.4.2 # insmod -V
o e2fsprogs 1.19 # tune2fs
o reiserfsprogs 3.x.0b # reiserfsck 2>&1|grep reiserfsprogs
o pcmcia-cs 3.1.21 # cardmgr -V
o PPP 2.4.0 # pppd –version
o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version

2.6.x series
=============
o Gnu C 2.95.3 # gcc –version
o Gnu make 3.78 # make –version
o binutils 2.12 # ld -v
o util-linux 2.10o # fdformat –version
o module-init-tools 0.9.10 # depmod -V
o e2fsprogs 1.29 # tune2fs
o jfsutils 1.1.3 # fsck.jfs -V
o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
o xfsprogs 2.1.0 # xfs_db -V
o pcmcia-cs 3.1.21 # cardmgr -V
o quota-tools 3.09 # quota -V
o PPP 2.4.0 # pppd –version
o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
o nfs-utils 1.0.5 # showmount –version
o procps 3.1.13 # ps –version
o oprofile 0.5.3 # oprofiled –version

Determine Current Hardware
++++++++++++++++++++++++++

1. /sbin/lspci
2. cat /proc/cpuinfo
3. cat /proc/meminfo
4. df -h
5. ethtool eth0 (to find the speed)
Download Source
++++++++++++++++

from http://kernel.org/pub/linux/kernel/v2.6/

1. cd /usr/src
2. tar xfvj /path/to/linux-2.6.latest.bz2

Upgrading module-init-tools
+++++++++++++++++++++++++++

1. wget http://www.netmax.org/Download/SOURCE/packages/subsystems/SOURCE/
module-init-tools-3.1.tar.bz2

2. tar -xjf module-init-tools-3.1.tar.bz2
3. cd module-init-tools-3.1
4. ./configure –prefix=/
5. make moveold
6. make
7. make install
8. ./generate-modprobe.conf /etc/modprobe.conf

Backup .config
++++++++++++++

1. cd linux-version (latest)
2. cp /boot/config-2.6.9-42.0.3.ELsmp(current version) .config
3. make oldconfig

Configuration:
++++++++++++++++

1. make menuconfig

Please check the following link to search for a particular module
http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-6
In this main thing we have to consider are:

1. Processor type, SMP support and Hyper Threading
2. All devices in lspci should be enabled.
3. If memory is > 2GB -> enable high memory.
4. Networking IP tables support
Network device support (lspci)
5. Device Drivers
SCSI Support:
Scsi generic support
Low Level Devices
Select SATA Controller
6. Filesystem

Ext2 and ext3 support + quota support

2. make -j4 bzImage
3. make modules or make -j4 modules
4. make modules_install

5. cp .config /boot/config-2.6.18
6. cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.18
7. cp System.map /boot/System.map-2.6.18
8. mkinitrd /boot/initrd-2.6.18.img 2.6.18
9. Edit /etc/grub.conf with

title Red Hat Linux (2.6.18)
root (hd0,0)
kernel /vmlinuz-2.6.18 ro root=LABEL=/ panic=3
initrd /initrd-2.6.18
10.
Enter following commands.
grub
savedefault –default=1 –once
quit

11. Reboot

after that try restarting apf
if an error occurs change
set monokern =0 to 1 in apf.conf

to apply grsec patch
download the patch from http://grsecurity.com/download.php
wget http://grsecurity.com/grsecurity-2.1.10-2.6.19.2-200701222307.patch.gz
gunzip grsecurity-2.1.10-2.6.19.2-200701222307.patch.gz
patch -p1 < grsecurity-2.1.10-2.6.19.2-200701222307.patch

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>