[Buildroot] [PATCH 1/3] package/wpa_supplicant: Fix options to actually disable features.

Subsystems: the rest

6 messages, 2 authors, 2021-02-13 · open the first message on its own page

[Buildroot] [PATCH 1/3] package/wpa_supplicant: Fix options to actually disable features.

From: Nicolas Cavallari <hidden>
Date: 2021-02-10 18:50:15

Since wpa_supplicant 2.8, most features are now enabled by default,
instead of being disabled by default.  Update wpa_supplicant.mk
accordingly.

This also make the existing options disable more features, otherwise,
it would still include dead code or even fail to compile.

Signed-off-by: Nicolas Cavallari <redacted>
---
 package/wpa_supplicant/Config.in         |  4 ++--
 package/wpa_supplicant/wpa_supplicant.mk | 28 ++++++++++--------------
 2 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
index cba7fa07e1..8057c0b7be 100644
--- a/package/wpa_supplicant/Config.in
+++ b/package/wpa_supplicant/Config.in
@@ -38,7 +38,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT
 	  set.  This links in parts of hostapd functionality into
 	  wpa_supplicant, making it bigger but dispensing the need for
 	  a separate hostapd binary in some applications hence being
-	  smaller overall.
+	  smaller overall.  It also enables support for Wi-Fi Direct.
 
 config BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY
 	bool "Enable Wi-Fi Display"
@@ -63,7 +63,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN
 config BR2_PACKAGE_WPA_SUPPLICANT_EAP
 	bool "Enable EAP"
 	help
-	  Enable support for EAP.
+	  Enable support for EAP, 802.1x/WPA-Enterprise and FILS.
 
 config BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT
 	bool "Enable HS20"
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index 940a821746..cc259eb9c6 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -27,15 +27,8 @@ WPA_SUPPLICANT_INSTALL_STAGING = YES
 
 WPA_SUPPLICANT_CONFIG_EDITS =
 
-# Add support for simple background scan
-WPA_SUPPLICANT_CONFIG_SET = CONFIG_BGSCAN_SIMPLE
-
 WPA_SUPPLICANT_CONFIG_ENABLE = \
-	CONFIG_IEEE80211AC \
-	CONFIG_IEEE80211N \
-	CONFIG_IEEE80211R \
 	CONFIG_INTERNAL_LIBTOMMATH \
-	CONFIG_DEBUG_FILE \
 	CONFIG_MATCH_IFACE
 
 WPA_SUPPLICANT_CONFIG_DISABLE = \
@@ -62,11 +55,13 @@ ifeq ($(BR2_STATIC_LIBS),y)
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_TNC
 endif
 else
-WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP \
+	CONFIG_IEEE8021X_EAPOL \
+	CONFIG_FILS
 endif
 
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
-WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_HS20 \
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_HS20 \
 	CONFIG_INTERWORKING
 endif
 
@@ -86,9 +81,8 @@ else
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_WIFI_DISPLAY
 endif
 
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING),y)
-WPA_SUPPLICANT_CONFIG_SET += CONFIG_MESH
-WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_IEEE80211W
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_MESH
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN),y)
@@ -97,8 +91,8 @@ WPA_SUPPLICANT_CONFIG_ENABLE += \
 	CONFIG_AUTOSCAN_PERIODIC
 endif
 
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPS),y)
-WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_WPS
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPS),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_WPS
 endif
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPA3),y)
@@ -143,8 +137,8 @@ else
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_CTRL_IFACE_DBUS_NEW
 endif
 
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG),y)
-WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_DEBUG_SYSLOG
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DEBUG_SYSLOG
 endif
 
 ifeq ($(BR2_PACKAGE_READLINE),y)
-- 
2.30.0

[Buildroot] [PATCH 2/3] package/wpa_supplicant: Add options to disable more features.

From: Nicolas Cavallari <hidden>
Date: 2021-02-10 18:50:16

Together, they increase the size of the binary by a bit less than a
megabyte.

As a result, make the wpa_supplicant option a menuconfig.

Signed-off-by: Nicolas Cavallari <redacted>
---
 package/wpa_supplicant/Config.in         | 35 +++++++++++++++++++++++-
 package/wpa_supplicant/wpa_supplicant.mk | 18 ++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
index 8057c0b7be..9553dcf7df 100644
--- a/package/wpa_supplicant/Config.in
+++ b/package/wpa_supplicant/Config.in
@@ -1,4 +1,4 @@
-config BR2_PACKAGE_WPA_SUPPLICANT
+menuconfig BR2_PACKAGE_WPA_SUPPLICANT
 	bool "wpa_supplicant"
 	depends on BR2_USE_MMU # fork()
 	help
