Building Up Your ARMs
Creating boot images for Cubieboards
Due to the impending finish of the EU FP7 funded User Centric Networking1 I recently had cause to revisit the excellent work that Thomas Leonard did for the project in getting Xen/ARM running on the Cubieboard2 and Cubietruck (aka Cubieboard3).
The resulting repo, mirage/xen-arm-builder, had languished for several months and the past SD card images had some problems and had been allowed to drop off the ‘Net as a result. However, sterling work by Ian Campbell at a recent Mirage hackathon had started to resurrect this work based on the Alpine Linux distribution. This seemed a promising place to start, so I did :)
Building an Image
The end result was an enormous pull request that splatted a Brave New
World on top of Thomas’ work.
The README
is hopefully reasonably self-explanatory but in summary,
-
Clone the repo:
git clone https://github.com/mor1/arm-image-builder.git cd arm-image-builder
-
Use the
make
targets:make all # runs `make prepare build image` # make prepare # clones repos, pulls tarballs # make build # use Docker to build the `linux/` and `u-boot/` trees # make image # finally, create the on-disk `sdcard.img`
This clones the necessary repos (Linux, u-boot), builds them, and then puts
together the image file sdcard.img
in the current directory. If on OSX, make
sdcard
will then attempt to write that to a blank, mounted SD card. This does a
rather hacky auto-discovery of where the SD card might be mounted; if in doubt,
and in any case, always safer to simply
MNT=the-correct-mount-point make sdcard
…or simply use your favourite tools to write the sdcard.img
file to your SD
card.
Using the Image
The end result should be an SD card that you can use to boot your device into Alpine Linux v3.4. At present, completing installation requires then:
- resetting the environment,
- completing Alpine setup via
the
setup-alpine
script, - (if desired) installing Xen via the
/media/mmcblk0p1/alpine-dom0-install.sh
script created as part of building the SD card image, - (if desired) finally,
building Alpine
and/or Debian
domU
s via the/media/mmcblk0p1/alpine-domU-install.sh
and/media/mmcblk0p1/debian-domU-install.sh
scripts, also created as part of building the image.
Hopefully the net result is you end up with a Cubieboard2/3 running Xen with an
Alpine Linux dom0
and some domU
images available.
As ever, comments, patches, pull requests welcome!
-
Grant No. 611001 for those who care. ↩