Skip to contentSkip to conversation

allow wpa_supplicant to run on the dbus using the 'new' api

PATCH New Gary Coulbourne 3 participants 7 messages Dec 17, 2012 – Jan 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 allow wpa_supplicant to run on the dbus using the 'new' api

When wpa_supplicant is built, it compiles to use the old names on the dbus, as well as with the wrong executable name in the dbus activation service.

This patch builds on a patch submitted in Sept by Sven Neumann.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121217/e901d3a2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-allow-wpa_supplicant-to-run-on-the-dbus-using-the-ne.patch
Type: application/octet-stream
Size: 3047 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121217/e901d3a2/attachment.obj>

#1 lore raw

PATCH 1/1 allow wpa_supplicant to run on the dbus using the 'new' api

Quoted 5 lines · Gary Coulbourne

When wpa_supplicant is built, it compiles to use the old names on the dbus, as well as with the wrong executable name in the dbus activation service.

This patch builds on a patch submitted in Sept by Sven Neumann.

Hi Gary,

Reviewing patches is more convenient for us if you do the following:

* Send the patch in-line, preferably with git send-email, so we can give comments in-line.

* Keep the original patch comment if it is still appropriate.

* Make sure the patch is called PATCHv2 or similar by sending with 'git send-email --subject-prefix=PATCHv2'.

* Include a changelog in the patch. It should come below the Signed-off-by line(s), seperated by
---
and it should explain which changes were made and why.

* Keep the original author information - in this case, preferably by keeping the original git authorship.

I did a quick comparison with Sven's patch and I don't see why you
removed the BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD option.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH RESEND 1/2 wpa-supplicant: add options to enable the new DBus interface

From: Sven Neumann <[email protected]>

Allow to configure the DBus interfaces that the wpa_supplicant binary should support (old or new or both). Also allow to enable introspection support on the new DBus interface.

(build-test with all features enabled)

---
 package/wpa_supplicant/Config.in         |   19 ++++++++++++++
 package/wpa_supplicant/wpa_supplicant.mk |   42 ++++++++++++++++++++++++++----
 2 files changed, 56 insertions(+), 5 deletions(-)
package/wpa_supplicant/Config.in +19 -0
index d7cefe3..8b0b366 100644
@@ -30,6 +30,25 @@ config BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT
 	  (optionally, with WPS); this links in parts of hostapd functionality
 	  into wpa_supplicant.
 
+config BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD
+	bool "Enable support for old DBus control interface"
+	depends on BR2_PACKAGE_DBUS
+	help
+	  Enable support for old DBus control interface
+	  (fi.epitest.hostap.WPASupplicant).
+
+config BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW
+	bool "Enable support for new DBus control interface"
+	depends on BR2_PACKAGE_DBUS
+	help
+	  Enable support for new DBus control interface (fi.w1.wpa_supplicant1).
+
+config BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION
+	bool "Introspection support"
+	depends on BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW
+	help
+	  Add introspection support for new DBus control interface.
+
 config BR2_PACKAGE_WPA_SUPPLICANT_WPS
 	bool "Enable support for WPS"
 	help
package/wpa_supplicant/wpa_supplicant.mk +37 -5

62 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#3 lore raw

PATCH RESEND 2/2 wpa_supplicant: rework .config file editing

From: Sven Neumann <[email protected]>

Do all substitutions on the .config file in a single sed command. Make the .config file editing a lot more readable. Based on ideas brought up by Arnout Vandecappelle on the mailing-list.

(build-test with all features enabled)

---
 package/wpa_supplicant/wpa_supplicant.mk |  109 +++++++++++-------------------
 1 file changed, 41 insertions(+), 68 deletions(-)
package/wpa_supplicant/wpa_supplicant.mk +41 -68
index 3118913..c1ef11a 100644
@@ -15,68 +15,61 @@ WPA_SUPPLICANT_DBUS_NEW_SERVICE = fi.w1.wpa_supplicant1
 WPA_SUPPLICANT_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
 WPA_SUPPLICANT_LDFLAGS = $(TARGET_LDFLAGS)
 
+WPA_SUPPLICANT_CONFIG_EDITS =
+
+WPA_SUPPLICANT_CONFIG_SET =
+
+WPA_SUPPLICANT_CONFIG_ENABLE = \
+	CONFIG_IEEE80211N	\
+	CONFIG_IEEE80211R	\
+	CONFIG_INTERWORKING	\
+	CONFIG_DELAYED_MIC	\
+	CONFIG_INTERNAL_LIBTOMMATH
+
+WPA_SUPPLICANT_CONFIG_DISABLE = \
+	CONFIG_DRIVER_ATMEL	\
+	CONFIG_SMARTCARD
+
 ifeq ($(BR2_PACKAGE_LIBNL),y)
 	WPA_SUPPLICANT_DEPENDENCIES += libnl
