build BuildRoot for AT91SAM9x5 family
Introduction
Buildroot is used to build the cross tool chain, a small root filesystem image of different types (jffs2, tar, ubi) and the Atmel 2.6.39 kernel image.
The root filesystem images contain the following applications:
- Busybox
- Audio and video
- Compressors and decompressors
- Hardware handling
- Networking
- bridge-utils
- can-utils
- dropbear
- ethtool
- iperf
- iproute2
- iptables
- lrzsz
- mii-diag
- portmap
- wireless tools
- wpa_supplicant
- Shell and utilities
Get Buildroot
This version is based on the latest Buildroot release: 2011.05. First of all, you have to get Buildroot sources.
You can download the Buildroot archive:
$ wget http://buildroot.uclibc.org/downloads/buildroot-2011.05.tar.bz2
$ tar xvjf buildroot-2011.05.tar.bz2
$ cd buildroot
Or you can use git:
$ git clone http://git.buildroot.net/git/buildroot.git
$ cd buildroot
$ git checkout 2011.05
Then you have to apply the
2011.05-at91_5series_1.0.patch
patch file:
$ wget ftp://ftp.linux4sam.org/pub/buildroot/2011.05-at91_5series_1.0.patch
$ patch -p1 < 2011.05-at91_5series_1.0.patch
$ chmod +x board/atmel/at91sam9x5ek/post-build.sh
$ chmod +x board/atmel/at91sam9x5ek/alsa/post-build_alsa.sh
Build Buildroot
The patch provides a default configuration, to use it you only have to do:
$ make at91sam9x5ek_defconfig
Then begin the building process with:
$ make
The build process is quite long and sources will be downloaded from Internet. Once it is done, you will have the following files:
$ ls output/images/
rootfs.jffs2 rootfs.tar.bz2 rootfs.ubi rootfs.ubifs uImage
rootfs.* files are the root filesystem images and uImage is the kernel image for u-boot.
The toolchain is located into output/host/usr/bin/.
Customizing Buildroot
To setup the filesytem image:
make menuconfig
You can add or remove packages into the
Package Selection for the target section.
You may want to customize the root filesystem by adding configuration file. You can do this by using a post build script called before creating filesystem images. It's what we do for alsa configuration file. You only have to fill the
Custom script to run before creating filesystem images field into the
System configuration section.
Another way is to use a custom Root FS skeleton by selecting
custom target skeleton in
System Configuration -> Root FS skeleton.
You can also customize ownership/permissions and device files by editing
System Configuration -> Path to the device tables.
You can configure the Busybox but you will need to have done a first compilation of Buildroot without customizing it. Then invoke
make busybox-menuconfig. The .config file will be put into the
output/build/busybox directory. Run the compilation of Buildroot again.
For more information, you can have a look on
BuildRoot documentation
In the same way that Busybox, you can configure the uClibc. Make a first compilation of Buildroot without customizing it, invoke
make uclibc-config. The .config file will be put into the
output/toolchain/uClibc directory. Run the compilation of Buildroot again.
For more information, you can have a look on
BuildRoot documentation
If the software you want is not included into Buildroot, you can add it by yourself. There are several ways to add a package. It depends from the build system: generic makefile, autotools or cmake. You can find more information and some examples on the
BuildRoot website