diff --git a/builder/assets/init_rpi.sh b/builder/assets/init_rpi.sh index 6eea1111b..bece14b2e 100755 --- a/builder/assets/init_rpi.sh +++ b/builder/assets/init_rpi.sh @@ -16,25 +16,15 @@ set -e # Exit immidiately on non-zero result NEW_SSID='clover-'$(head -c 100 /dev/urandom | xxd -ps -c 100 | sed -e "s/[^0-9]//g" | cut -c 1-4) -echo "--- Setting SSID to ${NEW_SSID}" -# TODO: Use wpa_cli insted direct file edit -# 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" - mode=2 - proto=WPA RSN - key_mgmt=WPA-PSK - pairwise=CCMP - group=CCMP - auth_alg=OPEN -} -EOF +echo "--- Creating Wi-Fi AP with SSID=${NEW_SSID}" +nmcli con add type wifi ifname wlan0 mode ap con-name clover ssid $NEW_SSID autoconnect true +nmcli con modify TEST-AP 802-11-wireless.band bg +# nmcli con modify TEST-AP 802-11-wireless.channel 6 +nmcli con modify TEST-AP ipv4.method shared ipv4.address 192.168.11.1/24 +nmcli con modify TEST-AP ipv6.method disabled +nmcli con modify TEST-AP wifi-sec.key-mgmt wpa-psk +nmcli con modify TEST-AP wifi-sec.psk "cloverwifi" +systemctl disable dnsmasq # disable dnsmasq to avoid conflicts with NetworkManager's dnsmasq NEW_HOSTNAME=$(echo ${NEW_SSID} | tr '[:upper:]' '[:lower:]') echo "--- Setting hostname to $NEW_HOSTNAME"