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 :

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.

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 OEDirectoryTree to figure out what your working environment tree will look like. In the following procedure, each time we speak about the base directory, we refer to the stuff directory.

Getting BitBake

Take it through the BitBake build tool website and take the latest archive tarball. follow the advice: simply install it in your OEDirectoryTree and make a generic link:

tar xvzf bitbake-1.8.18.tar.gz
ln -s bitbake-1.8.18 bitbake

Getting OpenEmbedded

Once in your OEDirectoryTree, download a snapshot of the OpenEmbedded database using the GIT Souce Code Management tool.

git clone git://git.openembedded.org/openembedded openembedded
or using HTTP protocol:
git clone http://repo.or.cz/r/openembedded.git openembedded

Warning, important Make sure to call the directory where you will clone the GIT source openembedded. This name will be used in the following procedure and in the site.conf configuration file.

Then create a local branch based on OpenEmbedded stable/2009 branch:

cd openembedded
git checkout -b stable_2009_mybranch origin/stable/2009
cd ..

For demo root filesystems available in the GettingStarted page, we used the following commit ID : a646269c2ada7691d8a7f7455ba4528c7cca3483 . The stable/2009 branch should be stable enough to be able to build using those instructions even with a more recent HEAD for this branch.

AT91 OpenEmbedded overlay tree

In addition to the upstream recipes, we also have a set of our own recipes or modifications of the original ones. So, the following overlay tree will modify current OE original recipes.

Pointing hand note however that the goal of those recipes is to merge the most of it bits into the mainstream OE tree.

Description Sources Patch
OpenEmbedded database Web interface:
http://cgit.openembedded.org/
branch: stable/2009
overlay directory tree archive

Then download and install the overlay tree archive, be sure to be in your OEDirectoryTree and:

wget ftp://ftp.linux4sam.org/pub/oe/linux4sam_x.y/oe_at91sam.tgz
tar xvzf oe_at91sam.tgz

This archive contains the configuration files, recipes that will overload the original ones from the OpenEmbedded project. The oe_env.sh script will allow you to setup local configuration variables needed for your rootfs to build.

Setup local configuration

The local configuration is located in oe_at91sam/conf/local.conf . This configuration file will overload the openembedded/conf/local.conf one.

Pointing hand 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). Choose the proper machine type: we will use at91sam9m10g45ek for this setup:

MACHINE ?= "at91sam9m10g45ek"

Start building

Be sure to always be in your OEDirectoryTree.

To start the building, source the oe_env.sh script:

source ./oe_env.sh

Then begin building the distribution with a little set of packages:

bitbake base-image

Warning, important 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 console-at91sam9-image
bitbake x11-at91sam9-image

Or for AT91SAM9M10 based boards:

bitbake x11-at91sam9m10-image
This will allow you to take advantage of video features of this chip. This image will include kernel and Gstreamer components needed to use the hardware video decoder.

Tips & tricks

OE Link collection

From the BUG community, here is a very good link collection :
Three Steps for OpenEmbedded N00Bs

Wonder how to customize an OpenEmbedded building based on AT91 SOCs? Here is a simple and clear step by step blog:
Customizing OpenEmbedded

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

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


I Attachment Action Size Date Who Comment
Unknown file formatgz oe_angstrom_at91-2.diff.gz manage 194.9 K 2008-12-12 - 12:56 NicolasFerre linux4sam_1.4_20081212
Unknown file formatgz oe_angstrom_at91-3.diff.gz manage 195.9 K 2009-07-23 - 15:17 NicolasFerre linux4sam_1.6_20090723
Unknown file formatgz oe_angstrom_at91.diff.gz manage 192.5 K 2008-04-15 - 13:13 NicolasFerre linux4sam_1.2_20080415