forked from josch/mmdebstrap
Compare commits
85 Commits
File diff suppressed because it is too large
Load Diff
@ -1,65 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
export LC_ALL=C.UTF-8
|
|
||||||
|
|
||||||
prefix=
|
|
||||||
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
|
||||||
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
|
||||||
if [ ! -e /mmdebstrap-testenv ]; then
|
|
||||||
echo "this test modifies the system and should only be run inside a container" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
useradd --home-dir "/home/${SUDO_USER:-user}" --create-home "${SUDO_USER:-user}"
|
|
||||||
fi
|
|
||||||
prefix="runuser -u ${SUDO_USER:-user} --"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "{{ MODE }}" = "fakechroot" ] && prefix="$prefix fakechroot fakeroot"
|
|
||||||
$prefix {{ CMD }} --mode={{ MODE }} --variant=apt --architectures=arm64 {{ DIST }} /tmp/debian-chroot.tar {{ MIRROR }}
|
|
||||||
# we ignore differences between architectures by ignoring some files
|
|
||||||
# and renaming others
|
|
||||||
{ tar -tf /tmp/debian-chroot.tar \
|
|
||||||
| grep -v '^\./usr/lib/ld-linux-aarch64\.so\.1$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/ld-linux-aarch64\.so\.1$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm-generic/int-ll64\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm-generic/types\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm-generic/unistd\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm/sigcontext\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm/sve_context\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/asm/types\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/bits/procfs-extra\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/bits/procfs-id\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/bits/procfs-prregset\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/bits/procfs\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/gnu/stubs-lp64\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/linux/types\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/sys/procfs\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/aarch64-linux-gnu/perl/5\.[0-9]\+\.0/sys/user\.ph$' \
|
|
||||||
| grep -v '^\./usr/share/doc/[^/]\+/changelog\(\.Debian\)\?\.arm64\.gz$' \
|
|
||||||
| sed 's/aarch64-linux-gnu/x86_64-linux-gnu/' \
|
|
||||||
| sed 's/arm64/amd64/';
|
|
||||||
} | sort > tar2.txt
|
|
||||||
{ < tar1.txt \
|
|
||||||
grep -v '^\./usr/bin/i386$' \
|
|
||||||
| grep -v '^\./usr/bin/x86_64$' \
|
|
||||||
| grep -v '^\./lib32$' \
|
|
||||||
| grep -v '^\./lib64$' \
|
|
||||||
| grep -v '^\./libx32$' \
|
|
||||||
| grep -v '^\./usr/lib32/$' \
|
|
||||||
| grep -v '^\./usr/libx32/$' \
|
|
||||||
| grep -v '^\./usr/lib64/$' \
|
|
||||||
| grep -v '^\./usr/lib64/ld-linux-x86-64\.so\.2$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/ld-linux-x86-64\.so\.2$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/libmvec\.so\.1$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/posix_types_32\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/posix_types_64\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/posix_types_x32\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/unistd_32\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/unistd_64\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/asm/unistd_x32\.ph$' \
|
|
||||||
| grep -v '^\./usr/lib/x86_64-linux-gnu/perl/5\.[0-9]\+\.0/gnu/stubs-64\.ph$' \
|
|
||||||
| grep -v '^\./usr/share/doc/[^/]\+/changelog\(\.Debian\)\?\.amd64\.gz$' \
|
|
||||||
| grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \
|
|
||||||
| grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$';
|
|
||||||
} | sort | diff -u - tar2.txt >&2
|
|
||||||
rm /tmp/debian-chroot.tar
|
|
@ -0,0 +1,77 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
prefix=
|
||||||
|
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
||||||
|
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
||||||
|
if [ ! -e /mmdebstrap-testenv ]; then
|
||||||
|
echo "this test modifies the system and should only be run inside a container" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
useradd --home-dir "/home/${SUDO_USER:-user}" --create-home "${SUDO_USER:-user}"
|
||||||
|
fi
|
||||||
|
prefix="runuser -u ${SUDO_USER:-user} --"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$(dpkg --print-architecture)" in
|
||||||
|
arm64)
|
||||||
|
native_arch=arm64
|
||||||
|
native_gnu=aarch64-linux-gnu
|
||||||
|
foreign_arch=amd64
|
||||||
|
foreign_gnu=x86_64-linux-gnu
|
||||||
|
;;
|
||||||
|
amd64)
|
||||||
|
native_arch=amd64
|
||||||
|
native_gnu=x86_64-linux-gnu
|
||||||
|
foreign_arch=arm64
|
||||||
|
foreign_gnu=aarch64-linux-gnu
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unsupported native architecture" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
[ "{{ MODE }}" = "fakechroot" ] && prefix="$prefix fakechroot fakeroot"
|
||||||
|
$prefix {{ CMD }} --mode={{ MODE }} --variant=apt --architectures="$foreign_arch" \
|
||||||
|
{{ DIST }} /tmp/debian-chroot.tar {{ MIRROR }}
|
||||||
|
# we ignore differences between architectures by ignoring some files
|
||||||
|
# and renaming others
|
||||||
|
{ tar -tf /tmp/debian-chroot.tar \
|
||||||
|
| grep -v '^\./usr/bin/i386$' \
|
||||||
|
| grep -v '^\./usr/bin/x86_64$' \
|
||||||
|
| grep -v '^\./lib64$' \
|
||||||
|
| grep -v '^\./usr/lib64/$' \
|
||||||
|
| grep -v '^\./usr/lib64/ld-linux-x86-64\.so\.2$' \
|
||||||
|
| grep -v '^\./usr/lib/ld-linux-aarch64\.so\.1$' \
|
||||||
|
| grep -v "^\\./usr/lib/$foreign_gnu/ld-linux-aarch64\\.so\\.1$" \
|
||||||
|
| grep -v "^\\./usr/lib/$foreign_gnu/ld-linux-x86-64\\.so\\.2$" \
|
||||||
|
| grep -v "^\\./usr/lib/$foreign_gnu/perl/5\\.[0-9][.0-9]\\+/.*\\.ph$" \
|
||||||
|
| grep -v "^\\./usr/lib/$foreign_gnu/libmvec\\.so\\.1$" \
|
||||||
|
| grep -v "^\\./usr/share/doc/[^/]\\+/changelog\\(\\.Debian\\)\\?\\.$foreign_arch\\.gz$" \
|
||||||
|
| grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \
|
||||||
|
| grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$' \
|
||||||
|
| sed "s/$foreign_gnu/$native_gnu/" \
|
||||||
|
| sed "s/$foreign_arch/$native_arch/";
|
||||||
|
} | sort > /tmp/tar2.txt
|
||||||
|
{ < tar1.txt \
|
||||||
|
grep -v '^\./usr/bin/i386$' \
|
||||||
|
| grep -v '^\./usr/bin/x86_64$' \
|
||||||
|
| grep -v '^\./lib32$' \
|
||||||
|
| grep -v '^\./lib64$' \
|
||||||
|
| grep -v '^\./libx32$' \
|
||||||
|
| grep -v '^\./usr/lib32/$' \
|
||||||
|
| grep -v '^\./usr/libx32/$' \
|
||||||
|
| grep -v '^\./usr/lib64/$' \
|
||||||
|
| grep -v '^\./usr/lib64/ld-linux-x86-64\.so\.2$' \
|
||||||
|
| grep -v '^\./usr/lib/ld-linux-aarch64\.so\.1$' \
|
||||||
|
| grep -v "^\\./usr/lib/$native_gnu/ld-linux-x86-64\\.so\\.2$" \
|
||||||
|
| grep -v "^\\./usr/lib/$native_gnu/ld-linux-aarch64\\.so\\.1$" \
|
||||||
|
| grep -v "^\\./usr/lib/$native_gnu/libmvec\\.so\\.1$" \
|
||||||
|
| grep -v "^\\./usr/lib/$native_gnu/perl/5\\.[0-9][.0-9]\\+/.*\\.ph$" \
|
||||||
|
| grep -v "^\\./usr/share/doc/[^/]\\+/changelog\\(\\.Debian\\)\\?\\.$native_arch\\.gz$" \
|
||||||
|
| grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \
|
||||||
|
| grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$';
|
||||||
|
} | sort | diff -u - /tmp/tar2.txt >&2
|
||||||
|
rm /tmp/debian-chroot.tar /tmp/tar2.txt
|
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# to test foreign architecture package installation we choose a package which
|
||||||
|
# - is not part of the native installation set
|
||||||
|
# - does not have any dependencies
|
||||||
|
# - installs only few files
|
||||||
|
# - doesn't change its name regularly (like gcc-*-base)
|
||||||
|
|
||||||
|
case "$(dpkg --print-architecture)" in
|
||||||
|
arm64)
|
||||||
|
native_arch=arm64
|
||||||
|
foreign_arch=amd64
|
||||||
|
;;
|
||||||
|
amd64)
|
||||||
|
native_arch=amd64
|
||||||
|
foreign_arch=arm64
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unsupported native architecture" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
export LC_ALL=C.UTF-8
|
||||||
|
{{ CMD }} --mode=root --variant=apt \
|
||||||
|
--architectures="$native_arch" \
|
||||||
|
--architectures="$foreign_arch" \
|
||||||
|
--include="libmagic-mgc:$foreign_arch" \
|
||||||
|
{{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
||||||
|
{ echo "$native_arch"; echo "$foreign_arch"; } | cmp /tmp/debian-chroot/var/lib/dpkg/arch -
|
||||||
|
rm /tmp/debian-chroot/usr/lib/file/magic.mgc
|
||||||
|
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/README.Debian
|
||||||
|
rm -f /tmp/debian-chroot/usr/share/doc/libmagic-mgc/"changelog.Debian.$foreign_arch.gz"
|
||||||
|
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/changelog.Debian.gz
|
||||||
|
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/changelog.gz
|
||||||
|
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/copyright
|
||||||
|
rm /tmp/debian-chroot/usr/share/file/magic.mgc
|
||||||
|
rm /tmp/debian-chroot/usr/share/misc/magic.mgc
|
||||||
|
rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.list
|
||||||
|
rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.md5sums
|
||||||
|
rmdir /tmp/debian-chroot/usr/share/doc/libmagic-mgc/
|
||||||
|
rmdir /tmp/debian-chroot/usr/share/file/magic/
|
||||||
|
rmdir /tmp/debian-chroot/usr/share/file/
|
||||||
|
rmdir /tmp/debian-chroot/usr/lib/file/
|
||||||
|
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt -
|
||||||
|
rm -r /tmp/debian-chroot
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
export LC_ALL=C.UTF-8
|
|
||||||
{{ CMD }} --mode=root --variant=apt --architectures=amd64 --architectures=arm64 --include=libmagic-mgc:arm64 {{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
|
||||||
{ echo "amd64"; echo "arm64"; } | cmp /tmp/debian-chroot/var/lib/dpkg/arch -
|
|
||||||
rm /tmp/debian-chroot/var/lib/apt/extended_states
|
|
||||||
rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.list
|
|
||||||
rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.md5sums
|
|
||||||
rm /tmp/debian-chroot/usr/lib/file/magic.mgc
|
|
||||||
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/README.Debian
|
|
||||||
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/changelog.Debian.gz
|
|
||||||
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/changelog.gz
|
|
||||||
rm /tmp/debian-chroot/usr/share/doc/libmagic-mgc/copyright
|
|
||||||
rm /tmp/debian-chroot/usr/share/file/magic.mgc
|
|
||||||
rm /tmp/debian-chroot/usr/share/misc/magic.mgc
|
|
||||||
rmdir /tmp/debian-chroot/usr/share/doc/libmagic-mgc/
|
|
||||||
rmdir /tmp/debian-chroot/usr/share/file/magic/
|
|
||||||
rmdir /tmp/debian-chroot/usr/share/file/
|
|
||||||
rmdir /tmp/debian-chroot/usr/lib/file/
|
|
||||||
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt -
|
|
||||||
rm -r /tmp/debian-chroot
|
|
Loading…
Reference in New Issue