Going Forward
Introduction
This page collects all material that allows you to build the demo binaries from sources.
It is a summary of building instructions for each component found on
http://www.linux4sam.org/twiki/bin/view/Linux4SAM
Building the components from sources
For this demo revision :
Sources
Sources and build process are described in the
AT91Bootstrap application note page on
http://www.atmel.com .
You can also retrieve them from
ftp://www.linux4sam.org/pub/at91bootstrap .
A rewritten version of AT91bootstrap which fixes the page boundary problem
and also supports some other options is available
as part of the buildroot project at
http://buildroot.uclibc.org/
Build process
To compile an
AT91Bootstrap project:
- go into the board directory
- select your board by going into the corresponding board directory
- select your media by going into the corresponding directory
- run make
Example:
To compile a DataFlash boot project for AT91SAM9260-EK board, type the following commands:
cd board/at91sam9260ek/dataflash
make clean
and
make
or if you want to specify the cross-compiler :
make CROSS_COMPILE=<path_to_cross-compiler/cross-compiler-prefix->
path_to_cross-compiler is only needed if it is not in your
PATH.
Usually
cross-compiler-prefix- looks like
arm-linux- or
arm-elf-
For this demo revision :
- y.y.y -> 1.1.5
- x.x -> 1.7
Sources
To get the u-boot bootloader sources for AT91 product you have to go through the following steps (note that x.x.x and y.y must be replace by the corresponding revision numbers) :
- download the u-boot sources from the link in the first column below and extract it:
wget ftp://ftp.denx.de/pub/u-boot/u-boot-x.x.x.tar.bz2
tar xvjf u-boot-x.x.x.tar.bz2
cd u-boot-x.x.x
- take the corresponding AT91 u-boot patch set (second column):
wget http://www.linux4sam.org/twiki/pub/Linux4SAM/U-Boot/u-boot-x.x.x_atmel_y.y.diff.bz2
- apply it on top of the original u-boot:
bzcat u-boot-x.x.x_atmel_y.y.diff.bz2 | patch -p1
You will have a fresh source copy of the AT91 u-boot.
Build process
Once the AT91 u-boot sources available, cross-compile u-boot is made in two steps : configuration and compiling. Check the
Configuration chapter in u-boot reference manual.
Note that both arm-elf- and arm-linux- ARM GCC cross-compiler types are suitable for u-boot building.

Some newer version of
make produce errors while compiling this u-boot. We advice you to use an older
make executable: check the
SoftwareTools page.
Here are the building steps for the AT91sam9263ek board:
make distclean
make at91sam9263ek_config
make CROSS_COMPILE=<path_to_cross-compiler/cross-compiler-prefix->
path_to_cross-compiler is only needed if it is not in your
PATH.
Usually
cross-compiler-prefix- looks like
arm-linux- or
arm-elf-
The result of these operations is a fresh u-boot binary called
u-boot.bin corresponding to the binary ELF file
u-boot.
-
u-boot.bin is the file you should store on the board
-
u-boot is the ELF format binary file you may use to debug u-boot through a JTag link for instance.
For this demo revision :
- xx -> 24
- experimental patch : 2.6.24.at91.2-exp.patch
Sources
To get an experimental Linux4SAM kernel up and running on an AT91 product, you have to go through the following steps:
1. identify on which linux kernel revision the experimental patches will apply
2. download the corresponding Linux kernel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.xx.tar.bz2
tar xvjf linux-2.6.xx.tar.bz2
cd linux-2.6.xx
3. download the AT91 Maintainer's patch and apply it
wget http://maxim.org.za/AT91RM9200/2.6/2.6.xx-at91.patch.gz
zcat 2.6.xx-at91.patch.gz | patch -p1
4. take the experimental patchset and apply it on top of the AT91 one
wget ftp://www.linux4sam.org/pub/linux/2.6.xx-at91-exp.patch.gz
or
wget ftp://www.linux4sam.org/pub/linux/2.6.xx.at91.y/2.6.xx.at91.y-exp.patch.gz
And then :
zcat linux-2.6.xx-at91-exp.diff.gz | patch -p1
You will now have an updated copy of the experimental Linux4SAM kernel.
Build process
Now you have to configure the Linux kernel according to your hardware. First identify your kernel revision, your board and then, download the corresponding configuration file. Default configuration files are provided
here.
wget http://www.linux4sam.org/twiki/pub/Linux4SAM/LinuxKernel/at91sam926yek_defconfig
cd linux-2.6.xx
cp at91sam926yek_defconfig .config
make ARCH=arm oldconfig
At this step, you can modify default configuration
make ARCH=arm menuconfig
And build the Linux kernel image
make ARCH=arm CROSS_COMPILE=<path_to_cross-compiler/cross-compiler-prefix->
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.
Sources
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
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