MycroftOS: Fix wifi startup with broadcom driver.

wpa_supplicant doesn't play nice if runned twice. One with
the physical device, secondly with the virtual device.

Therefor we only start wpa_supplicant of ap0 only when there
is no wlan wpa config file present.
This commit is contained in:
Peter Steenbergen 2020-01-18 18:18:19 +01:00
parent f62228173c
commit 88aa2a2653
2 changed files with 24 additions and 2 deletions

View File

@ -15,13 +15,17 @@ define WIFI_AP_INSTALL_TARGET_CMDS
$(INSTALL) -m 644 -D $(@D)/wpa_supplicant-ap0.conf \
$(TARGET_DIR)/etc/wpa_supplicant/wpa_supplicant-ap0.conf
$(INSTALL) -D -m 644 $(@D)/wpa_supplicant-ap0.service \
$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-ap0.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/sys-subsystem-net-devices-ap0.device.wants
ln -fs ../../../../usr/lib/systemd/system/wpa_supplicant@.service \
$(TARGET_DIR)/etc/systemd/system/sys-subsystem-net-devices-ap0.device.wants/wpa_supplicant@ap0.service
ln -fs ../../../../usr/lib/systemd/system/wpa_supplicant-ap0.service \
$(TARGET_DIR)/etc/systemd/system/sys-subsystem-net-devices-ap0.device.wants/wpa_supplicant-ap0.service
$(INSTALL) -D -m 644 $(@D)/wifi-setup.service \
$(TARGET_DIR)/usr/lib/systemd/system/wifi-setup.service
ln -fs ../../../../usr/lib/systemd/system/wifi-setup.service \
$(TARGET_DIR)/etc/systemd/system/sys-subsystem-net-devices-ap0.device.wants/wifi-setup.service
$(INSTALL) -D -m 644 $(@D)/dnsmasq.service \
$(TARGET_DIR)/usr/lib/systemd/system/dnsmasq.service
ln -fs ../../../../usr/lib/systemd/system/dnsmasq.service \

View File

@ -0,0 +1,18 @@
[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-ap0.device
After=sys-subsystem-net-devices-ap0.device
Before=network.target
Wants=network.target
# check existence of configuration file
ConditionPathExists=!/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# NetworkManager users will probably want the dbus version instead.
[Service]
Type=simple
ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-ap0.conf -
[Install]
WantedBy=sys-subsystem-net-devices-ap0.device