瀏覽代碼

Architecture detection

Bob Mottram 8 年之前
父節點
當前提交
48466cebd2
共有 4 個檔案被更改,包括 28 行新增21 行删除
  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 查看文件

483
         install_cjdns
483
         install_cjdns
484
     fi
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
     if [ ! -f ~/.bashrc ]; then
487
     if [ ! -f ~/.bashrc ]; then
491
         touch ~/.bashrc
488
         touch ~/.bashrc
492
     fi
489
     fi

+ 2
- 4
src/freedombone-app-gogs 查看文件

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

+ 13
- 11
src/freedombone-app-ipfs 查看文件

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

+ 12
- 2
src/freedombone-utils-go 查看文件

141
     if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
141
     if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
142
         GOARCH=386
142
         GOARCH=386
143
     fi
143
     fi
144
-    if [[ $ARCHITECTURE == *"amd64" ]]; then
144
+    if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
145
         GOARCH=amd64
145
         GOARCH=amd64
146
     fi
146
     fi
147
     if [[ $ARCHITECTURE == *"arm"* ]]; then
147
     if [[ $ARCHITECTURE == *"arm"* ]]; then
148
         GOARCH=armv6l
148
         GOARCH=armv6l
149
     fi
149
     fi
150
     if [ ! $GOARCH ]; then
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
     fi
162
     fi
153
     GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz
163
     GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz
154
 
164