Quellcode durchsuchen

Move back to go implementation of ipfs

Bob Mottram vor 8 Jahren
Ursprung
Commit
5ec40daaf3
Es ist kein Account mit dieser Commiter-Email verbunden

+ 5
- 3
README.md Datei anzeigen

@@ -31,9 +31,11 @@ Install the freedombone commands onto your laptop/desktop:
31 31
 
32 32
 Then install packages needed for building images:
33 33
 
34
-    sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
35
-    sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
36
-    sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
34
+
35
+    sudo apt-get -y install build-essential git python-docutils mktorrent
36
+    sudo apt-get -y install vmdebootstrap xz-utils dosfstools btrfs-tools extlinux
37
+    sudo apt-get -y install python-distro-info mbr qemu-user-static binfmt-support
38
+    sudo apt-get -y install u-boot-tools qemu
37 39
 
38 40
 A typical use case to build an 8GB image for a Beaglebone Black is as follows. You can change the size depending upon the capacity of your microSD card.
39 41
 

+ 2
- 1
doc/EN/homeserver.org Datei anzeigen

@@ -21,7 +21,8 @@ First you will need to create an image.
21 21
 
22 22
 #+begin_src bash
23 23
 sudo su
24
-apt-get -y install build-essential git python-docutils mktorrent \
24
+apt-get -y install build-essential libc6-dev-i386 \
25
+gcc-multilib g++-multilib git python-docutils mktorrent \
25 26
 vmdebootstrap xz-utils dosfstools btrfs-tools extlinux \
26 27
 python-distro-info mbr qemu-user-static binfmt-support \
27 28
 u-boot-tools qemu

+ 2
- 1
doc/EN/mesh.org Datei anzeigen

@@ -24,7 +24,8 @@ First you will need to create an image.
24 24
 
25 25
 #+begin_src bash
26 26
 sudo su
27
-apt-get -y install build-essential git python-docutils mktorrent \
27
+apt-get -y install build-essential libc6-dev-i386 \
28
+gcc-multilib g++-multilib git python-docutils mktorrent \
28 29
 vmdebootstrap xz-utils dosfstools btrfs-tools extlinux \
29 30
 python-distro-info mbr qemu-user-static binfmt-support \
30 31
 u-boot-tools qemu

BIN
man/freedombone-image.1.gz Datei anzeigen


+ 93
- 2
src/freedombone-app-ipfs Datei anzeigen

@@ -227,6 +227,7 @@ npm install -g n@${IPFS_N_VERSION} --save
227 227
 n ${IPFS_NODE_VERSION}
228 228
 npm install -g ronin@${IPFS_JS_RONIN_VERSION} --save
229 229
 npm install -g ipfs@${IPFS_JS_VERSION} --save
230
+exit 0
230 231
 EOF
231 232
     chroot ${rootdir} chmod +x /root/install-ipfs.sh
232 233
     chroot ${rootdir} /root/install-ipfs.sh
@@ -375,8 +376,98 @@ function install_ipfs_js {
375 376
     echo 'install_ipfs_js' >> $COMPLETION_FILE
376 377
 }
377 378
 
