Cubieboard 2: Building an image from source part 1

I was debating whether to buy a Raspberry PI or a Cubieboard. Beside having the SATA port, I liked supporting the idea of open hardware and open source software. Unfortunately, Raspberry PI only fulfills the latter, not the former principle, due to the Broadcom BCM2835 chip. As I have very little knowledge of hardware schematics, I am going to have the trust that it is open hardware even if there exists a PDF link available under the Cubieboard resources. Hopefully, it is a psuedo-“open hardware” board like some other “open source” software.

Building from scratch

This is my first experience with building a distribution, so I wanted to setup my board from scratch. For the remainder of this post, I would like to retell my experience building a distribution. In particular, I would like to talk about the Cubieboard2 manifest project. My hope is I will have a smooth time trying to build from the sunxi source once I can validate that a version specific to cubieboard can be flashed to my board.

System Specs

Virualbox 4.3.2

Ubuntu 13.10

  • 8 GB ram
  • 60 GB hard drive
  • Guest additions were installed.

I am not going into the specifics of installing Ubuntu in VirtualBox as this is beyond the scope of this post. I would like to emphasize that the installation was clean, so this will be geared towards those with little experience in building an image.

Installing the Build Tools

After updating Ubuntu with any system updates, the build tools must be installed.

sudo apt-get install build-essential git u-boot-tools texinfo texlive ccache zlib1g-dev gawk gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf bison flex gettext uuid-dev lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 ncurses-dev libusb-1.0-0-dev libusb-dev debootstrap

Downloading the Source

Follow the instructions on the Cubieboard 2 manifest read-me. I have copied my fork of it here:

mkdir ~/bin
curl > ~/bin/git-repo
chmod +x ~/bin/git-repo
mkdir cubieboard2_test && cd cubieboard2_test
~/bin/git-repo init --no-repo-verify -u git:// -b cb2 -m test.xml
~/bin/git-repo sync

Building the Image

Run this command to build the test image.

./ rootfs/linux_test_rootfs.tar.gz

On successful build, there will be a livesuit_cubieboard2.img in the ~/cubieboard2_test/output/pack/ folder. This can be flashed to the Cubieboard.

Flashing the Image

I used Win32DiskImager on Windows 8 to write the image to an micro-SD card, but livesuit should also do the trick. The Cubieboard manifest file has direct download links. Please be sure to download the correct tool.


Hopefully, this will help with building the test image from scratch. In part 2, I would like to explore building other Cubieboard distributions from source.

  • November 30, 2013 – Updated the Ubuntu build dependencies.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s