This document gives an overview of how to prepare your Elemental Linux Server (ELS) installation to be able to build a custom kernel.
You will need to have the ELS 'Extra Applications' CD-ROM mounted on /media/cdrom. and access the the Linux kernel source code (either downloaded from the internet or from the ELS 'Source' CD-ROM.)
The instructions below describe how to get the system ready to compile a new Linux kernel.
The following example shows how you would carry out the steps above using an ELS CD-ROM mounted on /media/cdrom and a source code directory of /home/joe/src.
cd / tar -zxf /media/cdrom/extra/gcc-4.2.4.i586.tar.gz tar -zxf /media/cdrom/extra/perl-5.10.i586.tar.gz cd /opt/bin ln -s ../gcc-4.2.4/bin/* . ln -s ../perl-5.10/bin/* . mount -o remount,rw /usr ln -s /opt/bin/perl /usr/bin/perl mount -o remount,ro /usr mkdir /home/joe/src mount -o remount,rw /usr ln -s /home/joe/src /usr/src mount -o remount,ro /usr cd /usr/src tar -zxf /media/cdrom/src/linux-2.6.25.10.tar.gz ln -s linux-2.6.25.10 linux cd linux zcat /proc/config.gz > .config
The following instructions give a general idea of how to build a custom kernel, but do not go into the details of what options to configure. Your system requirements are unique and so your exact kernel configuration will be unique as well.
The following example shows the commands used to build a new kernel.
cd /usr/src/linux make menuconfig make cp /boot/vmlinuz /boot/vmlinuz.old cp /boot/System.map /boot/System.map.old make install make modules_install
If you elected to build a kernel without loadable module support, you may skip the last step.
Reboot to test your new kernel. If things do not go well and the system is not bootable, you can use the vmlinuz.old kernel as a fallback.
Here's how to use the backup kernel if the new kernel makes the system unbootable:
You may also wish to consult Kwan Lowe's Kernel Rebuild Guide for a more detailed tutorial on kernel building.