meta-somdevices: Created hostapd_2.8.bbappend with somdevices configuration.
authorAlejandro Benete <abenete@somdevices.com>
Tue, 30 Mar 2021 08:37:54 +0000 (10:37 +0200)
committerAlejandro Benete <abenete@somdevices.com>
Tue, 30 Mar 2021 08:37:54 +0000 (10:37 +0200)
Signed-off-by: Alejandro Benete <abenete@somdevices.com>
recipes-connectivity/hostapd/hostapd_2.8.bbappend [new file with mode: 0644]

diff --git a/recipes-connectivity/hostapd/hostapd_2.8.bbappend b/recipes-connectivity/hostapd/hostapd_2.8.bbappend
new file mode 100644 (file)
index 0000000..45e9b7e
--- /dev/null
@@ -0,0 +1,23 @@
+SUMMARY = "Change hostapd.conf file"
+DESCRIPTION = "Enable 80211n-mode and WPA2-PSK security and change SSID to hostname and password to hostname1234"
+
+LICENSE = "MIT"
+
+SYSTEMD_SERVICE_${PN} = " hostapd.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
+do_install_append () {
+       echo "#content hostapd.conf" > ${D}/etc/hostapd.conf
+       echo "interface=wlan0" >> ${D}/etc/hostapd.conf
+       echo "ssid=${MACHINE}" >> ${D}/etc/hostapd.conf
+       echo "channel=6" >> ${D}/etc/hostapd.conf
+       echo "auth_algs=1" >> ${D}/etc/hostapd.conf
+       echo "wpa=2                 # WPA2 only" >> ${D}/etc/hostapd.conf
+       echo "wpa_key_mgmt=WPA-PSK" >> ${D}/etc/hostapd.conf
+       echo "rsn_pairwise=CCMP" >> ${D}/etc/hostapd.conf
+       echo "wpa_passphrase=${MACHINE}1234" >> ${D}/etc/hostapd.conf
+       echo "" >> ${D}/etc/hostapd.conf
+       echo "hw_mode=g" >> ${D}/etc/hostapd.conf
+       echo "ieee80211n=1" >> ${D}/etc/hostapd.conf
+       echo "wmm_enabled=1" >> ${D}/etc/hostapd.conf
+}