379
+function mesh_install_ipfs_go {
380
+    chroot ${rootdir} apt-get -y install golang libpam0g-dev fuse
381
+
382
+    mesh_upgrade_golang
383
+
384
+    GOPATH=/home/git/gvm/pkgsets/go${GO_VERSION}/global
385
+
386
+    cat <<EOF > ${rootdir}/root/install_ipfs_go.sh
387
+#!/bin/bash
388
+
389
+if [ ! -d /home/git ]; then
390
+    adduser --disabled-login --gecos 'Gogs' git
391
+
392
+    # install Go
393
+    if ! grep -q "export GOPATH=" ~/.bashrc; then
394
+        echo "export GOPATH=\$GOPATH" >> ~/.bashrc
395
+    else
396
+        sed -i "s|export GOPATH=.*|export GOPATH=\$GOPATH|g" ~/.bashrc
397
+    fi
398
+    systemctl set-environment GOPATH=\$GOPATH
399
+    if ! grep -q "systemctl set-environment GOPATH=" ~/.bashrc; then
400
+        echo "systemctl set-environment GOPATH=\$GOPATH" >> ~/.bashrc
401
+    else
402
+        sed -i "s|systemctl set-environment GOPATH=.*|systemctl set-environment GOPATH=\$GOPATH|g" ~/.bashrc
403
+    fi
404
+    if [ ! -d \$GOPATH ]; then
405
+        mkdir -p \$GOPATH
406
+    fi
407
+fi
408
+
409
+IPFS_PATH=\$GOPATH/bin
410
+export PATH="\$GOPATH/bin:\$PATH:"
411
+if ! grep -q 'GOPATH/bin' ~/.bashrc; then
412
+    echo 'export PATH="\$GOPATH/bin:\$PATH:";' >> ~/.bashrc
413
+else
414
+    sed -i "s|systemctl set-environment GOPATH=.*|systemctl set-environment GOPATH=\$GOPATH|g" ~/.bashrc
415
+fi
416
+
417
+# set gopath for the user
418
+if ! grep -q "GOPATH=" /home/$MY_USERNAME/.bashrc; then
419
+    echo "export GOPATH=$GOPATH" >> /home/$MY_USERNAME/.bashrc
420
+    echo 'export PATH="\$GOPATH/bin:\$PATH:";' >> /home/$MY_USERNAME/.bashrc
421
+else
422
+    sed -i "s|export GOPATH=.*|export GOPATH=\$GOPATH|g" /home/$MY_USERNAME/.bashrc
423
+fi
424
+chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
425
+
426
+IPFS_GO_REPO2=$(echo "$IPFS_GO_REPO" | sed 's|https://||g')
427
+go get -u ${IPFS_GO_REPO2}/cmd/ipfs
428
+if [ ! "$?" = "0" ]; then
429
+    exit 8242
430
+fi
431
+
432
+cd \$GOPATH/src/$IPFS_GO_REPO2
433
+git checkout $IPFS_COMMIT -b $IPFS_COMMIT
434
+exit 0
435
+EOF
436
+    chroot ${rootdir} chmod +x /root/install_ipfs_go.sh
437
+    chroot ${rootdir} /root/install_ipfs_go.sh
438
+    if [ ! "$?" = "0" ]; then
439
+        echo $'Failed to install ipfs go'
440
+        cat ${rootdir}/root/install_ipfs_go.sh
441
+        rm -f ${rootdir}/root/install_ipfs_go.sh
442
+        exit 365728
443
+    fi
444
+    chroot ${rootdir} rm -f /root/install_ipfs_go.sh
445
+
446
+    echo '[Unit]' > ${rootdir}/etc/systemd/system/ipfs.service
447
+    echo 'Description=IPFS go daemon' >> ${rootdir}/etc/systemd/system/ipfs.service
448
+    echo 'After=syslog.target' >> ${rootdir}/etc/systemd/system/ipfs.service
449
+    echo 'After=network.target' >> ${rootdir}/etc/systemd/system/ipfs.service
450
+    echo '' >> ${rootdir}/etc/systemd/system/ipfs.service
451
+    echo '[Service]' >> ${rootdir}/etc/systemd/system/ipfs.service
452
+    echo 'Type=simple' >> ${rootdir}/etc/systemd/system/ipfs.service
453
+    echo "User=$MY_USERNAME" >> ${rootdir}/etc/systemd/system/ipfs.service
454
+    echo "Group=$MY_USERNAME" >> ${rootdir}/etc/systemd/system/ipfs.service
455
+    echo "WorkingDirectory=/home/$MY_USERNAME" >> ${rootdir}/etc/systemd/system/ipfs.service
456
+    echo "ExecStart=$IPFS_PATH/ipfs daemon --mount" >> ${rootdir}/etc/systemd/system/ipfs.service
457
+    echo 'Restart=on-failure' >> ${rootdir}/etc/systemd/system/ipfs.service
458
+    echo "Environment=\"USER=$MY_USERNAME\" \"HOME=/home/$MY_USERNAME\" \"GOPATH=$GOPATH\" \"GVM_ROOT=$GVM_HOME\"" >> ${rootdir}/etc/systemd/system/ipfs.service
459
+    echo '' >> ${rootdir}/etc/systemd/system/ipfs.service
460
+    echo '[Install]' >> ${rootdir}/etc/systemd/system/ipfs.service
461
+    echo 'WantedBy=multi-user.target' >> ${rootdir}/etc/systemd/system/ipfs.service
462
+
463
+    chroot ${rootdir} systemctl enable ipfs
464
+}
378 465
 
