Browse Source

Install tomb on mesh images

Bob Mottram 9 years ago
parent
commit
47156dfcf8
2 changed files with 28 additions and 2 deletions
  1. 1
    0
      src/freedombone-image-customise
  2. 27
    2
      src/freedombone-utils-filesystem

+ 1
- 0
src/freedombone-image-customise View File

@@ -533,6 +533,7 @@ initialise_mesh() {
533 533
 	configure_firewall
534 534
 	install_avahi
535 535
 	install_batman
536
+	install_tomb
536 537
 	install_tox
537 538
 	install_web_server
538 539
 	install_zeronet

+ 27
- 2
src/freedombone-utils-filesystem View File

@@ -31,7 +31,33 @@
31 31
 TOMB_REPO="https://github.com/dyne/Tomb"
32 32
 TOMB_COMMIT='c80ebd6d6ed77980eb5b559757e03ea13a29bdd1'
33 33
 
34
+function mesh_install_tomb {
35
+	chroot ${rootdir} apt-get -y install cryptsetup zsh
36
+
37
+	if [ ! -d ${rootdir}/$INSTALL_DIR ]; then
38
+		mkdir -p ${rootdir}/$INSTALL_DIR
39
+	fi
40
+
41
+	git_clone $TOMB_REPO ${rootdir}/$INSTALL_DIR/tomb
42
+	cd ${rootdir}/$INSTALL_DIR/tomb
43
+
44
+	git checkout $TOMB_COMMIT -b $TOMB_COMMIT
45
+
46
+	chroot ${rootdir} /bin/bash -x <<EOF
47
+cd $INSTALL_DIR/tomb
48
+make install
49
+EOF
50
+	if [ ! -f ${rootdir}/usr/local/bin/tomb ]; then
51
+		exit 93462
52
+	fi
53
+}
54
+
34 55
 function install_tomb {
56
+	if [ $INSTALLING_MESH ]; then
57
+		mesh_install_tomb
58
+		return
59
+	fi
60
+
35 61
 	function_check set_repo_commit
36 62
 	set_repo_commit $INSTALL_DIR/tomb "Tomb commit" "$TOMB_COMMIT" $TOMB_REPO
37 63
 
@@ -46,9 +72,8 @@ function install_tomb {
46 72
 	if [ ! -d $INSTALL_DIR ]; then
47 73
 		mkdir -p $INSTALL_DIR
48 74
 	fi
49
-	cd $INSTALL_DIR
50 75
 
51
-	git_clone $TOMB_REPO tomb
76
+	git_clone $TOMB_REPO $INSTALL_DIR/tomb
52 77
 	cd $INSTALL_DIR/tomb
53 78
 
54 79
 	git checkout $TOMB_COMMIT -b $TOMB_COMMIT