The Aboriginal Linux build scripts are the source code for the Aboriginal Linux project. If you would like to build your own cross compiler or target system image from source, use these build scripts. They're written in bash and should be fairly easy to read.

Quick start

Run build.sh with no arguments to see a list of targets. Select a target, and run build.sh $TARGET with the target name in place of $TARGET. When it finishes, run more/dev-environment.sh $TARGET to boot the resulting system image under QEMU, configured for use as a development environment. Type exit to shut down the emulator.

Overview

build.sh runs the following stages, in order:

The top level wrapper script build.sh runs the above stages in order, but each stage script can also be run individually. Each of the above build scripts (except download.sh and host-tools.sh) take a single argument: the name of the target architecture to build code for. Run build.sh with no arguments to see a list of available targets.

Each build stage (except download.sh and host-tools.sh) produces its output in the "build" directory under a subdirectory named after the script plus the target. It also produces a tarball of that directory if the build stage completed successfully. (The download.sh script populates the "packages" directory instead, and host-tools.sh produces its output the directory "build/host" with no tarball version since those programs are intended to run locally.)

All downloaded files wind up in the "packages" directory. Output from compiles is generated in the "build" directory. These are the only two directories the build writes to, and both directories may be deleted (to be recreated by the build scripts). The equivalent of "distclean" is rm -rf build packages from the top level directory.

None of these scripts need to be run as root -- an explicit design goal of Aboriginal Linux is that root access on the host is never required.

Files

The files in the top level directory of the Aboriginal Linux source are:

The sources/ directory contains infrastructure, defining variables and shell functions used by the rest of the build. Most prominently, the the shell functions "setupfor" prepares a temporary copy of the source (extract and patch the relevant source tarballs and cd into the directory), and the shell function "cleanup" deletes that temporary copy when finished. (The actual implementation has some optimizations you can usually ignore.) The function "build_section" does both and calls a build script from sources/sections in between (see sources/sections/README for details).

The sources/targets/ directory contains all target-specific information. Each target has a single file defining all target-specific information, and adding a target just means adding a file to this directory.

The more/ directory contains all the additional scripts the user may want to run directly, but which aren't build stages.

The more/native-build-from-build.sh script (which calls the native-build.sh script in a system-image) uses build control images, externally supplied filesystem images (usually squashfs) which the system image's init script automatically mount on /mnt. Then if the file /mnt/init exists (I.E. an executable "init" script at the top of the build control image), the system image init script will run that file instead of dropping to a shell prompt. This allows arbitrary automated behavior out of the newly booted image, operating on supplied data.