From 52c9c5abc7413520022d2262000fa7a0e7e03444 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Mon, 18 Sep 2017 15:38:45 +0100
Subject: [PATCH] Use arm64 golang download for aarch64 #72

---
 src/freedombone-image-customise |  5 ++++-
 src/freedombone-utils-go        | 11 +++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise
index 14d733c92..d665c031d 100755
--- a/src/freedombone-image-customise
+++ b/src/freedombone-image-customise
@@ -1164,9 +1164,12 @@ function image_setup_utils {
     if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
         GOARCH=amd64
     fi
-    if [[ $ARCHITECTURE == *"arm"* || $ARCHITECTURE == *"aarch"* ]]; then
+    if [[ $ARCHITECTURE == *"arm"* ]]; then
         GOARCH=armv6l
     fi
+    if [[ $ARCHITECTURE == *"aarch"* ]]; then
+        GOARCH=arm64
+    fi
     if [ ! $GOARCH ]; then
         echo $'System architecture was not specified when installing Go'
         exit 6734378
diff --git a/src/freedombone-utils-go b/src/freedombone-utils-go
index 1e6e7e087..933c8dc7f 100755
--- a/src/freedombone-utils-go
+++ b/src/freedombone-utils-go
@@ -144,16 +144,23 @@ function mesh_upgrade_golang {
     if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
         GOARCH=amd64
     fi
-    if [[ $ARCHITECTURE == *"arm"* || $ARCHITECTURE == *"aarch"* ]]; then
+    if [[ $ARCHITECTURE == *"arm"* ]]; then
         GOARCH=armv6l
     fi
+    if [[ $ARCHITECTURE == *"aarch"* ]]; then
+        GOARCH=arm64
+    fi
     if [ ! $GOARCH ]; then
         echo $'No architecture specified'
         ARCHITECTURE=$(uname -m)
-        if [[ $ARCHITECTURE == "arm"* || $ARCHITECTURE == *"aarch"* ]]; then
+        if [[ $ARCHITECTURE == "arm"* ]]; then
             GOARCH=armv6l
             echo $"Using $GOARCH"
         fi
+        if [[ $ARCHITECTURE == *"aarch"* ]]; then
+            GOARCH=arm64
+            echo $"Using $GOARCH"
+        fi
         if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
             GOARCH=amd64
             echo $"Using $GOARCH"
-- 
GitLab