smida.it

Buildroot on Cubieboard

Buildroot is a building environment which builds from scratch a full operating system directly from the sources, setting up a minimal configuration. Is configurable via Kconfig and is possible to build for multible platforms.

The cool thing about buildroot and the reason why I prefer it over the others is that the image built is very small and as you will see it's fairly easy to create.

Another cool property is that all the sources are fetched using git (alas sometimes hg).

In this page we are going to see how to use buildroot for building an operating system for the Cubieboard , development board for the Allwinner A20 chipset.

The board

The cubieboard when boots checks first if there is an SD card with a valid bootloader, in this case prioritizes the boot from the microSD rather than the internal NAND memory.

This makes our life easier for installing our OS built with buildroot.

Get and compile buildroot

Download buildroot directly from the sources:

$ git clone git://git.buildroot.net/buildroot
$ cd buildroot
			

Configure it:

$ make cubieboard2_defconfig
			

I used the cubieboard2 configuration because I have the cubieboard2. For the first version of cubieboard the config file is cubieboard_defconfig.

At this point could be useful to add some more packages to the build. By running:

$ make menuconfig
			

you get into a menu where it is possible to add more software, like ssh, less, vim, etc. If you are familiar with the Linux Kernel, this buildroot's menuconfig reminds the linux menuconfig, also the shortcuts are the same (use '/' to search the package you wish).

Once you saved the configurations just hit:

$ make
			

At the end of the compilation everything is ready to copy the operating system on the SD card. To help on this there is a script which takes care of prtitioning the disk, install u-boot and copy the Kernel and the file system. Insert the micrSD card and run

# ./board/cubietech/cubieboard/mkcubiecard.sh output/images/ /dev/sdc
			

The script must be executed as root.

At this point the the SD card is ready, insert it in the slot and boot the board.