diff --git a/man/freedombone-image.1.gz b/man/freedombone-image.1.gz index 9e85f2d5..0ed01bb2 100644 Binary files a/man/freedombone-image.1.gz and b/man/freedombone-image.1.gz differ diff --git a/src/freedombone-image b/src/freedombone-image index 1fa58ef1..fc920275 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -114,6 +114,10 @@ WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg # Whether to install non-free wifi drivers for the mesh client INSECURE='no' +# for mesh installs whether to delete all data and generate +# a new identity at every shutdown/boot +AMNESIC='no' + mesh_router_setup_script() { # create a setup script for a mesh router mesh_script_filename=$1 @@ -223,6 +227,10 @@ do shift ONION_ONLY="$1" ;; + -a|--amnesic) + shift + ONION_ONLY="$1" + ;; -r|--repo|--repository) shift PROJECT_REPO="$1" @@ -385,7 +393,8 @@ make $IMAGE_TYPE \ WIFI_NETWORKS_FILE="$WIFI_NETWORKS_FILE" \ VARIANT="$VARIANT" \ MINIMUM_PASSWORD_LENGTH="$MINIMUM_PASSWORD_LENGTH" \ - INSECURE="$INSECURE" + INSECURE="$INSECURE" \ + AMNESIC="$AMNESIC" if [ ! "$?" = "0" ]; then echo $'Build failed' diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 69a2a82a..c9e4bab4 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -102,6 +102,10 @@ BROWSER=iceweasel MESH_INSTALL_DIR=/var/lib +# for mesh installs whether to delete all data and generate +# a new identity at every shutdown/boot +AMNESIC='no' + enable_eatmydata_override() { chroot $rootdir apt-get install --no-install-recommends -y eatmydata if [ -x $rootdir/usr/bin/eatmydata ] && \ @@ -536,6 +540,11 @@ initialise_mesh() { MESH_SERVICE='mesh-setup.service' MESH_SETUP_DAEMON=$rootdir/etc/systemd/system/$MESH_SERVICE + MESH_STARTUP_PARAMS="${MY_USERNAME}" + if [[ $AMNESIC != 'no' ]]; then + MESH_STARTUP_PARAMS="${MY_USERNAME} amnesic" + fi + echo '[Unit]' > $MESH_SETUP_DAEMON echo 'Description=Initial mesh router configuration' >> $MESH_SETUP_DAEMON echo 'After=syslog.target' >> $MESH_SETUP_DAEMON @@ -545,7 +554,7 @@ initialise_mesh() { echo 'User=root' >> $MESH_SETUP_DAEMON echo 'Group=root' >> $MESH_SETUP_DAEMON echo 'WorkingDirectory=/root' >> $MESH_SETUP_DAEMON - echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-image-mesh ${MY_USERNAME} > /var/log/mesh-setup.log" >> $MESH_SETUP_DAEMON + echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-image-mesh ${MESH_STARTUP_PARAMS} > /var/log/mesh-setup.log" >> $MESH_SETUP_DAEMON echo '' >> $MESH_SETUP_DAEMON echo 'TimeoutSec=99999' >> $MESH_SETUP_DAEMON echo '' >> $MESH_SETUP_DAEMON diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 5df12f00..52fb1c7b 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -71,6 +71,7 @@ export WIFI_NETWORKS_FILE export VARIANT export MINIMUM_PASSWORD_LENGTH export INSECURE +export AMNESIC # Locate vmdebootstrap program fetched in Makefile basedir=`pwd` @@ -222,6 +223,7 @@ sed -i "s|WIFI_NETWORKS_FILE=.*|WIFI_NETWORKS_FILE=\"${WIFI_NETWORKS_FILE}\"|g" sed -i "s|VARIANT=.*|VARIANT=\"${VARIANT}\"|g" $TEMP_CUSTOMISE3 sed -i "s|MINIMUM_PASSWORD_LENGTH=.*|MINIMUM_PASSWORD_LENGTH=\"${MINIMUM_PASSWORD_LENGTH}\"|g" $TEMP_CUSTOMISE3 sed -i "s|INSECURE=.*|INSECURE=\"${INSECURE}\"|g" $TEMP_CUSTOMISE3 +sed -i "s|AMNESIC=.*|AMNESIC=\"${AMNESIC}\"|g" $TEMP_CUSTOMISE3 sed -i 's|#!/bin/bash||g' $TEMP_CUSTOMISE3 cat $TEMP_CUSTOMISE2 $TEMP_CUSTOMISE3 > $TEMP_CUSTOMISE4