aports/main/debootstrap/auto-detect-arch.patch
Sören Tempel fb0c92b44d main/debootstrap: attempt to autodetect arch via /etc/apk/arch
Arch Linux has a similar patch.
2022-03-04 04:39:10 +00:00

26 lines
995 B
Diff

Without this patch debootstrap(8) is incapable of autodetecting the
architecture to install since the $(dpkg --print-architecture) prints
a musl-linux-${arch} which is not suitable for HOST_ARCH.
diff -upr debootstrap-1.0.126.orig/debootstrap debootstrap-1.0.126/debootstrap
--- debootstrap-1.0.126.orig/debootstrap 2021-11-08 15:41:32.000000000 +0100
+++ debootstrap-1.0.126/debootstrap 2022-01-29 15:26:42.023298234 +0100
@@ -535,7 +535,17 @@ fi
###########################################################################
-if in_path dpkg && \
+if [ -e /etc/apk/arch ]; then
+ read CARCH < /etc/apk/arch
+ case "$CARCH" in
+ x86) HOST_ARCH=i386 ;;
+ x86_64) HOST_ARCH=amd64 ;;
+ arm*) HOST_ARCH=armhf ;;
+ aarch64) HOST_ARCH=arm64 ;;
+ ppc64le) HOST_ARCH=ppc64el ;;
+ *) HOST_ARCH="$CARCH" ;;
+ esac
+elif in_path dpkg && \
dpkg --print-architecture >/dev/null 2>&1; then
HOST_ARCH=$(/usr/bin/dpkg --print-architecture)
elif in_path udpkg && \