# BuildRoot-at91 2020.04

<abstract>
BuildRoot is a set of makefiles and patches that makes it easy to generate a low footprint Embedded Linux System. 
</abstract>

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

## Notes

We illustrates here just how to generate the just rootfs contents. For the bootloader and Kernel image please read
these articles:

* @article='at91bootstrap'
* @article='roadrunner_compile_kernel_4_19'

The article contents has been tested using a Linux PC with Ubuntu 18.04.4 64bit

It is advisable to have a [Debug Port Interface](/DPI) or another serial adapter

## Building procedure

Install on your Linux PC the requested packages listed here:

* <http://buildroot.uclibc.org/downloads/manual/manual.html#requirement-mandatory>

Download BuildRoot from the Microchip repository on GitHub:

	git clone https://github.com/linux4sam/buildroot-at91.git

Select the right branch:

	cd buildroot-at91
	git checkout linux4sam-2020.04 -b buildroot-at91-linux4sam-2020.04

Insert the Acme Systems setup files applying this patch:

	wget https://raw.githubusercontent.com/AcmeSystems/acmepatches/master/buildroot-at91-2020.04.patch

and apply it by typing:

	patch -p1 < buildroot-at91-2020.04.patch
	make acme-bertad2_defconfig
	
Launch the rootfs contents compilation:

	make

This operation will take about 1 hour to download and compile any source of any part of your Linux distribution. 

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

	rootfs.tar

Create two partitions on microSD using gparted:

	| Type  | Label  | Size  |
	+-------+--------+-------+
	| fat32 | boot   | >8MB  |   
	| ext4  | rootfs | >70MB |
	
Copy the bootloader, the linux kernel and the device tree blob generated before on the first microSD 
FAT partition:

	cp boot.bin /media/$USER/boot
	cp at91-sama5d2_roadrunner.dtb /media/$USER/boot/acme-roadrunner.dtb
	cp zImage /media/$USER/boot

Untar the rootfs contents in the second microSD partition:

	sudo tar xvf output/images/rootfs.tar -C /media/$USER/rootfs

Unmount the microSD and boot it on your RoadRonner board.

At login and password prompt type:

* login: __root__
* password: __acmesystems__

## How to install new package on rootfs


To install new packages from the menuconfig menu type:

	make menuconfig
	
Then exit and save the new configuration by typing: 

	make savedefconfig

##Related links

* [Linux4sam BuildRoot](https://www.linux4sam.org/bin/view/Linux4SAM/BuildRoot)
* [The BuildRoot user manual](http://buildroot.uclibc.org/downloads/manual/manual.html)
* [BuildRoot web page](http://www.buildroot.net/)
* [Browseable BuildRoot repository](http://git.buildroot.net/buildroot)
* @article='at91bootstrap'
* @article='roadrunner_compile_kernel_4_19'



