hooks/merged-usr: acquire native architecture from apt-config

`dpkg --print-architecture` will be wrong when creating a foreign
architecture chroot and we cannot chroot() as the chroot directory is
still empty.
This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-05-26 07:27:24 +02:00
parent cffd47e087
commit 790294ddca
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -47,11 +47,8 @@ fi
TARGET="$1"
if [ -e "$TARGET/var/lib/dpkg/arch" ]; then
ARCH=$(head -1 "$TARGET/var/lib/dpkg/arch")
else
ARCH=$(dpkg --print-architecture)
fi
ARCH=$(dpkg --print-architecture)
eval "$(APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" apt-config shell ARCH Apt::Architecture)"
if [ -e /usr/share/debootstrap/functions ]; then
. /usr/share/debootstrap/functions