skyBuilders.com > Products > Network > How To Compile Kernel

The skyNetworks Linux Kernel

The kernel is the foundation for skyWalls, skyPipes, skyMonitors, skyTunnels, and skyRoutes (policy-based and cost-based routing).

It is built on Linux kernel release 2.4.19 with Julian Anastasov's patches to allow static routes and alternative routes. (Machines built on later versions of Linux and Julian's patch are also available.)

skyBuilders ships a fully compiled skyNetworks kernel in every skyNetworks product.

Knowledgeable Linux techs might want to compile this kernel for themselves. It can be compiled as a monolithic kernel (no modules, highest security) or with loadable modules (easier to add functionality).

The build sequence includes the following steps.

  1. Download latest tarball for 2.4.19 kernel (linux-2.4.19.tar.bz2) from ftp.tux.org into /usr/src/linux-2.4.19 directory.
    Unzip $bunzip2 linux-2.4.19.tar.bz2
    Untar $tar -xvf linux-2.4.19.tar

  2. Download routes-2.4.19-8.diff patches from Julian Anastasov. (The patch is known to work on Linux 2.4.20) (There is also a patch available for Linux 2.5, routes-2.5.67-9.diff, known to work on version 2.5.67)

  3. Run /usr/src/linux-2.4.19 $patch -p1 -b < routes-2.4.19-8.diff

  4. It helps to familiarize yourself with your hardware. By doing this, any errors encountered after a kernel compilation can be checked against your hardware. To view your hardware, consult the following files:
    /proc/cpuinfo
    /proc/pci
    /etc/modules.conf
    /proc/scsi/*

  5. Edit your top level Makefile, found usually in /usr/src/linux-<version>.
    Red Hat Provides an EXTRAVERSION (near the top) within the Makefile. This is customarily used to help you distinguish between different builds of the same kernel version. Make sure that this is unique with every build, so your modules do not overwrite those of any previously made/installed kernels.

  6. $make clean (deletes object files, etc. from last compile)

  7. $make mrproper (a target defined in Makefile that restores sources to a clean state)

  8. If you are running an X session (i.e. GNOME, KDE, etc.) then $make xconfig or....
    If you are using only a terminal without X-window, use the ncurses version $make menuconfig
    Both utilities save your results to /usr/src/linux-2.4.19/.config)
    (Just a note, by using $make oldconfig, this command will create a new .config file.)

  9. load or edit skyPipes Kernel Configuration Settings into xconfig or menuconfig (edit as necessary, save, and save as config-2.4.19-skyPipes0.<version>)
    When choosing your kernel components, keep in mind the specific hardware on your system and your hardware needs.
    TIPS: Under "Code Maturity Level Options," make sure you check "Prompt for development and/or incomplete code/drivers." If you do not, certain services may fail to work properly (most notably nfsd)
    It is also prudent to copy this file to the /boot/ partition for documentation purposes.

  10. $make dep (This propagates the configurations defined in .config file and the top level Makefile to a subdirectory configuration)

  11. $make bzImage 2>compile_errs.txt (Compiles the kernel)

  12. $grep compile_errs.txt for err (Check for kernel compile errors)

  13. $make modules 2>mod_errs.txt (Compiles the kernel modules)

  14. grep mod_errs.txt for err (Check for module compile errors)

  15. copy (implicitly renaming) bzImage:
    $cp /usr/src/linux-2.4.19/arch/i386/boot/bzImage /boot/vmlinuz-2.4.19-skyPipes0.<version>
    Also check the timestamp on the file, ensuring that it is fresh.
    Uncompressed kernel images are, by convention, named vmlinux while compressed kernel images are named vmlinuz.

  16. $cd /usr/src/linux-2.4.19

  17. $make modules_install
    (Installs the modules into the /lib/modules/<version> directory.)
    IMPORTANT NOTE: If the kernel's version conficts with an already installed kernel, the newer modules will be installed on top of the previous ones, causing a mismatch between the kernel and modules version. (Hence it is critical to rename the EXTRAVERSION in the Makefile).

  18. Copy over the System.map as with the bzImage file
    $cp /usr/src/linux-2.4.19/System.map /boot/System.map-skyPipes0.<version>

  19. Unique to Red Hat:
    $new-kernel-pkg --install --mkinitrd --depmod 2.4.19-skyPipes0.<version>
    This is a bash-script, provided by Red Hat (new to Red Hat 7.2) which automates several tasks:

  20. Otherwise, without Red Hat's new-kernel-pkg script, you can issue these commands manually.
    However, you must also edit your /etc/grub.conf or /etc/lilo.conf file accordingly, so you can boot to your new kernel.
    (If you are using LILO, and you make any changes to the lilo.conf file, you must also issue the command $/sbin/lilo in order to update the LILO boot loader configuration.)

  21. $less /etc/grub.conf (check GRUB or LILO conf file for name of new kernel in first title block)

  22. $reboot to load your new kernel
    If you do not see your new kernel within the boot loader, there is a boot loader misconfiguration.

  23. Once logged in, assuming the new kernel loaded, issue $uname -a to ensure you are running your new kernel

Supplementary Kernel Information - Modules

skyNetworks Kernel Configuration Settings

skyPipes References


Edit  |  workFlow  |  Subscribe
Language: fr  | it  | de  | es  | pt  | ar  | he  | da  | nl  | zh  | ja  | ko  | none 
Author: dtd
skyCalendar

This Version:
Archived at: https://www.skybuilders.com/Products/Network/HowToKernel.20030609115602.html

Requests
 Version: 20034 | Series: 29774 

Search: Site | Web | Groups