@@ -29,6 +29,33 @@ config BR2_PACKAGE_WPA_SUPPLICANT_NL80211
 comment "nl80211 support needs a toolchain w/ threads"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
+config BR2_PACKAGE_WPA_SUPPLICANT_WEXT
+	bool "Enable wext (deprecated)"
+	default y if !BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Enable support for wext.  This is the historic wireless API
+	  for Linux, which is now deprecated and in maintenance-only in
+	  the kernel.  It may still be required by out-of-tree drivers.
+
+config BR2_PACKAGE_WPA_SUPPLICANT_WIRED
+	bool "Enable wired support"
+	select BR2_PACKAGE_WPA_SUPPLICANT_EAP
+	help
+	  Include the "wired" driver, so the internal IEEE 802.1x
+	  supplicant can be used with Ethernet.  This also enables
+	  support for MACSEC.
+
+comment "wpa_supplicant will be useless without at least one driver"
+	depends on !BR2_PACKAGE_WPA_SUPPLICANT_NL80211 && \
+		!BR2_PACKAGE_WPA_SUPPLICANT_WEXT && \
+		!BR2_PACKAGE_WPA_SUPPLICANT_WIRED
+
+config BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN
+	bool "Enable IBSS RSN"
+	depends on BR2_PACKAGE_WPA_SUPPLICANT_NL80211
+	help
+	  Enable support for RSN/WPA2 in Ad-Hoc mode.
+
 config BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT
 	bool "Enable AP mode"
 	depends on BR2_PACKAGE_WPA_SUPPLICANT_NL80211
@@ -90,6 +117,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_WPA3
 
 config BR2_PACKAGE_WPA_SUPPLICANT_CLI
 	bool "Install wpa_cli binary"
+	select BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE
 	help
 	  Install wpa_cli command line utility
 
@@ -107,6 +135,11 @@ config BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE
 	help
 	  Install wpa_passphrase command line utility.
 
+config BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE
+	bool "Enable the Unix-socket control interface"
+	help
+	  Enable support for the Unix-socket-based API.
+
 config BR2_PACKAGE_WPA_SUPPLICANT_DBUS
 	bool "Enable support for the DBus control interface"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index cc259eb9c6..6ed135571e 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -47,6 +47,14 @@ else
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
 endif
 
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_WEXT),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_WEXT
+endif
+
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN), y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_IBSS_RSN
+endif
+
 # Trailing underscore on purpose to not enable CONFIG_EAPOL_TEST
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_EAP_
@@ -60,6 +68,12 @@ WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP \
 	CONFIG_FILS
 endif
 
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_WIRED),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_WIRED \
+	CONFIG_MACSEC \
+	CONFIG_DRIVER_MACSEC
+endif
+
 ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_HS20 \
 	CONFIG_INTERWORKING
@@ -117,6 +131,10 @@ WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_PWD CONFIG_EAP_TEAP
 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
 endif
 
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_CTRL_IFACE
+endif
+
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS),y)
 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf dbus
 WPA_SUPPLICANT_MAKE_ENV = \
-- 
2.30.0

[Buildroot] [PATCH 3/3] package/wpa_supplicant: Simplify D-Bus support.

From: Nicolas Cavallari <hidden>
Date: 2021-02-10 18:50:17

wpa_supplicant 2.8 dropped support for the old D-Bus interface, so
remove mentions of it and rename DBUS_NEW variables to just DBUS.

Signed-off-by: Nicolas Cavallari <redacted>
---
 package/wpa_supplicant/Config.in         | 2 +-
 package/wpa_supplicant/wpa_supplicant.mk | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
index 9553dcf7df..3c986ff4ba 100644
--- a/package/wpa_supplicant/Config.in
+++ b/package/wpa_supplicant/Config.in
@@ -154,6 +154,6 @@ config BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION
 	bool "Introspection support"
 	depends on BR2_PACKAGE_WPA_SUPPLICANT_DBUS
 	help
-	  Add introspection support for new DBus control interface.
+	  Add introspection support for the DBus control interface.
 
 endif
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index 6ed135571e..28e71a6c43 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -13,8 +13,7 @@ WPA_SUPPLICANT_LICENSE_FILES = README
 WPA_SUPPLICANT_CPE_ID_VENDOR = w1.fi
 WPA_SUPPLICANT_CONFIG = $(WPA_SUPPLICANT_DIR)/wpa_supplicant/.config
 WPA_SUPPLICANT_SUBDIR = wpa_supplicant
