From 770a76a4507f9c3b737e3fd898d3a6ef6124b0c1 Mon Sep 17 00:00:00 2001 From: Alexey Rogachevskiy Date: Thu, 20 Feb 2020 22:11:24 +0300 Subject: [PATCH] init_rpi: Place wpa_supplicant.conf to /boot --- builder/assets/init_rpi.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/builder/assets/init_rpi.sh b/builder/assets/init_rpi.sh index 606813e6..8054ebfd 100755 --- a/builder/assets/init_rpi.sh +++ b/builder/assets/init_rpi.sh @@ -38,7 +38,12 @@ echo_stamp() { NEW_SSID='clover-'$(head -c 100 /dev/urandom | xxd -ps -c 100 | sed -e "s/[^0-9]//g" | cut -c 1-4) echo_stamp "Setting SSID to ${NEW_SSID}" # TODO: Use wpa_cli insted direct file edit -cat << EOF >> /etc/wpa_supplicant/wpa_supplicant.conf +# FIXME: We rely on raspberrypi-net-mods to copy our file to /etc/wpa_supplicant. +# This is not very reliable, but seems to fix our rfkill problem. +cat << EOF >> /boot/wpa_supplicant.conf +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +update_config=1 +country=GB network={ ssid="${NEW_SSID}" psk="cloverwifi" @@ -51,9 +56,6 @@ network={ } EOF -echo_stamp "Unblocking wireless interface" -rfkill unblock wifi - NEW_HOSTNAME=$(echo ${NEW_SSID} | tr '[:upper:]' '[:lower:]') echo_stamp "Setting hostname to $NEW_HOSTNAME" hostnamectl set-hostname $NEW_HOSTNAME