Setup the BuildSystem

Pre-requisites
You will need to install the following packages:


 * monotone
 * bitbake

Your build host will hopefully have standard packages for installing these. If not, then see the following sites:

BitBake

Monotone

Note that each of these packages in turn probably has its own prereqs -- your host's package manager should take care of those automagically for you. If you're running on an x86 system (not x86-64 yet unfortunately) you'll probably want to install the psyco python accelerator to speed up bitbake. This won't be required, so your host's package manager might not install it by default.

Set up a working directory
You will need about 400MB of space to get started, and for building, another 3GB or so. If you want to do a full extended OpenEmbedded build (not covered in this document), you'll need a few more GB of space to build in. We will assume throughout this document that you will be using the following directory structure:

oe `-- org.gumstix.oe
 * -- build
 * `-- conf

The tarball and setup script will create all these subdirectories for you, but you will need to find a place to locate this top-level "oe" directory. We will call this "oe" directory the "top level of the build system" throughout this doc.

Starter tarball
Download this tarball (~180MB -- sorry!)

Now run this command:

tar xvpf oe-base.tar

This should extract the tarball into your new working directory. The tarball contains the base monotone database (that is, the distributed version control database with a revision history of the changes to the build system in it), plus some config files and setup scripts.

Setup script
Now you are ready to run the setup script, which will initialize things for your use of monotone and bitbake:

cd oe bash gumstix-oe-setup.sh

This script will create a monotone ID for you, then update the monotone database to the latest revision from the remote server. The version in the tarball was just a snapshot which is likely not fully up to date at any given time. After updating the local repository, it will then check out from this database to a local working copy, which is what will be used to actually create your build(s). It will then ask you for a directory into which bitbake should download its source tarballs. Bitbake works by fetching package sources from repositories online, then extracting them, and building them. It will download the tarballs into the directory you specify. This directory will probably want to be outside the "oe" main directory, so that it can be shared system-wide to avoid duplicated downloads. Personally, I've created a "/usr/share/sources" directory which I use for these tarballs.

Complete setup
The main setup script, when it completes, will print out some further instructions on how to complete your setup. This will probably include setting some environment variables, or runnign a script file which the system generated for you, and adding this script to your shell's profile. Do this now.

Check setup (optional)
If you want to, you can check the file oe/build/conf/local.conf to make sure the defaults are sane for your build host.

Build
Ok, now you are ready to build. To do this, you need to follow this mini-recipe:

cd build bitbake gumstix-small-image

The "gumstix-small-image" above is the default gumstix build image. This is what is pre-installed on gumstix at the factory. There are other targets you can build too, but you will want to know more about OpenEmbedded before you do that. Doing a build will take a long time. You can go roast some coffee beans now, then grind them, make coffee, drink it, wait for the caffeine to wear off, go to bed, wake up, make more coffee, and then it might be done. On my quad-core system with very fast RAID, it takes about half an hour to do the gumstix-small-image build from scratch (with tarballs already downloaded).

Results
When the build has completed, you'll end up with a bunch of stuff in the directory oe/build/tmp

See BuildSystemDetails for more information on what to do once the build's completed