Skip to content

Commit 97c8dba

Browse files
authored
Add aarch64 host support in alpine rootfs (#14697)
1 parent 541820f commit 97c8dba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

eng/common/cross/build-rootfs.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,18 @@ __RootfsDir="$( cd "$__RootfsDir" && pwd )"
444444

445445
if [[ "$__CodeName" == "alpine" ]]; then
446446
__ApkToolsVersion=2.12.11
447-
__ApkToolsSHA512SUM=53e57b49230da07ef44ee0765b9592580308c407a8d4da7125550957bb72cb59638e04f8892a18b584451c8d841d1c7cb0f0ab680cc323a3015776affaa3be33
448447
__ApkToolsDir="$(mktemp -d)"
449448
__ApkKeysDir="$(mktemp -d)"
450449

451-
wget "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic//v$__ApkToolsVersion/x86_64/apk.static" -P "$__ApkToolsDir"
450+
arch="$(uname -m)"
451+
wget "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v$__ApkToolsVersion/$arch/apk.static" -P "$__ApkToolsDir"
452+
if [[ "$arch" == "x86_64" ]]; then
453+
__ApkToolsSHA512SUM="53e57b49230da07ef44ee0765b9592580308c407a8d4da7125550957bb72cb59638e04f8892a18b584451c8d841d1c7cb0f0ab680cc323a3015776affaa3be33"
454+
elif [[ "$arch" == "aarch64" ]]; then
455+
__ApkToolsSHA512SUM="9e2b37ecb2b56c05dad23d379be84fd494c14bd730b620d0d576bda760588e1f2f59a7fcb2f2080577e0085f23a0ca8eadd993b4e61c2ab29549fdb71969afd0"
456+
else
457+
echo "WARNING: add missing hash for your host architecture. To find the value, use: `find /tmp -name apk.static -exec sha512sum {} \;`"
458+
fi
452459
echo "$__ApkToolsSHA512SUM $__ApkToolsDir/apk.static" | sha512sum -c
453460
chmod +x "$__ApkToolsDir/apk.static"
454461

0 commit comments

Comments
 (0)