Debian Codegraph @

debian/tests/can-configure-cross-compilation

raw
1 #!/bin/bash
2 set -ex
3
4 if [ $(dpkg --print-architecture) != 'amd64' ]; then
5 echo "The test is only valid for amd64"
6 exit 0
7 fi
8
9 echo "Host architecture ${host_arch}"
10 echo "Foreign architecture ${foreign_arch}"
11
12 echo deb http://deb.debian.org/debian unstable main > sources.list
13 echo deb [ trusted=yes ] file:///tmp/binaries / >> sources.list
14
15 where=/tmp/binaries
16 mkdir -p ${where}
17
18 pushd ${where}
19 apt download ca-certificates-java
20 apt-ftparchive sources . \
21 | tee "$where"/Sources \
22 | gzip -9 > "$where"/Sources.gz
23
24 apt-ftparchive packages "$where" \
25 | sed "s@$where@@" \
26 | tee "$where"/Packages \
27 | gzip -9 > "$where"/Packages.gz
28
29 # sponge comes from moreutils
30 apt-ftparchive \
31 -o"APT::FTPArchive::Release::Origin=$origin" \
32 -o"APT::FTPArchive::Release::Label=$label" \
33 -o"APT::FTPArchive::Release::Codename=$where" release "$where" \
34 | sponge "$where"/Release
35 popd
36
37 mmdebstrap --setup-hook='copy-in /tmp/binaries /tmp' \
38 --keyring /usr/share/keyrings/debian-archive-bullseye-automatic.gpg \
39 --keyring /usr/share/keyrings/debian-archive-bookworm-automatic.gpg \
40 --mode=root \
41 --variant=essential \
42 --architectures=amd64,armhf \
43 --include=openjdk-21-jdk-headless:armhf \
44 unstable /tmp/test-root sources.list
45
46