Browse Source

Architecture detection

Bob Mottram 8 years ago
parent
commit
48466cebd2
4 changed files with 28 additions and 21 deletions
  1. 1
    4
      src/freedombone-app-cjdns
  2. 2
    4
      src/freedombone-app-gogs
  3. 13
    11
      src/freedombone-app-ipfs
  4. 12
    2
      src/freedombone-utils-go

+ 1
- 4
src/freedombone-app-cjdns View File

@@ -483,10 +483,7 @@ function install_cjdns_tools {
483 483
         install_cjdns
484 484
     fi
485 485
 
486
-    function_check select_go_version
487
-    select_go_version
488
-
489
-    apt-get -y install golang mercurial
486
+    apt-get -y install mercurial
490 487
     if [ ! -f ~/.bashrc ]; then
491 488
         touch ~/.bashrc
492 489
     fi

+ 2
- 4
src/freedombone-app-gogs View File

@@ -47,7 +47,7 @@ function gogs_parameters {
47 47
     if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
48 48
         CURR_ARCH=386
49 49
     fi
50
-    if [[ $ARCHITECTURE == *"amd64" ]]; then
50
+    if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
51 51
         CURR_ARCH=amd64
52 52
     fi
53 53
     if [[ $ARCHITECTURE == *"arm"* ]]; then
@@ -59,7 +59,7 @@ function gogs_parameters {
59 59
         if [[ $ARCHITECTURE == "arm"* ]]; then
60 60
             CURR_ARCH=arm
61 61
         fi
62
-        if [[ $ARCHITECTURE == "amd"* ]]; then
62
+        if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
63 63
             CURR_ARCH=amd64
64 64
         fi
65 65
         if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
@@ -317,8 +317,6 @@ function remove_gogs {
317 317
     if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then
318 318
         return
319 319
     fi
320
-    function_check select_go_version
321
-    select_go_version
322 320
 
323 321
     systemctl stop gogs
324 322
     systemctl disable gogs

+ 13
- 11
src/freedombone-app-ipfs View File

@@ -28,7 +28,7 @@
28 28
 # You should have received a copy of the GNU Affero General Public License
29 29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30 30
 
31
-VARIANTS='mesh'
31
+VARIANTS=''
32 32
 
33 33
 IPFS_GO_REPO_BASE="github.com/ipfs/go-ipfs"
34 34
 IPFS_GO_REPO="https://${IPFS_GO_REPO_BASE}"
@@ -54,9 +54,6 @@ function upgrade_ipfs_go {
54 54
         return
55 55
     fi
56 56
 
57
-    function_check select_go_version
58
-    select_go_version
59
-
60 57
     function_check set_repo_commit
61 58
     set_repo_commit $GOPATH/src/github.com/ipfs/go-ipfs "ipfs commit" "$IPFS_COMMIT" $IPFS_REPO
62 59
 }
@@ -153,8 +150,6 @@ function remove_ipfs_go {
153 150
     if ! grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then
154 151
         return
155 152
     fi
156
-    function_check select_go_version
157
-    select_go_version
158 153
     systemctl stop ipfs
159 154
     systemctl disable ipfs
160 155
     systemctl daemon-reload
@@ -398,14 +393,24 @@ function mesh_install_ipfs_go {
398 393
     if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
399 394
         IPFS_ARCH=386
400 395
     fi
401
-    if [[ $ARCHITECTURE == *"amd64" ]]; then
396
+    if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
402 397
         IPFS_ARCH=amd64
403 398
     fi
404 399
     if [[ $ARCHITECTURE == *"arm"* ]]; then
405 400
         IPFS_ARCH=arm
406 401
     fi
407 402
     if [ ! $IPFS_ARCH ]; then
408
-        return
403
+        echo $'No architecture specified'
404
+        ARCHITECTURE=$(uname -m)
405
+        if [[ $ARCHITECTURE == "arm"* ]]; then
406
+            IPFS_ARCH=arm
407
+        fi
408
+        if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
409
+            IPFS_ARCH=amd64
410
+        fi
411
+        if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
412
+            IPFS_ARCH=386
413
+        fi
409 414
     fi
410 415
 
411 416
     IPFS_FILE=go-ipfs_v${IPFS_GO_VERSION}_linux-${IPFS_ARCH}.tar.gz
@@ -450,9 +455,6 @@ function install_ipfs_go {
450 455
         return
451 456
     fi
452 457
 
453
-    function_check select_go_version
454
-    select_go_version
455
-
456 458
     apt-get -y install golang libpam0g-dev fuse
457 459
 
458 460
     if [ ! -d /home/git ]; then

+ 12
- 2
src/freedombone-utils-go View File

@@ -141,14 +141,24 @@ function mesh_upgrade_golang {
141 141
     if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
142 142
         GOARCH=386
143 143
     fi
144
-    if [[ $ARCHITECTURE == *"amd64" ]]; then
144
+    if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
145 145
         GOARCH=amd64
146 146
     fi
147 147
     if [[ $ARCHITECTURE == *"arm"* ]]; then
148 148
         GOARCH=armv6l
149 149
     fi
150 150
     if [ ! $GOARCH ]; then
151
-        return
151
+        echo $'No architecture specified'
152
+        ARCHITECTURE=$(uname -m)
153
+        if [[ $ARCHITECTURE == "arm"* ]]; then
154
+            GOARCH=armv6l
155
+        fi
156
+        if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
157
+            GOARCH=amd64
158
+        fi
159
+        if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
160
+            GOARCH=386
161
+        fi
152 162
     fi
153 163
     GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz
154 164