-WPA_SUPPLICANT_DBUS_OLD_SERVICE = fi.epitest.hostap.WPASupplicant
-WPA_SUPPLICANT_DBUS_NEW_SERVICE = fi.w1.wpa_supplicant1
+WPA_SUPPLICANT_DBUS_SERVICE = fi.w1.wpa_supplicant1
 WPA_SUPPLICANT_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
 WPA_SUPPLICANT_LDFLAGS = $(TARGET_LDFLAGS)
 WPA_SUPPLICANT_SELINUX_MODULES = networkmanager
@@ -143,8 +142,8 @@ WPA_SUPPLICANT_MAKE_ENV = \
 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_NEW
 define WPA_SUPPLICANT_INSTALL_DBUS_NEW
 	$(INSTALL) -m 0644 -D \
-		$(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service \
-		$(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service
+		$(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_SERVICE).service \
+		$(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_SERVICE).service
 endef
 
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION),y)
@@ -217,7 +216,6 @@ define WPA_SUPPLICANT_INSTALL_DBUS
 	$(INSTALL) -m 0644 -D \
 		$(@D)/wpa_supplicant/dbus/dbus-wpa_supplicant.conf \
 		$(TARGET_DIR)/etc/dbus-1/system.d/wpa_supplicant.conf
-	$(WPA_SUPPLICANT_INSTALL_DBUS_OLD)
 	$(WPA_SUPPLICANT_INSTALL_DBUS_NEW)
 endef
 endif
-- 
2.30.0

[Buildroot] [PATCH 2/3] package/wpa_supplicant: Add options to disable more features.

From: Arnout Vandecappelle <hidden>
Date: 2021-02-13 12:21:28


On 10/02/2021 19:50, Nicolas Cavallari wrote:
[snip]
+config BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE
+	bool "Enable the Unix-socket control interface"
+	help
+	  Enable support for the Unix-socket-based API.
+
 I'm surprised that the control interface makes that much of a difference...
AFAIK it's just a single file, no?

[snip]
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_WIRED),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_WIRED \
 This should be written as:

WPA_SUPPLICANT_CONFIG_DISABLE += \
	CONFIG_DRIVER_WIRED \

 The file contains both styles, but I think we prefer the one-option-per-line
style for new code.

 Regards,
 Arnout

quoted hunk
+	CONFIG_MACSEC \
+	CONFIG_DRIVER_MACSEC
+endif
+
 ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_HS20 \
 	CONFIG_INTERWORKING
@@ -117,6 +131,10 @@ WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_PWD CONFIG_EAP_TEAP
 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
 endif
 
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_CTRL_IFACE
+endif
+
 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS),y)
 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf dbus
 WPA_SUPPLICANT_MAKE_ENV = \

[Buildroot] [PATCH 2/3] package/wpa_supplicant: Add options to disable more features.

From: Nicolas Cavallari <hidden>
Date: 2021-02-13 12:42:26

On 13/02/2021 13:21, Arnout Vandecappelle wrote:

On 10/02/2021 19:50, Nicolas Cavallari wrote:
[snip]
quoted
+config BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE
+	bool "Enable the Unix-socket control interface"
+	help
+	  Enable support for the Unix-socket-based API.
+
  I'm surprised that the control interface makes that much of a difference...
AFAIK it's just a single file, no?
Yes, a single 11 KLOC file :)
And some ap commands are factored between wpasupplicant and hostapd, so 
you can add another KLOC if AP support is enabled. The increase is 
mostly multiplicative with the other options...
[snip]
quoted
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_WIRED),y)
+WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_WIRED \
  This should be written as:

WPA_SUPPLICANT_CONFIG_DISABLE += \
	CONFIG_DRIVER_WIRED \

  The file contains both styles, but I think we prefer the one-option-per-line
style for new code.
Will send a new patch monday anyway, because 1/3 exposes build failures 
due to missing options dependencies

[Buildroot] [PATCH 1/3] package/wpa_supplicant: Fix options to actually disable features.

From: Arnout Vandecappelle <hidden>
Date: 2021-02-13 12:46:14


On 10/02/2021 19:50, Nicolas Cavallari wrote:
[snip]
 
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
-WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_HS20 \
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
 Actually, we prefer to "ifeq" way of writing this condition:

ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),)


 I've fixed all occurrences of that, I've also rewrapped the multiline
assignments, and I've extended the commit message of the first patch a little.
With all that, applied to next, thanks!

 Regards,
 Arnout

[snip]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help