[buildd-tools-devel] Bug#610689: Bug#610689: sbuild: cross support

Hector Oron hector.oron at gmail.com
Sat Jan 22 23:41:41 UTC 2011


Hello,

2011/1/22 Roger Leigh <rleigh at codelibre.net>:

> It should work with sbuild today (once schroot does this).  The check
> should still succeed when --arch is used (after all, it's a sanity
> check to ensure we have the correct build arch in the chroot).  If
> "dpkg --print-architecture" returns the emulated arch in the chroot
> (and since it's the native m68k package I would assume it should return
> the correct value), then that should be sufficient.  Is this how qemu
> works?  Would it return m68k on amd64 in an m68k chroot with qemu?

Yes.

zumbi at enorme:~$ file test/bin/ls
test/bin/ls: ELF 32-bit MSB executable, PowerPC or cisco 4500, version
1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8,
with unknown capability 0x41000000 = 0xf676e75, with unknown
capability 0x10000 = 0x70401, stripped
zumbi at enorme:~$ sudo chroot test
enorme:/# dpkg --print-architecture
powerpc
enorme:/# dpkg-architecture
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/bin/sh: gcc: command not found
dpkg-architecture: warning: Couldn't determine gcc system type,
falling back to default (native compilation)
DEB_BUILD_ARCH=powerpc
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=powerpc
DEB_BUILD_GNU_CPU=powerpc
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=powerpc-linux-gnu
DEB_HOST_ARCH=powerpc
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=powerpc
DEB_HOST_GNU_CPU=powerpc
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=powerpc-linux-gnu
enorme:/# exit
zumbi at enorme:~$ dpkg --print-architecture
amd64

>> On the previous options described above, we might want to develop some
>> syntax in the control files which can mark packages to be able to be cross
>> built or built emulated. Sbuild should decode that information from control
>> file information, then set accordingly --host, --build or whatever we call them,
>> but I am afraid this naming might help confusing things much more with build,
>> host and target.
>
> What's the use case for such information?

I was just thinking we might want to tag a local built package (or a
kernel package)
to be cross-built, but yes, it seems to be a chicken-egg problem.

> --emulate should never be necessary should it?  If the emulation is
> completely transparent, why would we need to be informed about it, and
> what could we do with the information?

It should not be needed, I was just thinking on adding extra information. We
get a source package uploaded to amd64 host, how do you know if you want
to build native, cross build or build in an emulated environment? for which
architecture do we want it to be built?

> Could I possibly see an example of its command-line usage and output?
> One thing we would need to do it know what it installed/removed so we
> can reverse it post-build.

I do not think xapt has an option to remove packages. A brute-force option
would be to remove *-$arch-cross packages from chroot.

