Buildroot
Buildroot is a configurable Makefile which downloads, configures, and builds cross compilers, the kernel, busybox, and most of the other stuff needed for a simple, small complete linux distribution and root file system based on
uClibc C library.
It uses the Linux KConfig configuration system, allowing easy selection of root fs contents.
The Makefile will include the ".config" file generated by KConfig, and the contents
of this file will determine what should be built, and which version should be used.
It is relatively easy to go from there to adding your own programs and such to it so your entire build process is automated.
Home website :
http://buildroot.uclibc.org/
Buildroot will not run on Cygwin. You need a proper Linux installation.
If you have Windows, you should consider installing a VMWare
allowing you to run Linux on top of Windows.
The Buildroot for AT91 can build
- Cross-compiler
- AT91Bootstrap
- U-Boot
- U-Boot configuration scripts
- Linux
- Root file systems of different types
It will take 3-4 hours to run on a P4-3.6 GHz.
Downloading Buildroot
To access the latest trunk, you need to have "subversion" installed
on your machine.
Create a subdirectory and run the command:
$ svn co svn://uclibc.org/trunk/buildroot
The original buildroot for AT91 as published on www.at91.com, is now
considered deprecated, and will not be maintained.
Still it is available for download by the script at the end of this page.
Most, if not all functionality of this, has been transferred to the main
trunk above.
Buildroot Documentation
You should read the documentation in the doc/Buildroot.html file.
Configuring the Buildroot Download location.
Before running buildroot, you should consider adding a default path
for Buildroot downloads. We will use "/usr/local/install/downloads"
in this example.
sudo mkdir -p /usr/local/install/downloads
Then you should add the following line to your ~/.bashrc
export BUILDROOT_DL_DIR=/usr/local/install/downloads
Configuring Buildroot
Buildroot uses the Linux KConfig configuration system. By running
$ make menuconfig
you will compile KConfig and start a menu based configurator.
You should always run menuconfig at least once, before trying any
"make
". If you plan to run a "make <*>_defconfig" command then
you can exit and save immediately.
Configuring Buildroot for the AT91SAM9260? running from a dataflashcard.
$ make menuconfig
$ make at91sam9260dfc_defconfig
$ make > at91sam9260dfc.log 2>&1
The first command will create the initial ".config" file
The second command will copy a valid buildroot configuration
to the ".config" file.
The third command will build everything.
Making a custom project
If you want to create your own board support package,
you start by using one of the basic boards.
(Look in "target/device/Atmel/*" for "<*>_defconfig" files)
make at91sam9260dfc_defconfig will configure to use
the AT91SAM9260? running from the dataflashcard.
Once the config file is OK, you could type:
$ make configured
This will unpack linux and busybox in the "project_build_dir/"
directory and uclibc in the "toolchain/uClibc-" directory.
You can by entering this directory and typing the appropriate command
reconfigure the package.
I.E: In linux the
$ make ARCH=arm xconfig
command would do the trick.
Define a PROJECT name in the buildroot configurator by:
$ make menuconfig
from the top directory of buildroot.
The "project name" can be configured from the "Target options" submenu
By doing
$ make saveconfig
you will save the configuration of busybox, uclibc and linux
in the "local/" directory, and this can be
retrieved by
$ make BOARD=<PROJECT> getconfig
Check http://www.at91.com/phpbb/viewtopic.php?t=3193
Deprecated AT91 Buildroot
#!/bin/bash
# All previous patches was applied to vanilla buildroot from May 31st.
# Most, if not all suggestions from other people have been applied, - thanks!
# Also updated the u-boot-1.2.0-atmel.tar.bz2 so you need to delete this
# from your download directory (default /usr/local/install/downloads)
# --------------
# Updated 2007-06-07: FIx mkimage path problem
# /Ulf
TOPDIR=`pwd`
BUILDROOT=buildroot-atmel
BUILDROOT_VER=2007-06-07
IPADDR=10.175.196.19
SERVERIP=10.175.196.220
GATEWAYIP=10.175.196.1
BUILDROOT_SOURCE=${BUILDROOT}-${BUILDROOT_VER}.cpio.bz2
BUILDROOT_SITE=ftp://at91dist:distrib@81.80.104.162/AT91_Third_Party_Design_Flow/Linux_Host/Source
DL_DIR=${TOPDIR}/Source
UNZIP=bzcat
function prepare_directories()
{
mkdir -p /tftpboot
mkdir -p /usr/local/arm
mkdir -p /usr/local/install/downloads
}
function get_buildroot()
{
if ! [ -d ${BUILDROOT} ] ; then
mkdir -p ${DL_DIR}
wget -P ${DL_DIR} ${BUILDROOT_SITE}/${BUILDROOT_SOURCE}
${UNZIP} ${DL_DIR}/${BUILDROOT_SOURCE} | cpio -idv
fi
}
function set_ipaddresses()
{
cd ${BUILDROOT}
echo "configuring ip addresses"
./netcfg.sh ${IPADDR} ${SERVERIP} ${GATEWAYIP}
cd ${TOPDIR}
}
function make_board()
{
cd ${BUILDROOT}
echo "building board $1"
make B=$1 board
make $2
make saveconfig
cd ${TOPDIR}
}
function make_all_boards()
{
make_board at91rm9200df $1
make_board at91sam9260dfc $1
make_board at91sam9261ek $1
make_board at91sam9263ek $1
}
prepare_directories
get_buildroot
set_ipaddresses
make -C ${BUILDROOT} menuconfig
make_all_boards source
make_all_boards