浏览代码

Beginning of usb client builds with user interfaces

Bob Mottram 8 年前
父节点
当前提交
ee2dd373ef
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 34 次插入12 次删除
  1. 0
    7
      src/freedombone-image
  2. 24
    5
      src/freedombone-image-customise
  3. 10
    0
      src/freedombone-image-make

+ 0
- 7
src/freedombone-image 查看文件

285
 	PASSWORD=$GENERIC_IMAGE_PASSWORD
285
 	PASSWORD=$GENERIC_IMAGE_PASSWORD
286
 fi
286
 fi
287
 
287
 
288
-# If this is a mesh variant then create an appropriate script
289
-#if [[ $VARIANT == "mesh"* ]]; then
290
-#CONFIG_FILENAME=/tmp/${PROJECT_NAME}_mesh.cfg
291
-#mesh_router_setup_script $CONFIG_FILENAME
292
-#DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
293
-#fi
294
-
295
 if [ ! $PASSWORD ]; then
288
 if [ ! $PASSWORD ]; then
296
 	# generate a random password
289
 	# generate a random password
297
 	PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"
290
 	PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"

+ 24
- 5
src/freedombone-image-customise 查看文件

242
 	fi
242
 	fi
243
 
243
 
244
 	# Don't install any configuration. This will be a base system
244
 	# Don't install any configuration. This will be a base system
245
-	if [[ $VARIANT != "mesh" ]]; then
245
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" ]]; then
246
 		CONFIG_FILENAME=
246
 		CONFIG_FILENAME=
247
 	else
247
 	else
248
 		touch $rootdir/root/.initial_mesh_setup
248
 		touch $rootdir/root/.initial_mesh_setup
319
 	echo "    git pull" >> $rootdir/root/.bashrc
319
 	echo "    git pull" >> $rootdir/root/.bashrc
320
 	echo "    make install" >> $rootdir/root/.bashrc
320
 	echo "    make install" >> $rootdir/root/.bashrc
321
 
321
 
322
-	if [[ $VARIANT != "mesh" ]]; then
322
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
323
 		if [[ $ONION_ONLY == "no" ]]; then
323
 		if [[ $ONION_ONLY == "no" ]]; then
324
 			if [[ $MINIMAL_INSTALL == "no" ]]; then
324
 			if [[ $MINIMAL_INSTALL == "no" ]]; then
325
 				echo "    ${PROJECT_NAME} menuconfig-full" >> $rootdir/root/.bashrc
325
 				echo "    ${PROJECT_NAME} menuconfig-full" >> $rootdir/root/.bashrc
340
 	echo "            touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
340
 	echo "            touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
341
 	echo '            shred -zu ~/login.txt' >> $rootdir/root/.bashrc
341
 	echo '            shred -zu ~/login.txt' >> $rootdir/root/.bashrc
342
 	END_MESSAGE1=$'Congratulations!'
342
 	END_MESSAGE1=$'Congratulations!'
343
-	if [[ $VARIANT != "mesh" ]]; then
343
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
344
 		END_MESSAGE2=$'\nYour system has now installed\n\nThe onion ssh service is at $SSH_ONION_HOSTNAME\n\nPress any key to reboot and begin using it'
344
 		END_MESSAGE2=$'\nYour system has now installed\n\nThe onion ssh service is at $SSH_ONION_HOSTNAME\n\nPress any key to reboot and begin using it'
345
 		echo '            SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
345
 		echo '            SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
346
 	else
346
 	else
400
 }
400
 }
401
 
401
 
402
 configure_wifi() {
402
 configure_wifi() {
403
-	if [[ $VARIANT == "mesh" ]]; then
403
+	if [[ $VARIANT == "mesh" || $VARIANT == "meshclient" ]]; then
404
 		return
404
 		return
405
 	fi
405
 	fi
406
 
406
 
953
 }
953
 }
954
 
954
 
955
 initialise_mesh() {
955
 initialise_mesh() {
956
-	if [[ $VARIANT != "mesh" || $DEBIAN_INSTALL_ONLY != "no" ]]; then
956
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" ]]; then
957
+		return
958
+	fi
959
+	if [[ $DEBIAN_INSTALL_ONLY != "no" ]]; then
957
 		return
960
 		return
958
 	fi
961
 	fi
959
 
962
 
986
 	chroot "$rootdir" systemctl enable $MESH_SERVICE
989
 	chroot "$rootdir" systemctl enable $MESH_SERVICE
987
 }
990
 }
988
 
991
 
992
+# User interface for USB drive installs ######################################
993
+
994
+function configure_user_interface {
995
+	if [[ $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
996
+		return
997
+	fi
998
+
999
+	chroot "$rootdir" apt-get -y install mate-desktop-environment
1000
+
1001
+	if [[ $VARIANT == "usb" ]]; then
1002
+		chroot "$rootdir" apt-get -y install tor
1003
+		# TODO
1004
+	fi
1005
+}
1006
+
989
 ##############################################################################
1007
 ##############################################################################
990
 
1008
 
991
 
1009
 
1110
 continue_installation
1128
 continue_installation
1111
 initialise_mesh
1129
 initialise_mesh
1112
 configure_wifi
1130
 configure_wifi
1131
+configure_user_interface
1113
 
1132
 
1114
 cd /
1133
 cd /
1115
 echo $"info: killing leftover processes in chroot"
1134
 echo $"info: killing leftover processes in chroot"

+ 10
- 0
src/freedombone-image-make 查看文件

127
  --grub \
127
  --grub \
128
  --roottype btrfs \
128
  --roottype btrfs \
129
 "   ;;
129
 "   ;;
130
+	usb)
131
+		extra_opts="\
132
+ --grub \
133
+ --roottype btrfs \
134
+"   ;;
135
+	meshclient)
136
+		extra_opts="\
137
+ --grub \
138
+ --roottype btrfs \
139
+"   ;;
130
 	all)
140
 	all)
131
 		extra_opts="\
141
 		extra_opts="\
132
  --grub \
142
  --grub \