Parcourir la source

Beginning of usb client builds with user interfaces

Bob Mottram il y a 8 ans
Parent
révision
ee2dd373ef
Aucun compte lié à l'adresse email de l'auteur
3 fichiers modifiés avec 34 ajouts et 12 suppressions
  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 Voir le fichier

@@ -285,13 +285,6 @@ if [[ $GENERIC_IMAGE == "yes" ]]; then
285 285
 	PASSWORD=$GENERIC_IMAGE_PASSWORD
286 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 288
 if [ ! $PASSWORD ]; then
296 289
 	# generate a random password
297 290
 	PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"

+ 24
- 5
src/freedombone-image-customise Voir le fichier

@@ -242,7 +242,7 @@ create_generic_image() {
242 242
 	fi
243 243
 
244 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 246
 		CONFIG_FILENAME=
247 247
 	else
248 248
 		touch $rootdir/root/.initial_mesh_setup
@@ -319,7 +319,7 @@ EOF
319 319
 	echo "    git pull" >> $rootdir/root/.bashrc
320 320
 	echo "    make install" >> $rootdir/root/.bashrc
321 321
 
322
-	if [[ $VARIANT != "mesh" ]]; then
322
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
323 323
 		if [[ $ONION_ONLY == "no" ]]; then
324 324
 			if [[ $MINIMAL_INSTALL == "no" ]]; then
325 325
 				echo "    ${PROJECT_NAME} menuconfig-full" >> $rootdir/root/.bashrc
@@ -340,7 +340,7 @@ EOF
340 340
 	echo "            touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
341 341
 	echo '            shred -zu ~/login.txt' >> $rootdir/root/.bashrc
342 342
 	END_MESSAGE1=$'Congratulations!'
343
-	if [[ $VARIANT != "mesh" ]]; then
343
+	if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
344 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 345
 		echo '            SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
346 346
 	else
@@ -400,7 +400,7 @@ atheros_wifi() {
400 400
 }
401 401
 
402 402
 configure_wifi() {
403
-	if [[ $VARIANT == "mesh" ]]; then
403
+	if [[ $VARIANT == "mesh" || $VARIANT == "meshclient" ]]; then
404 404
 		return
405 405
 	fi
406 406
 
@@ -953,7 +953,10 @@ function mesh_zeronet {
953 953
 }
954 954
 
955 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 960
 		return
958 961
 	fi
959 962
 
@@ -986,6 +989,21 @@ initialise_mesh() {
986 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,6 +1128,7 @@ atheros_wifi
1110 1128
 continue_installation
1111 1129
 initialise_mesh
1112 1130
 configure_wifi
1131
+configure_user_interface
1113 1132
 
1114 1133
 cd /
1115 1134
 echo $"info: killing leftover processes in chroot"

+ 10
- 0
src/freedombone-image-make Voir le fichier

@@ -127,6 +127,16 @@ case "$MACHINE" in
127 127
  --grub \
128 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 140
 	all)
131 141
 		extra_opts="\
132 142
  --grub \