Skip to content

Commit

Permalink
package/{hostapd, wpa_s}: modify config options handling
Browse files Browse the repository at this point in the history
Makefiles hostapd.mk and wpa_supplicant.mk define different macros for
different defconfig options. Options that are not listed in defconfig,
can be set using CONFIG_SET. Options that are listed in defconfig, can
be enabled or disabled using CONFIG_ENABLE or CONFIG_DISABLE. Starting
from hostapd v2.10, option CONFIG_DPP is explicitly listed in defconfig.
So it would be time to switch to enable/disable macros for this option.

On the other hand, this approach looks fragile: we have to track
'promoted' defconfig options for each hostapd/wpa_s update. This patch
removes CONFIG_SET macros, keeping only CONFIG_ENABLED/CONFIG_DISABLED.
CONFIG_SET is replaced by the additional pass over enabled options. All
such options that are not listed in defconfig, will be appended to the
configuration file.

Fixes:
- http://autobuild.buildroot.net/results/3f8058ee6f3913fda795578f206db895731ba1e6/

Signed-off-by: Sergey Matyukevich <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
geomatsi authored and arnout committed Mar 7, 2022
1 parent 48e5cc0 commit 08f6960
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
20 changes: 13 additions & 7 deletions package/hostapd/hostapd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ HOSTAPD_LICENSE_FILES = README

HOSTAPD_CPE_ID_VENDOR = w1.fi
HOSTAPD_SELINUX_MODULES = hostapd
HOSTAPD_CONFIG_SET =

HOSTAPD_CONFIG_ENABLE = \
CONFIG_INTERNAL_LIBTOMMATH \
Expand Down Expand Up @@ -83,13 +82,14 @@ HOSTAPD_CONFIG_ENABLE += CONFIG_WPS
endif

ifeq ($(BR2_PACKAGE_HOSTAPD_WPA3),y)
HOSTAPD_CONFIG_SET += \
CONFIG_DPP \
CONFIG_SAE
HOSTAPD_CONFIG_ENABLE += \
CONFIG_DPP \
CONFIG_SAE \
CONFIG_OWE
else
HOSTAPD_CONFIG_DISABLE += \
CONFIG_DPP \
CONFIG_SAE \
CONFIG_OWE
endif

Expand All @@ -98,8 +98,9 @@ HOSTAPD_CONFIG_ENABLE += CONFIG_NO_VLAN
endif

ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_DYNAMIC),y)
HOSTAPD_CONFIG_ENABLE += CONFIG_FULL_DYNAMIC_VLAN
HOSTAPD_CONFIG_SET += NEED_LINUX_IOCTL
HOSTAPD_CONFIG_ENABLE += \
CONFIG_FULL_DYNAMIC_VLAN \
NEED_LINUX_IOCTL
endif

ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y)
Expand All @@ -123,9 +124,14 @@ define HOSTAPD_CONFIGURE_CMDS
cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \
$(patsubst %,-e 's/^\(%\)/#\1/',$(HOSTAPD_CONFIG_DISABLE)) \
$(patsubst %,-e '1i%=y',$(HOSTAPD_CONFIG_SET)) \
$(patsubst %,-e %,$(HOSTAPD_CONFIG_EDITS)) \
$(HOSTAPD_CONFIG)
# set requested configuration options not listed in hostapd defconfig
for s in $(HOSTAPD_CONFIG_ENABLE) ; do \
if ! grep -q "^$${s}" $(HOSTAPD_CONFIG); then \
echo "$${s}=y" >> $(HOSTAPD_CONFIG) ; \
fi \
done
endef

define HOSTAPD_BUILD_CMDS
Expand Down
9 changes: 7 additions & 2 deletions package/wpa_supplicant/wpa_supplicant.mk
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_READLINE
endif

ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO),y)
WPA_SUPPLICANT_CONFIG_SET += CONFIG_BUILD_WPA_CLIENT_SO
WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_BUILD_WPA_CLIENT_SO
define WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO
$(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/libwpa_client.so \
$(TARGET_DIR)/usr/lib/libwpa_client.so
Expand All @@ -183,9 +183,14 @@ define WPA_SUPPLICANT_CONFIGURE_CMDS
cp $(@D)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(WPA_SUPPLICANT_CONFIG_ENABLE)) \
$(patsubst %,-e 's/^\(%\)/#\1/',$(WPA_SUPPLICANT_CONFIG_DISABLE)) \
$(patsubst %,-e '1i%=y',$(WPA_SUPPLICANT_CONFIG_SET)) \
$(patsubst %,-e %,$(WPA_SUPPLICANT_CONFIG_EDITS)) \
$(WPA_SUPPLICANT_CONFIG)
# set requested configuration options not listed in wpa_s defconfig
for s in $(WPA_SUPPLICANT_CONFIG_ENABLE) ; do \
if ! grep -q "^$${s}" $(WPA_SUPPLICANT_CONFIG); then \
echo "$${s}=y" >> $(WPA_SUPPLICANT_CONFIG) ; \
fi \
done
endef

# LIBS for wpa_supplicant, LIBS_c for wpa_cli, LIBS_p for wpa_passphrase
Expand Down

0 comments on commit 08f6960

Please sign in to comment.