Spin up a Raspberry Pi cross compiler with distcc support as a Vagrant VM
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ctng-configs
misc
prebuilt-toolchains
provisioning
README.md
Vagrantfile

README.md

rpi-cross

There are plenty of good things to say about the Raspberry Pi, but there’s one thing I could do without: Waiting for compilation! The venerable Pi’s ARM11 is showing its age …

This project is meant to help: Using VirtualBox, Vagrant, crosstool-NG, and Ansible, rpi-cross will automatically set up an Ubuntu VM with a cross compilation toolchain optimized for Raspberry Pi and a distcc daemon, ready to cross compile both locally and over the network.

Sound good? Let’s make it happen. Contributions very welcome.

Status

rpi-cross is a work-in-progress. Right now, testers are needed to confirm the following features:

  • setup of a prebuilt toolchain
  • unattended toolchain compilation using crosstool-NG
  • distcc setup and configuration

All of these work for me, but I’m sure there are plenty of kinks to work out. Whatever your experience, please do provide feedback! :)

Requirements

  • Vagrant with VirtualBox, version 1.6.5 (current)
  • Ansible, again (as it happens) v1.6.5 or higher

Note that Ubuntu may ship with outdated versions, so apt-get install will not suffice — instead, follow the instructions on developers’ homepage to get the most recent stable release.

Earlier version may work, but no guarantees; Vagrant < v1.5 and Ansible v1.5.4 are known not to work. Development is done against Vagrant stable and Ansible HEAD.

Quickstart

If you know what you want, this will probably be enough get you going. If not, please follow the Guide below.

  • install the dependencies (note the version requirements)
  • choose between building your own toolchain with crosstool-NG, or using a prebuilt one:
    • option A (default): the prebuilt toolchain will be downloaded automatically
      If you substitute your own tarball, make sure to match the folder structure.
    • option B: choose a crosstool-NG configuration file or create your own
  • modify ctng_* or xt_prebuilt[_url] in Ansible’s playbook.yml according to your choices of the previous step
  • vagrant up to set up and start the VM

(Note: The custom build takes quite a long time (~40 min on my machine) and unfortunately offers little feedback: Ansible doesn’t show the client’s stdout. You could monitor the CPU usage, but that’s not very satisfying. You’ll just have to wait it out.)

Now, vagrant ssh into the machine and inspect the results: If all went well, you’ll find the toolchain in ~/x-tools6h, and the distcc daemon is running and open for connections from 192.168../16.

Usage Guide

The guide has been moved to this Wiki page.

Project Goal

My intention is to provide a beginner-friendly tool, useable without deep knowledge of the involved tools. Using a provisioning tool like Ansible has several advantages:

  • fully automated setup and configuration,
  • maintainability and adaptability,
  • transparent, precise documentation of all steps involved.

You can simply treat the resulting setup as a black box, but if curiosity (or necessity) strikes, you can look at its blueprints — and change them.