OpenEmbedded / Angstrom : build from sources
How to build Angstrom for AT91
Note that building an entire distribution is a long process. It also requires a big amount of free disk space ; at least :
- ~650 MByte of source archives downloaded for Internet
- ~5 GByte of compiled packages and tools
This documentation is largely inspired by the following resources :

For the moment, this building is dedicated to produce a
root filesystem : the Linux kernel you should use is the one built from the
LinuxKernel page. However, the powerfull
bitbake tool will be fed with proper Linux recipes in the future.
To build the binary found in the
OpenEmbeddedAngstromGet page, you will have to go through the following steps.
Pre-requires
Here are the reference pages for setting up an OpenEmbedded building environment.
Note however that most of time, on a development host, those packages are often already installed.
Advices :
- the JIT python compiler Psyco is strongly recommended as it improve building performance
- take a recent version of the monotone SCM as packages are usually available at http://monotone.ca/
Building environment
A step-by-step comprehensive installation is explained in the
OpenEmbedded Getting Started page. The following lines have to be considered as an add-on that is AT91 specific or that can facilitate your setup.
Have a look at the
OpenEmbeddedDirectory to figure out what your working environment tree will look like.
Getting BitBake

For the moment, this building is made with
bitbake 1.8.6. Please use this version while building Linux4SAM.
Take it through the
BitBake build tool website and take the 1.8.6 archive tarball. follow the advice: simply install it in your
OpenEmbeddedDirectory and make a generic link :
ln -s bitbake-1.8.6 bitbake
Getting OpenEmbedded
Once in your
OpenEmbeddedDirectory, download a snapshot of the OpenEmbedded monotone database going to
http://wiki.openembedded.net/snapshots/.

To choose the proper one:
- just take the
OE.mtn.bz2 file and, once the database uncompressed, run a mtn --db=/stuff/OE.mtn db migrate
- or, take the
OE-this-is-for-mtn-0.3x.mtn.bz2 that is in keeping with the version of your monotone program (checked with mtn --version).
Before uncompressing the OE database, it is recommended to verify its integrity :
md5sum -c OE.mtn.bz2.md5sum
Build Process with OpenEmbedded
OpenEmbedded upstream snapshot
We start with an OpenEmbedded snapshot from the official "upstream" OpenEmbedded project. This snapshot contains the BitBake recipes for thousands of packages.
Here is the OpenEmbedded release we build our solution with :
aa44d626baaae40ee498aea453176a8aea90d9fc
So you have to checkout this revision of the OE tree :
mtn --db=/stuff/OE.mtn checkout -r aa44d626baaae40ee498aea453176a8aea90d9fc --branch=org.openembedded.dev
AT91 OpenEmbedded / Angstrom overlay tree or patch
In addition to the upstream recipes, we also have a set of our own recipes or modifications of the original ones. So, the following patch applies to the tree that you just checkouted.

note however that the goal of this patch is to merge the most of it bits into the mainstream OE tree.
Then download and install this patch :
cd org.openembedded.dev
zcat ../oe_angstrom_at91.diff.gz | patch -p1
cd ..
Setup local configuration and environment variables
The local configuration file is derived from the example file
org.openembedded.dev/conf/local.conf.sample . The local configuration is located in
build/conf/local.conf . Here is the
local.conf used to build Linux4SAM root file system.

Read comments in it as it will bring you valuable information and allow you to adapt it to your own environment and building host (directory structure for example).
In addition, some environment variables have to be set before running a build process. We setup those variables via a little script
env-oe.sh :
#!/bin/sh
OE_DIR=/stuff
export PATH=${OE_DIR}/bitbake/bin:$PATH
export BBPATH=${OE_DIR}/build:${OE_DIR}/org.openembedded.dev
Then,
source this script :
source ./env-oe.sh
Start building
Begin with a little set of packages :
bitbake angstrom-minimal-image

even a minimal image will require a big amount of time because of the cross-toolchain building process.
The
console and
graphical images are built using the following recipes respectively :
bitbake angstrom-console-image-demo
bitbake angstrom-x11-image-demo
Tips & tricks
OpenEmbedded
The resulting directory structure explanation :
http://bec-systems.com/oe/html/usage_workspace.html
OpenEmbedded usage
Here is a use case about a project lead with OE :
http://wiki.openembedded.net/index.php/FirstProject
BitBake
BitBake usage:
http://www.uv-ac.de/openembedded/openembedded-3.html#ss3.2
BitBake User Manual
list tasks provided by a package:
bitbake -c listtasks <package_name>
You can use one of those tasks to have a fine grained control over the package building.
The structure of a BitBake file explained:
BitBake Metadata
Hello World examples
http://bec-systems.com/oe/html/recipes_examples.html
The OpenMoko way:
http://wiki.openmoko.org/wiki/Building_a_hello_world_application
http://wiki.openmoko.org/wiki/Application_Development_Crash_Course#Your_First_Application