[Buildroot] [PATCH] package/wpa_supplicant: Fix systemd service stop

Marcin Niestroj m.niestroj at grinn-global.com
Fri Apr 8 13:53:15 UTC 2016


Fix systemd service stop when using only new DBus bus name.

By default systemd service description comes with old DBus bus name for
wpa_supplicant. If only new bus name is used, then systemd stops
wpa_supplicant.service, because it has not started old bus name with
specified time. In order to suppress stopping wpa_supplicant.service in
such case, we just rename BusName property to the new one, so systemd
sees that the service has started properly.
---
 package/wpa_supplicant/wpa_supplicant.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index ba1180d..7d4ab42 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -193,6 +193,19 @@ define WPA_SUPPLICANT_INSTALL_TARGET_CMDS
 	$(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO)
 endef
 
+# By default systemd service description comes with old DBus bus name for
+# wpa_supplicant. If only new bus name is used, then systemd stops
+# wpa_supplicant.service, because it has not started old bus name with
+# specified time.
+# To suppress stopping wpa_supplicant.service in such case, just rename
+# BusName property to the new one.
+ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD),)
+define WPA_SUPPLICANT_UPDATE_DBUS_NAME
+	sed -i -e 's/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE)/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE)/g' \
+		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant.service
+endef
+endif
+
 define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant.service
@@ -202,6 +215,7 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-nl80211 at .service
 	$(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-wired at .service \
 		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired at .service
+	$(WPA_SUPPLICANT_UPDATE_DBUS_NAME)
 endef
 
 $(eval $(generic-package))
-- 
2.8.0



More information about the buildroot mailing list