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

Re: pdebuild-cross chroot tweaks for xapt

On Sat, 09 Jun 2012 18:50:32 +0200
Gilles Filippini <pini@debian.org> wrote:

> Until recently, I used to cross-build on my amd64 box a few packages for
> my OpenMoko Freerunner phone (armel).

What versions?

> You'll find below my pdebuild-cross.rc and the multistrap configuration
> files.
> If I set "arch=" (as it used to be) in the multistrap conf file, the
> sources.list in the chroot are forced to amd64 and xapt don't know about
> armel:
>  deb [arch=amd64] http://ftp.fr.debian.org/debian unstable main
>  deb-src http://ftp.fr.debian.org/debian unstable main
>  deb [arch=amd64] http://www.emdebian.org/debian squeeze main
>  deb-src http://www.emdebian.org/debian squeeze main

The chroot is a cross-building chroot, the architecture is the
architecture of the programs which need to be executed not the ones you
are targeting, so amd64 is correct as far as multistrap is concerned.
It probably just means that the multistrap config needs to use the
foreignarches option. It's too late to get this change into wheezy.

packages=dpkg-dev binutils-multiarch build-essential dpkg-cross makedev


Debian-armel would then need to be added to aptsources.

But that's for later, you've already got the chroot, no point in
regenerating it. It can be tweaked.

> Then I tried "arch=armel" but then pdebuild-cross-create fail with:
>  W: Failed to fetch
> http://www.emdebian.org/debian/dists/squeeze/InRelease  Unable to find
> expected entry 'main/binary-armel/Packages' in Release file (Wrong

There are no cross-building toolchains to install on armel.
Cross-building for amd64 on armel is not recommended.

> # pdebuild-cross.rc
> # -----------------------------------------------


> DEBBUILDOPTS="-aarmel"
> MULTISTRAPFILE=/etc/multistrap/armel-sid.conf

This is an amd64 chroot which is configured to have a cross-building
toolchain for armel.


... and this is what determines the architecture of the -cross packages
to be created as build dependencies.

> #arch=
> arch=armel





> packages=g++-4.4-arm-linux-gnueabi linux-libc-dev-armel-cross

i.e. a cross-compiler for installation on amd64.

sudo pbuilder login --configfile /etc/pdebuild-cross/pdebuild-cross.rc

Then remove that [arch=] section of the sources.list and check that
xapt can work. 

Alternatively, duplicate *only* the line relating to the Debian
unstable archive and specify the arch as armel for that one and *ONLY*
that one. Check that xapt can work.

Once that is working, use:

sudo pbuilder login --configfile /etc/pdebuild-cross/pdebuild-cross.rc

Make the changes again but don't do any tests with xapt, this will make
the sources.list changes permanent without polluting the chroot with
temporary changes.

It's a completely standard pbuilder chroot, so the normal pbuilder
commands work - it just has a cross-compiler pre-installed. Once
changed, the chroot will continue operating just fine. The complication
is that the cross-compiler is from stable.

(The pbuilder command above is output if pdebuild-cross-create is
executed when the chroot tarball already exists.)


Neil Williams

Attachment: pgppUbDiTpzjV.pgp
Description: PGP signature

Reply to: