#Building BuildRoot 2015.11

<p class="text-success lead">
BuildRoot is a set of makefiles and patches that makes it easy to generate a complete 
and very small Embedded Linux System. It can generate any or all of a cross-compilation toolchain, 
a root filesystem, a kernel image and a bootloader image. 
</p>

<a href="http://buildroot.uclibc.org/about.html">
<img src="./buildroot.jpg"/>
</a>



## Notes

* This procedure was tested on a Linux PC with Ubuntu 15.04
* It is advisable to have a [Debug Port Interface](/DPI) 
* This article explains how to create only the rootfs contents. To generate the bootloader (at91bootstrap) 
and the Linux kernel image (zImage), please refer to the specific tutorials.

##Building procedure

Download BuildRoot version 2015.11 from its repository:

<ul>
<li>
<a href="http://buildroot.uclibc.org/downloads/buildroot-2015.11.tar.bz2">
Download buildroot-2015.11.tar.bz2
</a>
</li>
</ul>

Decompress the .bz2 file in your home directory and move inside the new directory:

<pre class="terminal">
~$ <b>tar xjvf buildroot-2015.11.tar.bz2</b>
~$ <b>cd buildroot-2015.11</b>
~/buildroot-2015.11$ 
</pre>

At this point I suggest to create a your own personal branch
of Buildroot sources with [git](https://git-scm.com/) to keep a trace of any changes from the
mainline. Use these commands:

<pre class="terminal">
~/buildroot-2015.11$ <b>git init</b>
~/buildroot-2015.11$ <b>git add .</b>
~/buildroot-2015.11$ <b>git commit -m "Buildroot vanilla"</b>
~/buildroot-2015.11$ <b>git branch acme</b>
~/buildroot-2015.11$ <b>git checkout acme</b>
</pre>

Download this patch file from GitHub:

* [buildroot-2015.11.patch](https://raw.githubusercontent.com/AcmeSystems/acmepatches/master/buildroot-2015.11.patch)

and apply it by typing:

<pre class="terminal">
~/buildroot-2015.11$ <b>patch -p1 < buildroot-2015.11.patch</b>
</pre>

Select the configuration of your board:

###Arietta basic configuration

<pre class="terminal">
~/buildroot-2015.11$ <b>make acme-arietta_defconfig</b>
...
</pre>

###Aria basic configuration

<pre class="terminal">
~/buildroot-2015.11$ <b>make acme-aria_defconfig</b>
...
</pre>

###Acqua basic configuration

<pre class="terminal">
~/buildroot-2015.11$ <b>make acme-acqua_defconfig</b>
...
</pre>

If you're running an Ubuntu distribution at 64 bit, install the <b>libc6-i386</b> (sudo apt-get install libc6-i386)

Install __liblz4-tool__ (sudo apt-get install liblz4-tool) used to generate the Linux Kernel zImage

Save and exit from the configuration menu and launch the BuildRoot compilation.
 
This operation will take about 1 hour to download and compile any 
source of any part of your Linux distribution. 

<pre class="terminal">
~/buildroot-2015.11$ <b>make</b>
...
</pre>

If everything goes well you will obtain these binary files in __output/images__ directory:

* The whole root file system contents: __rootfs.tar__ 

Uncompress the rootfs content inside the second partition of the microSD:

<pre class="terminal">
<b>sudo tar xvf output/images/rootfs.tar -C /media/$USER/rootfs</b>
</pre>

Unmount the microSD and boot.

At login:

* login: __root__
* password: __acmesystems__

##Related links

* [The BuildRoot user manual](http://buildroot.uclibc.org/downloads/manual/manual.html)
* [BuildRoot web page](http://www.buildroot.net/)
* [BuildRoot G+ page](https://plus.google.com/100084591154899263420/posts)
* [Browseable BuildRoot repository](http://git.buildroot.net/buildroot)

