From 48cee051abce6b0a99ea31d4b3f4d2351f821e7e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 23 Jun 2016 11:04:04 +0100 Subject: [PATCH] Optionally install proprietary firmware for wifi on mesh variants --- man/freedombone-image.1.gz | Bin 3377 -> 3377 bytes src/freedombone-image | 10 +++++++++- src/freedombone-image-customise | 20 ++++++++++++++++++++ src/freedombone-image-make | 2 ++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/man/freedombone-image.1.gz b/man/freedombone-image.1.gz index e00ea81f6ae64d3c61f52df81c246842f6144b97..497cc86f9736ef4d2fa00b0966c3fd0562576c82 100644 GIT binary patch delta 15 WcmdlewNZ*qzMF&L?dFYa+PnZL@C4of delta 15 WcmdlewNZ*qzMF&L_xg=&+PnZMFa+oT diff --git a/src/freedombone-image b/src/freedombone-image index 828015c7..001a983c 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -118,6 +118,9 @@ WIFI_PASSPHRASE= WIFI_HOTSPOT='no' WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg +# Whether to install non-free wifi drivers for the mesh client +INSECURE='no' + mesh_router_setup_script() { # create a setup script for a mesh router mesh_script_filename=$1 @@ -265,6 +268,10 @@ do shift WIFI_NETWORKS_FILE="$1" ;; + --insecure) + shift + INSECURE="$1" + ;; *) # unknown option ;; @@ -376,7 +383,8 @@ make $IMAGE_TYPE \ WIFI_HOTSPOT="$WIFI_HOTSPOT" \ WIFI_NETWORKS_FILE="$WIFI_NETWORKS_FILE" \ VARIANT="$VARIANT" \ - MINIMUM_PASSWORD_LENGTH="$MINIMUM_PASSWORD_LENGTH" + MINIMUM_PASSWORD_LENGTH="$MINIMUM_PASSWORD_LENGTH" \ + INSECURE="$INSECURE" if [ ! "$?" = "0" ]; then echo $'Build failed' diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 8647447a..612c738b 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -91,6 +91,9 @@ WIFI_PASSPHRASE= WIFI_HOTSPOT='no' WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg +# Whether to install non-free wifi drivers for the mesh client +INSECURE='no' + enable_eatmydata_override() { chroot $rootdir apt-get install --no-install-recommends -y eatmydata if [ -x $rootdir/usr/bin/eatmydata ] && \ @@ -963,6 +966,23 @@ initialise_mesh() { return fi + if [[ $INSECURE == $'yes' ]]; then + echo '*********************************************************' + echo $'WARNING: non-free wifi drivers are being installed.' + echo $' This may compromise the security of your system.' + echo '*********************************************************' + + # enable non-free repo + if ! grep -q "non-free" $rootdir/etc/apt/sources.list; then + chroot "$rootdir" sed -i "s| main| main non-free|g" /etc/apt/sources.list + chroot "$rootdir" apt-get update + fi + + # install proprietary wifi drivers + # see https://wiki.debian.org/iwlwifi + chroot "$rootdir" apt-get -y install firmware-iwlwifi + fi + mesh_firewall mesh_avahi mesh_batman diff --git a/src/freedombone-image-make b/src/freedombone-image-make index bdb21489..25ab91aa 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -64,6 +64,7 @@ export WIFI_HOTSPOT export WIFI_NETWORKS_FILE export VARIANT export MINIMUM_PASSWORD_LENGTH +export INSECURE # Locate vmdebootstrap program fetched in Makefile basedir=`pwd` @@ -197,6 +198,7 @@ sudo sed -i "s|WIFI_HOTSPOT=.*|WIFI_HOTSPOT=\"${WIFI_HOTSPOT}\"|g" $TEMP_CUSTOMI sudo sed -i "s|WIFI_NETWORKS_FILE=.*|WIFI_NETWORKS_FILE=\"${WIFI_NETWORKS_FILE}\"|g" $TEMP_CUSTOMISE sudo sed -i "s|VARIANT=.*|VARIANT=\"${VARIANT}\"|g" $TEMP_CUSTOMISE sudo sed -i "s|MINIMUM_PASSWORD_LENGTH=.*|MINIMUM_PASSWORD_LENGTH=\"${MINIMUM_PASSWORD_LENGTH}\"|g" $TEMP_CUSTOMISE +sudo sed -i "s|INSECURE=.*|INSECURE=\"${INSECURE}\"|g" $TEMP_CUSTOMISE echo $"starting $VMDEBOOTSTRAP" # Run vmdebootstrap script to create image