379 466
 function install_ipfs_go {
467
+    if [ $INSTALLING_MESH ]; then
468
+        mesh_install_ipfs_go
469
+        return
470
+    fi
380 471
     if grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then
381 472
         return
382 473
     fi
@@ -506,6 +597,6 @@ function install_ipfs_go {
506 597
 }
507 598
 
508 599
 function install_ipfs {
509
-    install_ipfs_js
510
-    #install_ipfs_go
600
+    #install_ipfs_js
601
+    install_ipfs_go
511 602
 }

+ 3
- 2
src/freedombone-image-mesh Datei anzeigen

@@ -726,15 +726,16 @@ function setup_amnesic_data {
726 726
 function setup_ipfs {
727 727
     IPFS_PATH=/usr/bin
728 728
     IPFS_KEY_LENGTH=2048
729
+    IPFS_COMMAND=$IPFS_PATH/ipfs
729 730
 
730
-    su -c "$IPFS_PATH/jsipfs init -b $IPFS_KEY_LENGTH" - $MY_USERNAME
731
+    su -c "$IPFS_COMMAND init -b $IPFS_KEY_LENGTH" - $MY_USERNAME
731 732
     if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
732 733
         echo "IPFS could not be initialised for user $MY_USERNAME" >> $INSTALL_LOG
733 734
         exit 7358
734 735
     fi
735 736
 
736 737
     MY_IPFS_ID=/home/$MY_USERNAME/.ipfs-id
737
-    su -c "echo $($IPFS_PATH/jsipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}') > $MY_IPFS_ID" - $MY_USERNAME
738
+    su -c "echo $($IPFS_COMMAND id | grep '\"ID\":' | awk -F '\"' '{print $4}') > $MY_IPFS_ID" - $MY_USERNAME
738 739
     if [ ! -f $MY_IPFS_ID ]; then
739 740
         echo 'No IPFS identity was created' >> $INSTALL_LOG
740 741
         exit 37895

+ 231
- 105
src/freedombone-utils-go Datei anzeigen

@@ -28,7 +28,11 @@
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
-GO_VERSION=1.5
31
+# For reasons unknown we initially have to upgrade to an intermediate version
32
+# before getting to the version we want
33
+GO_INTERMEDIATE_VERSION=1.4.2
34
+
35
+GO_VERSION=1.6.3
32 36
 
33 37
 GO_PACKAGE_MANAGER_REPO="https://github.com/gpmgo/gopm"
34 38
 GVM_HOME=/home/git/gvm
@@ -36,113 +40,235 @@ GVM_REPO="https://github.com/moovweb/gvm"
36 40
 GVM_COMMIT='25ea8ae158e2861c92e2b22c458e60840157832f'
37 41
 
38 42
 function select_go_version {
39
-	if [ ! -d $GVM_HOME/bin ]; then
40
-		echo $'GVM was not installed'
41
-		exit 629532
42
-	fi
43
-	export GVM_ROOT=$GVM_HOME
44
-	if ! grep -q "GVM_ROOT=" ~/.bashrc; then
45
-		echo "export GVM_ROOT=$GVM_ROOT" >> ~/.bashrc
46
-	else
47
-		sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_ROOT|g" ~/.bashrc
48
-	fi
49
-	cd $GVM_ROOT/bin
50
-	[[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
51
-	gvm use go${GO_VERSION} --default
52
-	systemctl set-environment GOPATH=$GOPATH
53
-
54
-	if [ ${#GOPATH} -lt 2 ]; then
55
-		echo $'GOPATH was not set'
56
-		exit 629825
57
-	fi
43
+    if [ ! -d $GVM_HOME/bin ]; then
44
+        echo $'GVM was not installed'
45
+        exit 629532
46
+    fi
47
+    export GVM_ROOT=$GVM_HOME
48
+    if ! grep -q "GVM_ROOT=" ~/.bashrc; then
49
+        echo "export GVM_ROOT=$GVM_ROOT" >> ~/.bashrc
50
+    else
51
+        sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_ROOT|g" ~/.bashrc
52
+    fi
53
+    cd $GVM_ROOT/bin
54
+    [[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
55
+    gvm use go${GO_VERSION} --default
56
+
57
+    if [ ${#GOPATH} -lt 2 ]; then
58
+        echo $'GOPATH was not set'
59
+        exit 629825
60
+    fi
61
+
62
+    systemctl set-environment GOPATH=$GOPATH
63
+}
64
+
65
+function mesh_upgrade_golang {
66
+    cat <<EOF > ${rootdir}/root/upgrade_golang.sh
67
+#!/bin/bash
68
+
69
+export GVM_ROOT=$GVM_HOME
70
+
71
+apt-get -y install build-essential libc6-dev
72
+apt-get -y install gcc-multilib g++-multilib make
73
+apt-get -y install curl git mercurial binutils bison
74
+if [ ! -d $INSTALL_DIR ]; then
75
+    mkdir $INSTALL_DIR
76
+fi
77
+cd $INSTALL_DIR
78
+
79
+git clone $GVM_REPO gvm
80
+
81
+cd $INSTALL_DIR/gvm
82
+git checkout $GVM_COMMIT -b $GVM_COMMIT
83
+if [ ! -f binscripts/gvm-installer ]; then
84
+    echo $'gvm installer not found'
85
+fi
86
+chmod +x binscripts/gvm-installer
87
+
88
+if [ -d /root/.gvm ]; then
89
+    rm -rf /root/.gvm
90
+fi
91
+if [ -d $GVM_HOME ]; then
92
+    rm -rf $GVM_HOME
93
+fi
94
+if ! grep -q "export GVM_ROOT=" ~/.bashrc; then
95
+    echo "export GVM_ROOT=$GVM_HOME" >> ~/.bashrc
96
+else
97
+    sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_HOME|g" ~/.bashrc
98
+fi
99
+
100
+if [ ! -d /home/git ]; then
101
+    adduser --disabled-login --gecos 'Gogs' git
102
+fi
103
+if [ -d /home/git/Maildir ]; then
104
+    rm -rf /home/git/Maildir
105
+fi
106
+
107
+./binscripts/gvm-installer master /home/git
108
+
109
+if [ ! -d $GVM_HOME ]; then
110
+    echo $'Unable to install gvm'
111
+    exit 83537
112
+fi
113
+
114
+[[ -s "$GVM_HOME/scripts/gvm" ]] && source "$GVM_HOME/scripts/gvm"
115
+if [ ! -f $GVM_HOME/bin/gvm ]; then
116
+    echo $'gvm was not installed'
117
+fi
118
+if ! grep -q "export GVM_ROOT=" ~/.bashrc; then
119
+    echo "export GVM_ROOT=$GVM_HOME" >> ~/.bashrc
120
+fi
121
+
122
+cd $GVM_HOME/bin
123
+
124
+$GVM_HOME/bin/gvm install go${GO_INTERMEDIATE_VERSION}
125
+if [ ! "\$?" = "0" ]; then
126
+    echo $"Unable to install intermediate go version ${GO_INTERMEDIATE_VERSION}"
127
+    if [ -f $GVM_HOME/logs/go-go${GO_INTERMEDIATE_VERSION}-compile.log ]; then
128
+        cat $GVM_HOME/logs/go-go${GO_INTERMEDIATE_VERSION}-compile.log
129
+    fi
130
+    exit 352872
131
+fi
132
+
133
+export GOROOT_BOOTSTRAP=/home/git/gvm/gos/go${GO_INTERMEDIATE_VERSION}
134
+
135
+$GVM_HOME/bin/gvm install go${GO_VERSION}
136
+if [ ! "\$?" = "0" ]; then
137
+    echo $"Unable to install go version ${GO_VERSION}"
138
+    if [ -f $GVM_HOME/logs/go-go${GO_VERSION}-compile.log ]; then
139
+        cat $GVM_HOME/logs/go-go${GO_VERSION}-compile.log
140
+    fi
141
+    exit 529252
142
+fi
143
+
144
+chown -R git:git $GVM_HOME
145
+
146
+if [ ! -d $GVM_HOME/bin ]; then
147
+    echo $'GVM was not installed'
148
+    exit 629532
149
+fi
150
+
151
+if ! grep -q "GVM_ROOT=" ~/.bashrc; then
152
+    echo "export GVM_ROOT=$GVM_HOME" >> ~/.bashrc
153
+else
154
+    sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_HOME|g" ~/.bashrc
155
+fi
156
+
157
+cd $GVM_HOME/bin
158
+[[ -s "$GVM_HOME/scripts/gvm" ]] && source "$GVM_HOME/scripts/gvm"
159
+#$GVM_HOME/bin/gvm use go${GO_VERSION} --default
160
+#if [ ! "\$?" = "0" ]; then
161
+#    echo $"Unable to use go version ${GO_VERSION}"
162
+#    if [ -f $GVM_HOME/logs/go-go${GO_VERSION}-compile.log ]; then
163
+#        cat $GVM_HOME/logs/go-go${GO_VERSION}-compile.log
164
+#    fi
165
+#fi
166
+
167
+echo "export GOPATH=/home/git/gvm/pkgsets/go${GO_VERSION}/global" >> ~/.bashrc
168
+export GOPATH=/home/git/gvm/pkgsets/go${GO_VERSION}/global
169
+systemctl set-environment GOPATH=\$GOPATH
170
+
171
+exit 0
172
+EOF
173
+    chroot ${rootdir} chmod +x /root/upgrade_golang.sh
174
+    chroot ${rootdir} /root/upgrade_golang.sh
175
+    if [ ! "$?" = "0" ]; then
176
+        echo $'Failed to upgrade golang'
177
+        cat ${rootdir}/root/upgrade_golang.sh
178
+        rm -f ${rootdir}/root/upgrade_golang.sh
179
+        exit 836535
180
+    fi
181
+    rm -f ${rootdir}/root/upgrade_golang.sh
58 182
 }
59 183
 
60 184
 function upgrade_golang {
61
-	if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
62
-		return
63
-	fi
64
-
65
-	# NOTE: this is annoyingly hacky and going in the opposite
66
-	# direction of a pure blend, but it's necessary if you want
67
-	# to run the latest version of gogs
68
-
69
-	# update to the next commit
70
-	function_check set_repo_commit
71
-	set_repo_commit $INSTALL_DIR/gvm "gvm commit" "$GVM_COMMIT" $GVM_REPO
72
-
73
-	if grep -Fxq "upgrade_golang" $COMPLETION_FILE; then
74
-		return
75
-	fi
76
-
77
-	export GVM_ROOT=$GVM_HOME
78
-
79
-	apt-get -y install curl git mercurial make binutils bison gcc build-essential
80
-	if [ ! -d $INSTALL_DIR ]; then
81
-		mkdir $INSTALL_DIR
82
-	fi
83
-	cd $INSTALL_DIR
84
-	function_check git_clone
85
-	git_clone $GVM_REPO gvm
86
-	cd $INSTALL_DIR/gvm
87
-	git checkout $GVM_COMMIT -b $GVM_COMMIT
88
-	if [ ! -f binscripts/gvm-installer ]; then
89
-		echo $'gvm installer not found'
90
-	fi
91
-	chmod +x binscripts/gvm-installer
92
-
93
-	if [ -d /root/.gvm ]; then
94
-		rm -rf /root/.gvm
95
-	fi
96
-	if [ -d $GVM_ROOT ]; then
97
-		rm -rf $GVM_ROOT
98
-	fi
99
-	sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_ROOT|g" ~/.bashrc
100
-
101
-	if [ ! -d /home/git ]; then
102
-		# add a gogs user account within which the gvm home directory will exist
103
-		adduser --disabled-login --gecos 'Gogs' git
104
-	fi
105
-	if [ -d /home/git/Maildir ]; then
106
-		rm -rf /home/git/Maildir
107
-	fi
108
-
109
-	# TODO: this script is all over the place
110
-	# and contains hardcoded github. See if you can do better
111
-	./binscripts/gvm-installer master /home/git
112
-
113
-	if [ ! -d $GVM_ROOT ]; then
114
-		echo $'Unable to install gvm'
115
-		exit 83537
116
-	fi
117
-
118
-	[[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
119
-	if [ ! -f $GVM_ROOT/bin/gvm ]; then
120
-		echo $'gvm was not installed'
121
-	fi
122
-	if ! grep -q "export GVM_ROOT=" ~/.bashrc; then
123
-		echo "export GVM_ROOT=$GVM_ROOT" >> ~/.bashrc
124
-	fi
125
-
126
-	cd $GVM_ROOT/bin
127
-	gvm install go1.4
128
-	gvm use go1.4
129
-	export GOROOT_BOOTSTRAP=$GOROOT
130
-	gvm install go${GO_VERSION}
131
-	if [ ! "$?" = "0" ]; then
132
-		echo $'Unable to upgrade golang'
133
-		exit 529252
134
-	fi
135
-	gvm use go${GO_VERSION} --default
136
-
137
-	chown -R git:git $GVM_HOME
138
-
139
-	if ! grep -q "gvm commit" $COMPLETION_FILE; then
140
-		echo "gvm commit:$GVM_COMMIT" >> $COMPLETION_FILE
141
-	else
142
-		sed -i "s/gvm commit.*/gvm commit:$GVM_COMMIT/g" $COMPLETION_FILE
143
-	fi
144
-
145
-	echo 'upgrade_golang' >> $COMPLETION_FILE
185
+    if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
186
+        return
187
+    fi
188
+
189
+    # NOTE: this is annoyingly hacky and going in the opposite
190
+    # direction of a pure blend, but it's necessary if you want
191
+    # to run the latest version of gogs
192
+
193
+    # update to the next commit
194
+    function_check set_repo_commit
195
+    set_repo_commit $INSTALL_DIR/gvm "gvm commit" "$GVM_COMMIT" $GVM_REPO
196
+
197
+    if grep -Fxq "upgrade_golang" $COMPLETION_FILE; then
198
+        return
199
+    fi
200
+
201
+    export GVM_ROOT=$GVM_HOME
202
+
203
+    apt-get -y install build-essential libc6-dev-i386 gcc-multilib g++-multilib
204
+    apt-get -y install gcc curl git mercurial make binutils bison
205
+    if [ ! -d $INSTALL_DIR ]; then
206
+        mkdir $INSTALL_DIR
207
+    fi
208
+    cd $INSTALL_DIR
209
+    function_check git_clone
210
+    git_clone $GVM_REPO gvm
211
+    cd $INSTALL_DIR/gvm
212
+    git checkout $GVM_COMMIT -b $GVM_COMMIT
213
+    if [ ! -f binscripts/gvm-installer ]; then
214
+        echo $'gvm installer not found'
215
+    fi
216
+    chmod +x binscripts/gvm-installer
217
+
218
+    if [ -d /root/.gvm ]; then
219
+        rm -rf /root/.gvm
220
+    fi
221
+    if [ -d $GVM_ROOT ]; then
222
+        rm -rf $GVM_ROOT
223
+    fi
224
+    sed -i "s|export GVM_ROOT=.*|export GVM_ROOT=$GVM_ROOT|g" ~/.bashrc
225
+
226
+    if [ ! -d /home/git ]; then
227
+        # add a gogs user account within which the gvm home directory will exist
228
+        adduser --disabled-login --gecos 'Gogs' git
229
+    fi
230
+    if [ -d /home/git/Maildir ]; then
231
+        rm -rf /home/git/Maildir
232
+    fi
233
+
234
+    # TODO: this script is all over the place
235
+    # and contains hardcoded github. See if you can do better
236
+    ./binscripts/gvm-installer master /home/git
237
+
238
+    if [ ! -d $GVM_ROOT ]; then
239
+        echo $'Unable to install gvm'
240
+        exit 83537
241
+    fi
242
+
243
+    [[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
244
+    if [ ! -f $GVM_ROOT/bin/gvm ]; then
245
+        echo $'gvm was not installed'
246
+    fi
247
+    if ! grep -q "export GVM_ROOT=" ~/.bashrc; then
248
+        echo "export GVM_ROOT=$GVM_ROOT" >> ~/.bashrc
249
+    fi
250
+
251
+    export GOROOT_BOOTSTRAP=$GOROOT
252
+
253
+    cd $GVM_ROOT/bin
254
+    gvm install go${GO_INTERMEDIATE_VERSION}
255
+    gvm use go${GO_INTERMEDIATE_VERSION}
256
+    gvm install go${GO_VERSION}
257
+    if [ ! "$?" = "0" ]; then
258
+        echo $'Unable to upgrade golang'
259
+        exit 529252
260
+    fi
261
+    gvm use go${GO_VERSION} --default
262
+
263
+    chown -R git:git $GVM_HOME
264
+
265
+    if ! grep -q "gvm commit" $COMPLETION_FILE; then
266
+        echo "gvm commit:$GVM_COMMIT" >> $COMPLETION_FILE
267
+    else
268
+        sed -i "s/gvm commit.*/gvm commit:$GVM_COMMIT/g" $COMPLETION_FILE
269
+    fi
270
+
271
+    echo 'upgrade_golang' >> $COMPLETION_FILE
146 272
 }
147 273
 
148 274
 # NOTE: deliberately there is no "exit 0"

+ 2
- 1
src/zeronetavahi Datei anzeigen

@@ -52,7 +52,8 @@ ZERONET_INDEX=$ZERONET_INSTALL/mesh.html
52 52
 ZERONET_CONFIG=$ZERONET_INSTALL/bootstrap
53 53
 
54 54
 IPFS_PORT=4001
55
-IPFS_COMMAND=/usr/bin/jsipfs
55
+IPFS_PATH=/usr/bin
56
+IPFS_COMMAND=$IPFS_PATH/ipfs
56 57
 
57 58
 MY_BLOG_STR=$"My Blog"
58 59
 MY_MAIL_STR=$"My Mail"

+ 3
- 2
website/EN/homeserver.html Datei anzeigen

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2016-08-09 Tue 19:25 -->
6
+<!-- 2016-08-14 Sun 13:17 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title></title>
@@ -256,7 +256,8 @@ First you will need to create an image.
256 256
 <div class="org-src-container">
257 257
 
258 258
 <pre class="src src-bash">sudo su
259
-apt-get -y install build-essential git python-docutils mktorrent <span class="org-sh-escaped-newline">\</span>
259
+apt-get -y install build-essential libc6-dev-i386 <span class="org-sh-escaped-newline">\</span>
260
+gcc-multilib g++-multilib git python-docutils mktorrent <span class="org-sh-escaped-newline">\</span>
260 261
 vmdebootstrap xz-utils dosfstools btrfs-tools extlinux <span class="org-sh-escaped-newline">\</span>
261 262
 python-distro-info mbr qemu-user-static binfmt-support <span class="org-sh-escaped-newline">\</span>
262 263
 u-boot-tools qemu

+ 3
- 2
website/EN/mesh.html Datei anzeigen

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2016-08-09 Tue 19:41 -->
6
+<!-- 2016-08-14 Sun 13:19 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title></title>
@@ -263,7 +263,8 @@ First you will need to create an image.
263 263
 <div class="org-src-container">
264 264
 
265 265
 <pre class="src src-bash">sudo su
266
-apt-get -y install build-essential git python-docutils mktorrent <span class="org-sh-escaped-newline">\</span>
266
+apt-get -y install build-essential libc6-dev-i386 <span class="org-sh-escaped-newline">\</span>
267
+gcc-multilib g++-multilib git python-docutils mktorrent <span class="org-sh-escaped-newline">\</span>
267 268
 vmdebootstrap xz-utils dosfstools btrfs-tools extlinux <span class="org-sh-escaped-newline">\</span>
268 269
 python-distro-info mbr qemu-user-static binfmt-support <span class="org-sh-escaped-newline">\</span>
269 270
 u-boot-tools qemu