(experimental)zumbi at enorme:~$ sudo xapt -a armel -M
http://ftp.uk.debian.org/debian -S unstable -k hello
apt-get  -o Apt::Get::Download-Only=true -y -o Apt::Architecture=armel
-o Apt::Install-Recommends=false -o Dir::Etc=/var/lib/xapt/etc/xapt/
-o Dir::Etc::TrustedParts=/etc/apt/trusted.gpg.d -o
Dir::Etc::Trusted=/etc/apt/trusted.gpg -o
Dir::Etc::SourceList=/var/lib/xapt/etc/xapt/sources.list -o
Dir::Etc::SourceParts=/var/lib/xapt/etc/xapt/sources.list.d/ -o
Dir::State=/var/lib/xapt/ -o
Dir::State::Status=/var/lib/xapt//armel/dpkg/status -o
Dir::Cache=/var/lib/xapt/ update
Get:1 http://ftp.uk.debian.org sid Release.gpg [835B]
Ign http://ftp.uk.debian.org/debian/ sid/contrib Translation-en
Ign http://ftp.uk.debian.org/debian/ sid/contrib Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ sid/main Translation-en
Ign http://ftp.uk.debian.org/debian/ sid/main Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ sid/non-free Translation-en
Ign http://ftp.uk.debian.org/debian/ sid/non-free Translation-en_GB
Get:2 http://ftp.uk.debian.org experimental Release.gpg [835B]
Ign http://ftp.uk.debian.org/debian/ experimental/contrib Translation-en
Ign http://ftp.uk.debian.org/debian/ experimental/contrib Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ experimental/main Translation-en
Ign http://ftp.uk.debian.org/debian/ experimental/main Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ experimental/non-free Translation-en
Ign http://ftp.uk.debian.org/debian/ experimental/non-free Translation-en_GB
Get:3 http://ftp.uk.debian.org unstable Release.gpg [835B]
Ign http://ftp.uk.debian.org/debian/ unstable/contrib Translation-en
Ign http://ftp.uk.debian.org/debian/ unstable/contrib Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ unstable/main Translation-en
Ign http://ftp.uk.debian.org/debian/ unstable/main Translation-en_GB
Ign http://ftp.uk.debian.org/debian/ unstable/non-free Translation-en
Ign http://ftp.uk.debian.org/debian/ unstable/non-free Translation-en_GB
Get:4 http://ftp.uk.debian.org sid Release [104kB]
Get:5 http://ftp.uk.debian.org experimental Release [102kB]
Get:6 http://ftp.uk.debian.org unstable Release [104kB]
Get:7 http://ftp.uk.debian.org sid/main Sources [4,074kB]
Get:8 http://ftp.uk.debian.org sid/contrib Sources [38.6kB]
Get:9 http://ftp.uk.debian.org sid/non-free Sources [83.6kB]
Get:10 http://ftp.uk.debian.org sid/main armel Packages [6,785kB]
Get:11 http://ftp.uk.debian.org sid/contrib armel Packages [48.8kB]
Get:12 http://ftp.uk.debian.org sid/non-free armel Packages [92.3kB]
Get:13 http://ftp.uk.debian.org experimental/main Sources [396kB]
Get:14 http://ftp.uk.debian.org experimental/contrib Sources [4,450B]
Get:15 http://ftp.uk.debian.org experimental/non-free Sources [6,418B]
Get:16 http://ftp.uk.debian.org experimental/main armel Packages [794kB]
Get:17 http://ftp.uk.debian.org experimental/contrib armel Packages [5,246B]
Get:18 http://ftp.uk.debian.org experimental/non-free armel Packages [6,108B]
Get:19 http://ftp.uk.debian.org unstable/main armel Packages [6,785kB]
Get:20 http://ftp.uk.debian.org unstable/contrib armel Packages [48.8kB]
Get:21 http://ftp.uk.debian.org unstable/non-free armel Packages [92.3kB]
Fetched 19.6MB in 22s (884kB/s)
Reading package lists... Done
apt-get  -o Apt::Get::Download-Only=true -y -o Apt::Architecture=armel
-o Apt::Install-Recommends=false -o Dir::Etc=/var/lib/xapt/etc/xapt/
-o Dir::Etc::TrustedParts=/etc/apt/trusted.gpg.d -o
Dir::Etc::Trusted=/etc/apt/trusted.gpg -o
Dir::Etc::SourceList=/var/lib/xapt/etc/xapt/sources.list -o
Dir::Etc::SourceParts=/var/lib/xapt/etc/xapt/sources.list.d/ -o
Dir::State=/var/lib/xapt/ -o
Dir::State::Status=/var/lib/xapt//armel/dpkg/status -o
Dir::Cache=/var/lib/xapt/ install hello
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  coreutils dpkg gcc-4.4-base libacl1 libattr1 libbz2-1.0 libc-bin
libc6 libgcc1 liblzma2 libselinux1 xz-utils zlib1g
Suggested packages:
  apt glibc-doc debconf debconf-2.0 locales xz-lzma
The following NEW packages will be installed:
  coreutils dpkg gcc-4.4-base hello libacl1 libattr1 libbz2-1.0
