Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Dartino enabled Raspbian images

Michael Thomsen edited this page Feb 4, 2016 · 2 revisions

On our SDK bots we create images of Raspbian which have Dartino agent and vm preinstalled. In addition, the image is prepared for being setup using the script in platforms/raspberry-pi2/flash_sd_card.

Building locally

We have a copy of a slightly modified image of Raspbian, together with a kernel working on the qemu, on gcs. You can update this by taking a fresh image from raspbian, then run the script tools/raspberry-pi2/qemufy-image.sh on the image (this is not something we do often, only when we need a new image from raspbian). Then put the image inside third_party/raspbian/image (see below how to pull that) and use upload_to_google_storage to push the new version and update the sha1 file.

The current image is pulled down by doing:

download_from_google_storage -b dartino-dependencies -u -d third_party/raspbian/

The image is big (1.3 gb), so we don't pull it down in normal checkouts. The above download command is a no op (except for calculating the sha) when you already have it.

In order to build the custom Raspbian image we first need to create a Debian package containing the Dartino agent and vm using the following two commands.

tools/create_tarball.py
tools/create_debian_packages.py

You should now have out/dartino-VERSION.tar.gz and out/dartino-agent_VERSION-1_armhf.deb now, with VERSION being the current version. We need to pass these to the image creation script below. The image creation script does in place editing of the image, so do:

cp third_party/raspbian/image/jessie.img out/jessie.img
tools/raspberry-pi2/raspbian_prepare.py --image=out/jessie.img --src=out/dartino-VERSION.tar.gz --agent=out/dartino-agent_VERSION-1_armhf.deb

Change VERSION in the above to the actual version.

This script takes a while to complete. The output of QEMU is put into .qemu_log and not interleaved with the rest of the output (by design), this file is not written until the end of the script (but will be written on failures).

Debugging bot issues.

The output of running the image creation script is in the stdio under the "Modifying Raspbian image" step. The output of running qemu is under qemulog, but that link is under annotated steps (yes, this is confusing). See picture:

Why using qemu to build

We are using qemu to build the image since this require no sudo (which is good for running on the bots). It also, seems to be stable enough.