7.6. Tour of the Source Tree

7.6.1. Makefile Overview

Currently, the make system is a single Makefile that includes make snippets from other places in the tree. This setup allows you to easily depend on other make rules but also means all rules must exist in a flat namespace. Notice that the rules and variables in each .rul file use a common prefix. For example, every rule in the parted.rul file begins with "parted_", and every variable begins with "PARTED_". Another thing to keep in mind when working within this system is that all paths are relevant to the toplevel. We may change to a recursive make style build system at some point.

7.6.2. Third Party Software

The SystemImager build system builds a mini Linux distribution called boel that runs on clients during an autoinstall (See "Additional Installation Information" in Chapter 3 for more information on boel). The initrd.img file contains a subset of boel that is small enough to fit on a 1.44MB floppy. After the client has booted and brought up networking, it receives the boel_binaries.tar.gz file and extracts it over the root of the filesystem, providing an additional set of commands, libraries, and kernel modules that may be needed during the installation.

Most of the software in boel is built from third party source and is not included in the CVS tree, although it is packaged up with released source tarballs. The build system must therefore be able to access these third party source tarballs to extract them and build the necessary binaries.

Each .rul file for a third party package contains a target for the source tarball. The rules for these targets run the getsource script in the toplevel tools/ directory. getsource will look around your system for a source tarball (/usr/src, and the toplevel of the build tree), or will, as a last resort, use wget to download the source tarball from the Internet. It is highly recommended that you copy any downloaded source to one of those locations so that you only download it once. Although it may not cost you anything to download source repeatedly, there is an associated cost for the people running the servers from which you're downloading. Running make clean attempts to remove everything except these third party tarballs, while make distclean removes everything including the third party tarballs.

7.6.3. Boel Libraries

On i386, uClibc http://uclibc.org is used within the initrd in order to keep it small enough to fit on a floppy. For the initrds for other architectures and for the binaries in boel_binaries.tar.gz on every architecture, the mklibs script copies over the required libraries from the build system. If appropriate pic libraries are found (e.g., the libc6-pic package in Debian), mklibs can take advantage of them and reduce the libraries to only the functions needed by the binaries.

Binaries that will be dynamically linked against need to be built using uClibc wrappers, which is why the PATH variable gets explicitly set for all the initrd binaries.