summarylogtreecommitdiffstats
path: root/arch-detect.patch
diff options
context:
space:
mode:
Diffstat (limited to 'arch-detect.patch')
-rw-r--r--arch-detect.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch-detect.patch b/arch-detect.patch
new file mode 100644
index 000000000000..2a76428fdd6c
--- /dev/null
+++ b/arch-detect.patch
@@ -0,0 +1,21 @@
+diff --git a/debootstrap b/debootstrap
+index fcdb20f..184900d 100755
+--- a/debootstrap
++++ b/debootstrap
+@@ -427,6 +427,16 @@ elif in_path udpkg && \
+ HOST_ARCH=$(/usr/bin/udpkg --print-architecture)
+ elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then
+ HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch")
++elif in_path pacman; then
++ # pacman 5.1 will have `pacman-conf Architecture`
++ CARCH="$(bash -c '. /etc/makepkg.conf && echo $CARCH')"
++ case "$CARCH" in
++ "i686") HOST_ARCH="i386" ;;
++ "x86_64") HOST_ARCH="amd64" ;;
++ "armv7h") HOST_ARCH="armhf" ;;
++ "aarch64") HOST_ARCH="arm64" ;;
++ *) echo "Unknown architecture: $CARCH" && exit 1
++ esac
+ fi
+ HOST_OS="$HOST_ARCH"
+ # basic host OS guessing for non-Debian systems