Compile and Install Linux Kernel 2.6.32.43


We are modifying the TCP kernels of Linux 2.6.32.43 and install the recompiled binary to our server.

1. Install essential tools
# yum install wget
# yum install gcc
# yum install make

2. Download a linux kernel
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.43.tar.bz2
# tar -xjvf linux-2.6.32.43.tar.bz2

3. Configure kernel files
# cd linux-2.6.32.43
# vi Makefile
Rename the kernel by modifying the value of "EXTRAVERSION"
# cp /boot/config-2.6.32.26 ./.configure

4. Configure kernel build options
# make menuconfig

5. Compile the kernel
# cd /usr/src/linux-2.6.32.43
# make -j16

6. Install the kernel
# sudo make modules_install
# sudo make install

7. Configure the grub options
# vi /boot/grub/grub.conf
Set your built kernel to be the default option

8. Reboot into the built kernel
# sudo reboot
# uname -r

9. To speed up the kernel compilation and reduce the kernel image size, the dracut tool can be removed; as a consequence, initrd*.img rather than initramfs*.img will be generated for installation
# yum remove dracut