aboutsummaryrefslogtreecommitdiffstats
path: root/tools/create-image.sh
diff options
context:
space:
mode:
authorAndrew Donnellan <ajd@linux.ibm.com>2020-09-14 12:01:29 +1000
committerDmitry Vyukov <dvyukov@google.com>2020-09-18 07:52:38 +0200
commit38962c8b05959d86ba152e88cdd5a85a8f5278e9 (patch)
treea578265273a7aab02a0f22ea5fe10720090b90d6 /tools/create-image.sh
parent8c70a2f7b7ded6a33aed1bbf9ee82befbef9851f (diff)
tools/create-image.sh: map qemu -> Debian architecture names
create-image.sh assumes that the qemu name and the Debian name for the target architecture are the same. This is not always true. For comedy and/or historical reasons, Debian refers to 64-bit little endian PowerPC as ppc64el, whereas qemu and most other things use ppc64le. Debian refers to aarch64 as arm64, and 32-bit little endian arm as armel. Add special cases to handle this. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Diffstat (limited to 'tools/create-image.sh')
-rwxr-xr-xtools/create-image.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/create-image.sh b/tools/create-image.sh
index 93d5bb089..20446985e 100755
--- a/tools/create-image.sh
+++ b/tools/create-image.sh
@@ -75,6 +75,22 @@ while true; do
esac
done
+# Handle cases where qemu and Debian use different arch names
+case "$ARCH" in
+ ppc64le)
+ DEBARCH=ppc64el
+ ;;
+ aarch64)
+ DEBARCH=arm64
+ ;;
+ arm)
+ DEBARCH=armel
+ ;;
+ *)
+ DEBARCH=$ARCH
+ ;;
+esac
+
# Foreign architecture
if [ $ARCH != $(uname -m) ]; then
# Check for according qemu static binary
@@ -108,7 +124,7 @@ sudo chmod 0755 $DIR
DEBOOTSTRAP_PARAMS="--include=$PREINSTALL_PKGS --components=main,contrib,non-free $RELEASE $DIR"
if [ $ARCH != $(uname -m) ]; then
- DEBOOTSTRAP_PARAMS="--arch=$ARCH --foreign $DEBOOTSTRAP_PARAMS"
+ DEBOOTSTRAP_PARAMS="--arch=$DEBARCH --foreign $DEBOOTSTRAP_PARAMS"
fi
sudo debootstrap $DEBOOTSTRAP_PARAMS