-define WPA_SUPPLICANT_LIBNL_CONFIG
-	echo 'CONFIG_LIBNL32=y' >>$(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_SET += CONFIG_LIBNL32
 else
-define WPA_SUPPLICANT_LIBNL_CONFIG
-	$(SED) 's/^\(CONFIG_DRIVER_NL80211.*\)/#\1/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
-define WPA_SUPPLICANT_EAP_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_EAP_AKA.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_FAST.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_GPSK.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_IKEV2.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_PAX.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_PSK.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_SAKE.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_SIM.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_TNC.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_EAP_AKA		\
+					CONFIG_EAP_FAST		\
+					CONFIG_EAP_GPSK 	\
+					CONFIG_EAP_IKEV2	\
+					CONFIG_EAP_PAX		\
+					CONFIG_EAP_PSK		\
+					CONFIG_EAP_SAKE		\
+					CONFIG_EAP_SIM		\
+					CONFIG_EAP_TNC
 else
-define WPA_SUPPLICANT_EAP_CONFIG
-	$(SED) 's/^\(CONFIG_EAP.*\)/#\1/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT),y)
-define WPA_SUPPLICANT_AP_CONFIG
-	echo 'CONFIG_AP=y' >>$(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_SET += CONFIG_AP
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPS),y)
-define WPA_SUPPLICANT_WPS_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_WPS.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_WPS
 endif
 
-define WPA_SUPPLICANT_LIBTOMMATH_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_INTERNAL_LIBTOMMATH.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
-
 # Try to use openssl or gnutls if it's already available
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 	WPA_SUPPLICANT_DEPENDENCIES += openssl
-define WPA_SUPPLICANT_TLS_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_TLS=openssl\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_EAP_PWD.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=openssl\)/\1/'
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_EAP_PWD
 else
 ifeq ($(BR2_PACKAGE_GNUTLS),y)
 	WPA_SUPPLICANT_DEPENDENCIES += gnutls
-define WPA_SUPPLICANT_TLS_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_TLS=\).*/\2gnutls/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1gnutls/'
 else
-define WPA_SUPPLICANT_TLS_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_TLS=\).*/\2internal/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
 endif
 endif
 
@@ -87,9 +80,7 @@ ifeq ($(BR2_PACKAGE_DBUS),y)
 		PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD),y)
-define WPA_SUPPLICANT_DBUS_OLD_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_CTRL_IFACE_DBUS=\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS=
 define WPA_SUPPLICANT_INSTALL_DBUS_OLD
 	$(INSTALL) -D \
 	  $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE).service \
@@ -98,9 +89,7 @@ endef
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW),y)
-define WPA_SUPPLICANT_DBUS_NEW_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_CTRL_IFACE_DBUS_NEW=\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_NEW
 define WPA_SUPPLICANT_INSTALL_DBUS_NEW
 	$(INSTALL) -D \
 	  $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service \
@@ -109,34 +98,18 @@ endef
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION),y)
-define WPA_SUPPLICANT_DBUS_INTROSPECTION_CONFIG
-	$(SED) 's/\(#\)\(CONFIG_CTRL_IFACE_DBUS_INTRO=\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-endef
+	WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_INTRO
 endif
 
