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.
- 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
- 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)
- Run /usr/src/linux-2.4.19 $patch -p1 -b < routes-2.4.19-8.diff
- 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/*
- 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.
- $make clean (deletes object files, etc. from last compile)
- $make mrproper (a target defined in Makefile that restores sources to a clean state)
- 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.)
- 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.
- $make dep (This propagates the configurations defined in .config file and the top level Makefile to a subdirectory configuration)
- $make bzImage 2>compile_errs.txt (Compiles the kernel)
- $grep compile_errs.txt for err (Check for kernel compile errors)
- $make modules 2>mod_errs.txt (Compiles the kernel modules)
- grep mod_errs.txt for err (Check for module compile errors)
- 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.
- $cd /usr/src/linux-2.4.19
- $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).
- Copy over the System.map as with the bzImage file
$cp /usr/src/linux-2.4.19/System.map /boot/System.map-skyPipes0.<version>
- 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:
- It builds the initial RAM disk
- It generates module dependency information
- It updates the GRUB boot loader
- 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.)
- $make install
- $depmod
- $mkinitrd
- Now check/edit your boot loader configuration files.
- $less /etc/grub.conf (check GRUB or LILO conf file for name of new kernel in first title block)
- $reboot to load your new kernel
If you do not see your new kernel within the boot loader, there is a boot loader misconfiguration.
- Once logged in, assuming the new kernel loaded, issue $uname -a to ensure you are running your new kernel
Supplementary Kernel Information - Modules
- The /lib/modules directory:
Kernel modules reside in /lib/modules/(kernel-version).
The directory name must match the kernel version, as returned by the $uname -a command
- Manipulating the Modules:
Modules are usually loaded by the kernel on demand.
Using $lsmod will list the modules currently loaded in the kernel.
Using $insmod will prompt the kernel to load a particular module
To unload a module, if it idle, use $rmmod <module>
- A more accurate way of controlling modules:
You can find the module dependencies by generating a database of dependencies using $depmod.
However, this does not have to be run manually, since rc.sysinit runs depmod -a at system boot and updates modules.dep.
$modprobe can also be used instead of $insmod. $modprobe will load all underlying modules as required and checks the /etc/modules.conf file for modules parameters (i.e., any aliases that have been given to the modules such as eth0).
- Initial RAM Disk Images - or initrd:
Modules for SCSI, RAID, or any modules required to mount the root filesystem at boot, will be stored in a file called initrd.
This is a compressed image of the filesystem and it contains all the modules required to mount the root filesytem at boot time. Using $mkinitrd will create this initial RAM disk but in order for this disk to be used, the boot loader must be configured to do so.
- A quick glance at /etc/grub.conf.
- To find information on the modules themselves, use $modinfo.
skyNetworks Kernel Configuration Settings
skyPipes References