Easy crossbuilding of package sets/images
wookey at wookware.org
Tue Oct 11 12:23:12 UTC 2011
One output from the 11.09 release was a reasonably painless way of
cross-building whole images against an archive, which also forms the
basis for an auto-crossbuilder.
There is a HOWTO (for building linaro-nano images) here:
(It uses armel as the example, but should work the same for armhf)
Summary of process
Essentially you can generate a cross-building chroot in one command
(using multistrap), chroot into that (using schroot), and give the
builder (xbuilder-simple) a list of packages to build - either a
pre-generated one for an image, or your own.
It chunters through and builds them all (using xdeb), and leaving
build-logs for each package.
Then at the end (from outside the chroot) you cross-generate an image
from the debs (using multistrap, but the pile could be input for a
different tool if you prefer).
To make this work usefully against a stable (natty) baseline, updated
versions of both tools and packages are in two PPAs at:
This is currently a technology demonstration in so far as some of the
packages needed for a nano image don't successfully cross-build, so
you can't actually currently cross-build all of it, but that should be
fixed quite soon. Anyone who wants to help with that is very welcome.
I've filed current status and remaining bugs here:
The autobuilder can actually run just as well using pdebuild-cross as
xdeb to do the build-work, but that's not been tested for a while and
is not covered in the HOWTO.
The existing xbuilder is pretty stupid (that's why it's called
xbuilder-simple) and it does not yet fully ensure a clean build
environment every time (when using xdeb, it should if using
pbuilder-cross), but it does enough to work reasonably well in
practice. A more rigorous environment reset is on the list of
The current focus is on getting the remaining packages cross-building
so that the whole process works to completeion without cheating by
bringing in pre-built packages from the existing archive (That's a
useful way to proceed if you want to use this tech today - just adjust
the multistrap config to include the base natty armel/armhf archive too)
Once this is completed I'll be setting up a continuously-running
autobuilder so that the cross-buildability or otherwise of packages
can be more easily discovered and more people can get involved in
fixing up packages so that cross-building of larger images becomes
It should be a simple matter of three multistrap config file changes
to use this on an oneiric base, but it broke in a painfull mess of
bind-mounts of deleted /run dirs when I tried it last week, so I'd
hold off that for a little while, and stick with the nice natty-based
examples. I'll add destructions to the HOWTO when I've got it going.
I hope some of you find this useful, or at least interesting. I could
really use some help on fixing up breakage in assorted packages, and
this HOWTO makes it easy to set up a consistent build environment, so
do give it a try and get stuck in if you'd like to see this working
fully sooner rather than later.
Reports of success, breakage, miserable failure, or how this
almost-but-doesn't-quite address your use case are always welcome of
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM
More information about the linaro-dev