-define WPA_SUPPLICANT_DBUS_CONFIG
-	$(WPA_SUPPLICANT_DBUS_OLD_CONFIG)
-	$(WPA_SUPPLICANT_DBUS_NEW_CONFIG)
-	$(WPA_SUPPLICANT_DBUS_INTROSPECTION_CONFIG)
-endef
-
 endif
 
 define WPA_SUPPLICANT_CONFIGURE_CMDS
 	cp $(@D)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_IEEE80211N.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_IEEE80211R.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_INTERWORKING.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(#\)\(CONFIG_DELAYED_MIC.*\)/\2/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(CONFIG_DRIVER_ATMEL\)/#\1/' $(WPA_SUPPLICANT_CONFIG)
-	$(SED) 's/\(CONFIG_SMARTCARD\)/#\1/' $(WPA_SUPPLICANT_CONFIG)
-	$(WPA_SUPPLICANT_LIBTOMMATH_CONFIG)
-	$(WPA_SUPPLICANT_TLS_CONFIG)
-	$(WPA_SUPPLICANT_EAP_CONFIG)
-	$(WPA_SUPPLICANT_WPS_CONFIG)
-	$(WPA_SUPPLICANT_LIBNL_CONFIG)
-	$(WPA_SUPPLICANT_DBUS_CONFIG)
-	$(WPA_SUPPLICANT_AP_CONFIG)
+	sed -i $(patsubst %,-e 's/^\(%\)/#\1/',$(WPA_SUPPLICANT_CONFIG_DISABLE)) \
+	       $(patsubst %,-e 's/^#\(%\)/\1/',$(WPA_SUPPLICANT_CONFIG_ENABLE)) \
+	       $(patsubst %,-e '1i%=y',$(WPA_SUPPLICANT_CONFIG_SET)) \
+	       $(patsubst %,-e %,$(WPA_SUPPLICANT_CONFIG_EDITS)) \
+	       $(WPA_SUPPLICANT_CONFIG)
 endef
 
 define WPA_SUPPLICANT_BUILD_CMDS
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH RESEND 1/2 wpa-supplicant: add options to enable the new DBus interface

In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:

Arnout> From: Sven Neumann <[email protected]>
Arnout> Allow to configure the DBus interfaces that the wpa_supplicant Arnout> binary should support (old or new or both). Also allow to Arnout> enable introspection support on the new DBus interface.

Arnout> Signed-off-by: Sven Neumann <[email protected]> Arnout> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> Arnout> Acked-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> Arnout> Tested-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> Arnout> (build-test with all features enabled)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 allow wpa_supplicant to run on the dbus using the 'new' api

In reply to Arnout Vandecappelle
Quoted 4 lines · Arnout Vandecappelle

Reviewing patches is more convenient for us if you do the following:

* Send the patch in-line, preferably with git send-email, so we can give comments in-line.

Sorry. I'll keep that in mind next time. I'm a long time hacker, but
not a long-time contributor to open source. :)
Thanks for being gentle with the criticism; I am still feeling my way around what is proper etiquette.

Quoted 2 lines

* Keep the original author information - in this case, preferably by keeping the original git authorship.

I was only able to find a partial copy of it via a google search, so I didn't have the original. I didn't think about it at the time, but I should have gone and looked in the mailing list archives.

Quoted 2 lines

I did a quick comparison with Sven's patch and I don't see why you
removed the BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD option.

Purely ignorance on my part -- I didn't realize that it was a both/and rather than an either/or for that option.

The reason I needed the fix is because connman is expecting the new API, and so fails to find wireless devices without wpa_supplicant using it.

The dbus fix I sent seperately makes dbus properly handle activation, so that it can start the wpa_supplicant. The test in the autoconf fails and says the fixes need to be done manually. (I suspect it is because dbus is cross compiled, so the tests can't run on the host)

Peace,
Gary

#6 lore raw

PATCH 1/1 allow wpa_supplicant to run on the dbus using the 'new' api

Quoted 9 lines · Gary Coulbourne
Quoted 4 lines · Arnout Vandecappelle

Reviewing patches is more convenient for us if you do the following:

* Send the patch in-line, preferably with git send-email, so we can give comments in-line.

Sorry. I'll keep that in mind next time. I'm a long time hacker, but not a long-time contributor to open source. :)
Thanks for being gentle with the criticism; I am still feeling my way around what is proper etiquette.

The gentle criticism is of course aimed at attracting more
contributors... Did it work? :-)

Quoted 4 lines
Quoted 2 lines

* Keep the original author information - in this case, preferably by keeping the original git authorship.

I was only able to find a partial copy of it via a google search, so I didn't have the original.

To find buildroot patches, patchwork is a good reference:
http://patchwork.ozlabs.org/project/buildroot/list/

Quoted 9 lines

I didn't think about it at the time, but I should have gone and looked in the mailing list archives.

Quoted 2 lines

I did a quick comparison with Sven's patch and I don't see why you removed the BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD option.

Purely ignorance on my part -- I didn't realize that it was a both/and rather than an either/or for that option.

The reason I needed the fix is because connman is expecting the new API, and so fails to find wireless devices without wpa_supplicant using it.

I resent the original patches (I forgot to put you in CC, sorry). Can
you check if they work as is, and correct them if needed?

Quoted 4 lines

The dbus fix I sent seperately makes dbus properly handle activation, so that it can start the wpa_supplicant. The test in the autoconf fails and says the fixes need to be done manually. (I suspect it is because dbus is cross compiled, so the tests can't run on the host)

I'll have a look at it next and give some more gentle criticism :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F