I’ve used the following page as a reference while building a kernel – http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html.
Below is a list of steps required to compile a kernel with virtual server support. If you don’t need this functionality please ignore steps 6 and 13.
- Logged in as root, downloaded and extracted kernel source code.
wget http://www.osoffice.co.uk/linux/raq4-sb-kernel-source/2.6/linux-2.6.16-raq4-source.tar.gz tar -xzf linux-2.6.16-raq4-source.tar.gz -C /usr/src cd /usr/src/linux-2.6.16-raq4-standard/
- Installed compiler and required libraries.
yum install gcc ncurses-devel
- To prevent overwriting any existing kernel modules on the system modified kernel version to something unique in
VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 16 EXTRAVERSION = -ipvs
- Current kernel configuration settings are stored in
/proc/config.gz. Since I only need to make minor changes to the configuration it would be wise to re-use the configuration file.
zcat /proc/config.gz > /usr/src/linux-2.6.16-raq4-standard/.config
- Run the configuration utility. Configuration file
.configcreated in previous step will be loaded automatically.
- In the menu, selected
Networking -> Networking options -> IP: Virtual Server Configurationand then made the following choices:
IP virtual server support (EXPERIMENTAL) [ ] IP virtual server debugging (NEW) (12) IPVS connection table size (the Nth power of 2) (NEW) --- IPVS transport protocol load balancing support [*] TCP load balancing support [*] UDP load balancing support [ ] ESP load balancing support (NEW) [ ] AH load balancing support (NEW) --- IPVS scheduler round-robin scheduling weighted round-robin scheduling least-connection scheduling weighted least-connection scheduling locality-based least-connection scheduling locality-based least-connection with replication scheduling destination hashing scheduling source hashing scheduling shortest expected delay scheduling never queue scheduling --- IPVS application helper FTP protocol helper (NEW)
- Removed compiled kernel that came with the source files.
- Compiled the kernel.
- Compiled and installed all the loadable modules.
make modules make modules_install
- Made a backup of the current kernel.
cp /boot/vmlinux.bz2 /boot/vmlinux-`uname -r`.bz2 chmod 0644 /boot/vmlinux-`uname -r`.bz2
- Compressed and installed the kernel. Since one of the Strongbolt forum users experienced a problem booting kernel compressed with default settings (see http://www.osoffice.co.uk/forum/viewtopic.php?f=7&t=391), compression level 4 was used.
bzip2 -4 vmlinux cp vmlinux.bz2 /boot
- Rebooted the server.
- Loaded virtual server kernel modules.
modprobe ip_vs ip_vs_rr