[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Using sbuild with qemu-user-static - was: Re: TODO list for Debian/Linux m68k



Hi!

On 11/12/2015 03:34 PM, Laurent Vivier wrote:
> For the qemu-m68k part, I've tried to merge it after the qemu-2.4
> release, but there have been some comments and I have to rewrite a major
> part of the instruction translator. I need to find some time...

Today realized that this can be extremely useful for building packages
for m68k and other slower/older architectures.

I was playing around with combining chroot with qemu [1] and tried to
cross-build packages with sbuild which turned out to be successful.

I made a test setup for armel as follows:

$ apt-get install sbuild qemu-user-static binfmt-support
$ cd /srv/chroots
$ debootstrap --no-check-gpg --variant=buildd --foreign --arch=armel
unstable sid-armel-sbuild ftp://ftp.debian.org/debian
$ sbuild-update --keygen
$ cat /etc/schroot/chroot.d/sid-armel-sbuild
[sid-armel-sbuild]
description=Debian sid chroot for armel
type=directory
directory=/srv/chroots/sid-armel-sbuild
#groups=Debian,guest,d-i
#profile=dsa
#aliases=sid
groups=root,sbuild,glaubitz,buildd
root-groups=root,sbuild,glaubitz,buildd
#command-prefix=
#source-root-users=glaubitz,sbuild,buildd
#run-setup-scripts=true
#run-exec-scripts=true
$ adduser glaubitz sbuild
$ cp -av /usr/bin/qemu-arm-static /srv/chroots/sid-armel-sbuild/usr/bin
$ chroot sid-armel-sid
$ ./debootstrap/debootstrap --second-stage

After that, I could cross-build xbill for armel under my normal user
with:

# sbuild --source --arch=armel --arch-all -d sid xbill_2.1-8.dsc

This can be done analogously for sh4 with the exceptions that libmpfr4
and libgomp10 need to be installed manually here as they are available
in the unreleased suite only which debootstrap doesn't support.
Furthermore, qemu-sh4 doesn't implement syscall 186 [2] and segfaults
on an amd64 host [3] but I assume these issues should be fixable. With
the help of workaround, I am now cross-building using this setup for
sh4.

Unless I have overlooked anything, this sbuild configuration should work
without any issues with the buildd package and hence can be used to
set up a very fast buildd :). Thus, it might be a very good alternative
to Aranym once Laurent's patches have been merged with qemu upstream.

Adrian

> [1] https://wiki.debian.org/QEMU
> [2] https://bugs.launchpad.net/qemu/+bug/1516408
> [3] https://bugs.launchpad.net/ubuntu/+source/qemu-linaro/+bug/1254824

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: