More mesh amnesia

This commit is contained in:
Bob Mottram 2016-07-22 13:15:18 +01:00
parent 3f01621a23
commit 3f5598f63b
4 changed files with 22 additions and 2 deletions

Binary file not shown.

View File

@ -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'

View File

@ -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

View File

@ -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