libc-bin libc6 libgcc1 liblzma2 libselinux1 xz-utils zlib1g
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.7MB of archives.
After this operation, 34.0MB of additional disk space will be used.
Get:1 http://ftp.uk.debian.org/debian/ sid/main libc-bin armel 2.11.2-9 [702kB]
Get:2 http://ftp.uk.debian.org/debian/ sid/main gcc-4.4-base armel
4.4.5-10 [122kB]
Get:3 http://ftp.uk.debian.org/debian/ sid/main libc6 armel 2.11.2-9 [4,182kB]
Get:4 http://ftp.uk.debian.org/debian/ sid/main libgcc1 armel
1:4.4.5-10 [25.1kB]
Get:5 http://ftp.uk.debian.org/debian/ sid/main libattr1 armel
1:2.4.44-2 [11.7kB]
Get:6 http://ftp.uk.debian.org/debian/ sid/main libacl1 armel 2.2.49-4 [26.6kB]
Get:7 http://ftp.uk.debian.org/debian/ sid/main libselinux1 armel
2.0.96-1 [82.0kB]
Get:8 http://ftp.uk.debian.org/debian/ sid/main coreutils armel 8.5-1 [4,624kB]
Get:9 http://ftp.uk.debian.org/debian/ sid/main libbz2-1.0 armel
1.0.5-6 [49.7kB]
Get:10 http://ftp.uk.debian.org/debian/ sid/main zlib1g armel
1:1.2.3.4.dfsg-3 [77.5kB]
Get:11 http://ftp.uk.debian.org/debian/ sid/main liblzma2 armel 5.0.0-2 [184kB]
Get:12 http://ftp.uk.debian.org/debian/ sid/main xz-utils armel 5.0.0-2 [207kB]
Get:13 http://ftp.uk.debian.org/debian/ sid/main dpkg armel 1.15.8.8 [2,332kB]
Get:14 http://ftp.uk.debian.org/debian/ sid/main hello armel 2.6-1 [58.4kB]
Fetched 12.7MB in 14s (861kB/s)
Download complete and in download only mode
Building libacl1-armel-cross_2.2.49-4_all.deb
dpkg-deb: building package `libacl1-armel-cross' in
`./libacl1-armel-cross_2.2.49-4_all.deb'.
Building libgcc1-armel-cross_4.4.5-10_all.deb
dpkg-deb: building package `libgcc1-armel-cross' in
`./libgcc1-armel-cross_4.4.5-10_all.deb'.
Building libc6-armel-cross_2.11.2-9_all.deb
dpkg-deb: building package `libc6-armel-cross' in
`./libc6-armel-cross_2.11.2-9_all.deb'.
Building libbz2-1.0-armel-cross_1.0.5-6_all.deb
dpkg-deb: building package `libbz2-1.0-armel-cross' in
`./libbz2-1.0-armel-cross_1.0.5-6_all.deb'.
Building libselinux1-armel-cross_2.0.96-1_all.deb
dpkg-deb: building package `libselinux1-armel-cross' in
`./libselinux1-armel-cross_2.0.96-1_all.deb'.
Building libattr1-armel-cross_2.4.44-2_all.deb
dpkg-deb: building package `libattr1-armel-cross' in
`./libattr1-armel-cross_2.4.44-2_all.deb'.
dpkg-cross: package xz-utils doesn't provide any useful files, but
processing it anyway as requested
Building xz-utils-armel-cross_5.0.0-2_all.deb
dpkg-deb: building package `xz-utils-armel-cross' in
`./xz-utils-armel-cross_5.0.0-2_all.deb'.
dpkg-cross: package coreutils doesn't provide any useful files, but
processing it anyway as requested
Building coreutils-armel-cross_8.5-1_all.deb
dpkg-deb: building package `coreutils-armel-cross' in
`./coreutils-armel-cross_8.5-1_all.deb'.
dpkg-cross: package hello doesn't provide any useful files, but processing
it anyway as requested
Building hello-armel-cross_2.6-1_all.deb
dpkg-deb: building package `hello-armel-cross' in
`./hello-armel-cross_2.6-1_all.deb'.
Building zlib1g-armel-cross_1.2.3.4.dfsg-3_all.deb
dpkg-deb: building package `zlib1g-armel-cross' in
`./zlib1g-armel-cross_1.2.3.4.dfsg-3_all.deb'.
dpkg-cross: package libc-bin doesn't provide any useful files, but
processing it anyway as requested
Building libc-bin-armel-cross_2.11.2-9_all.deb
dpkg-deb: building package `libc-bin-armel-cross' in
`./libc-bin-armel-cross_2.11.2-9_all.deb'.
dpkg-cross: package dpkg doesn't provide any useful files, but processing
it anyway as requested
Building dpkg-armel-cross_1.15.8.8_all.deb
dpkg-deb: building package `dpkg-armel-cross' in
`./dpkg-armel-cross_1.15.8.8_all.deb'.
Building liblzma2-armel-cross_5.0.0-2_all.deb
dpkg-deb: building package `liblzma2-armel-cross' in
`./liblzma2-armel-cross_5.0.0-2_all.deb'.
dpkg-cross: package gcc-4.4-base doesn't provide any useful files, but
processing it anyway as requested
Building gcc-4.4-base-armel-cross_4.4.5-10_all.deb
dpkg-deb: building package `gcc-4.4-base-armel-cross' in
`./gcc-4.4-base-armel-cross_4.4.5-10_all.deb'.
Selecting previously deselected package coreutils-armel-cross.
(Reading database ... 32202 files and directories currently installed.)
Unpacking coreutils-armel-cross (from
.../coreutils-armel-cross_8.5-1_all.deb) ...
Selecting previously deselected package dpkg-armel-cross.
Unpacking dpkg-armel-cross (from .../dpkg-armel-cross_1.15.8.8_all.deb) ...
Selecting previously deselected package gcc-4.4-base-armel-cross.
Unpacking gcc-4.4-base-armel-cross (from
.../gcc-4.4-base-armel-cross_4.4.5-10_all.deb) ...
Selecting previously deselected package hello-armel-cross.
Unpacking hello-armel-cross (from .../hello-armel-cross_2.6-1_all.deb) ...
Selecting previously deselected package libacl1-armel-cross.
Unpacking libacl1-armel-cross (from
.../libacl1-armel-cross_2.2.49-4_all.deb) ...
Selecting previously deselected package libattr1-armel-cross.
Unpacking coreutils-armel-cross (from
.../coreutils-armel-cross_8.5-1_all.deb) ...
Selecting previously deselected package dpkg-armel-cross.
Unpacking dpkg-armel-cross (from .../dpkg-armel-cross_1.15.8.8_all.deb) ...
Selecting previously deselected package gcc-4.4-base-armel-cross.
Unpacking gcc-4.4-base-armel-cross (from
.../gcc-4.4-base-armel-cross_4.4.5-10_all.deb) ...
Selecting previously deselected package hello-armel-cross.
Unpacking hello-armel-cross (from .../hello-armel-cross_2.6-1_all.deb) ...
Selecting previously deselected package libacl1-armel-cross.
Unpacking libacl1-armel-cross (from
.../libacl1-armel-cross_2.2.49-4_all.deb) ...
Selecting previously deselected package libattr1-armel-cross.
Unpacking libattr1-armel-cross (from
.../libattr1-armel-cross_2.4.44-2_all.deb) ...
Selecting previously deselected package libbz2-1.0-armel-cross.
Unpacking libbz2-1.0-armel-cross (from
.../libbz2-1.0-armel-cross_1.0.5-6_all.deb) ...
Selecting previously deselected package libc-bin-armel-cross.
Unpacking libc-bin-armel-cross (from
.../libc-bin-armel-cross_2.11.2-9_all.deb) ...
Selecting previously deselected package libc6-armel-cross.
Unpacking libc6-armel-cross (from .../libc6-armel-cross_2.11.2-9_all.deb) ...
Selecting previously deselected package libgcc1-armel-cross.
Unpacking libgcc1-armel-cross (from
.../libgcc1-armel-cross_4.4.5-10_all.deb) ...
Selecting previously deselected package liblzma2-armel-cross.
Unpacking liblzma2-armel-cross (from
.../liblzma2-armel-cross_5.0.0-2_all.deb) ...
Selecting previously deselected package libselinux1-armel-cross.
Unpacking libselinux1-armel-cross (from
.../libselinux1-armel-cross_2.0.96-1_all.deb) ...
Selecting previously deselected package xz-utils-armel-cross.
Unpacking xz-utils-armel-cross (from
.../xz-utils-armel-cross_5.0.0-2_all.deb) ...
Selecting previously deselected package zlib1g-armel-cross.
Unpacking zlib1g-armel-cross (from
.../zlib1g-armel-cross_1.2.3.4.dfsg-3_all.deb) ...
Setting up gcc-4.4-base-armel-cross (4.4.5-10) ...
Setting up libc-bin-armel-cross (2.11.2-9) ...
Setting up libgcc1-armel-cross (1:4.4.5-10) ...
Setting up libc6-armel-cross (2.11.2-9) ...
Setting up liblzma2-armel-cross (5.0.0-2) ...
Setting up libselinux1-armel-cross (2.0.96-1) ...
Setting up xz-utils-armel-cross (5.0.0-2) ...
Setting up zlib1g-armel-cross (1:1.2.3.4.dfsg-3) ...
Setting up libattr1-armel-cross (1:2.4.44-2) ...
Setting up libbz2-1.0-armel-cross (1.0.5-6) ...
Setting up libacl1-armel-cross (2.2.49-4) ...
Setting up coreutils-armel-cross (8.5-1) ...
Setting up dpkg-armel-cross (1.15.8.8) ...
Setting up hello-armel-cross (2.6-1) ...


-- 
 Héctor Orón

"Our Sun unleashes tremendous flares expelling hot gas into the Solar
System, which one day will disconnect us."

-- Day DVB-T stop working nicely
Video flare: http://antwrp.gsfc.nasa.gov/apod/ap100510.html





More information about the Buildd-tools-devel mailing list