Documentation
Setup and Programming
Setting up a build environment First you'll want to check out the source files for the gumstix OpenEmbedded (OE) build system. With a typical DSL connection this step should take about 20 minutes. You should have at least 10GB of free space on your hard drive.
Note: The build sytem is set up to build for Verdex Pro by default. Instructions to set up a build environment for the Overo series are posted here.
Your build machine should be running a fairly recent Linux distribution. The following distributions are known to work:
Depending on your distribution, it is likely you will need to install additional software. If you would like to install these packages up front, the following list includes most of the required packages:
Otherwise you can proceed and you will be prompted to install required packages later in the process.
Note: If you are using an Ubuntu distribution, it is likely that /bin/sh is linked to /bin/dash. If this is the case, then you will need to change /bin/sh to link to /bin/bash. Neglecting to do this will cause file corruption and your build image will not boot! Run "sudo dpkg-reconfigure dash" and answer no when asked whether you want to install dash as /bin/sh.
The only package that is absolutely required to get started is the subversion source code control package. Check to see if your machine has a working copy of subversion:
$ svn --version
If you see version information printed, you are good to go; if you see a "command not found" message, you must install the subversion package for your distribution.
Unless you are an OpenEmbedded expert, it is highly recommended that you follow the directory conventions outlined in these instructions.
You are now ready to check out the source files for the gumstix build system:
$ mkdir ~/gumstix $ cd ~/gumstix $ svn co https://gumstix.svn.sourceforge.net/svnroot/gumstix/trunk gumstix-oe
After this command completes you will have a copy of the gumstix build system source code in your home directory in gumstix/gumstix-oe.
Gumstix OE requires some environment setup in order to function properly. There are a couple of ways to handle this requirement.
It is most convenient (and highly recommended) to set this up via your bash profile:
$ cat gumstix-oe/extras/profile >> ~/.bashrc
With most distributions, adding this environment setup to ~/.bashrc will work for both GUI shells and login shells. If your distribution does not source .bashrc for login shells, you may need to use ~/.bash_profile instead of ~/.bashrc (or modify ~/.bash_profile so that it does source ~/.bashrc).
If you don't want to modify your standard terminal profile for some reason, you can do this environment setup on a per session basis by sourcing extras/profile prior to issuing any build commands:
$ . ~/gumstix/gumstix-oe/extras/profile
or alternatively:
$ source ~/gumstix/gumstix-oe/extras/profile
As part of the build process Gumstix OE downloads source code tarballs for the linux kernel and other software packages. This next step sets up a global system cache for these tarballs so that they only need to be downloaded once. Setting up a global cache may seem like a lot of trouble for a single user system, but it is often quite useful to set up an autobuilder that runs as a cron job under a separate user account. Occasionally you may even want to do experimental work under a seperate user account. Setting this up now will save you disk space and download time later.
On most systems you will need to have root privileges for this step. The process below uses sudo, if your current user is not in the sudoers file you will get an error message. If this happens, use su and enter the root password before issuing the commands below (minus the leading sudo of course).
First we create a new group called oe and add your login account to the oe group. In the second command be sure to substitute your login user name where your_username is indicated.
$ sudo groupadd oe $ sudo usermod -a -G oe your_username
Next we create the directory for the source code cache, set the group owner to the newly created oe group, and finally set permissions on the directory:
$ sudo mkdir /usr/share/sources $ sudo chgrp oe /usr/share/sources $ sudo chmod 0775 /usr/share/sources $ sudo chmod ug+s /usr/share/sources
If you chose Option A for environment setup (bash profile method), log out/log back in or close your terminal window and open a new one so that the environment changes you enabled above will take effect.
If you chose Option B (command line sourcing), issue the command to source the environment setup.
The build sytem is set up to build for verdex by default. If you want to build for basix or connex you will need to edit ~/gumstix/gumstix-oe/build/conf/auto.conf. Comment out the line that selects verdex and uncomment the line that selects connex.
To build a basic root file system image that includes Linux 2.6.21, boa, cron, and ntp:
$ bitbake gumstix-basic-image
If your build machine is missing any essential packages, bitbake will notify you about them at this point. Install the recommended packages and try the bitbake command again.
You will also get a message from bitbake suggesting that you install the psyco JIT compiler for better performance. It isn't necessary to install psyco right now, though it is a good idea to install it at some point.
You may also notice another message complaining about not finding user.collection/packages/*/*.bb. Don't concern yourself with this -- you will create this directory later when you create your first package for your own code.
This initial build will take a bit of time since it will need to download all the source code. When it completes, you will find the root file system image and the kernel image in ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex(or connex if that is the machine type you selected):
$ ls -1 ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/ Angstrom-gumstix-basic-image-glibc-ipk-2007.9-test-20071101-gumstix-custom-verdex.rootfs.jffs2 gumstix-basic-image-gumstix-custom-verdex.jffs2 modules-2.6.22-r1-gumstix-custom-verdex.tgz uImage-2.6.22-r1-gumstix-custom-verdex.bin
You'll notice that there appear to be 2 jffs2 images above. However, in reality there is just one: gumstix-basic-image-gumstix-custom-verdex.jffs2 is a link to the actual image, Angstrom-gumstix-basic-image-glibc-ipk-2007.9-test-20071101-gumstix-customverdex.rootfs.jffs2
The "shorter" link name saves typing :-) Your file names may differ slightly from the above since some are time-stamped or versioned.