Skip to contentSkip to conversation

package/connman: bump to 1.38

PATCH New Petr Vorel 2 participants 2 messages Feb 27, 2020

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v2 1/1 package/connman: bump to 1.38

Add choice for either iptables or nftables as firewall types. Add option to enable/disable wireguard support. This release requires libmnl (if WireGuard enabled).

---
Changes v1->v2:
Implement notes from Thomas:
* Add choice for either iptables or nftables as firewall types.
* Add option to enable/disable wireguard support.
* Require libmnl only if WireGuard enabled.

 package/connman/Config.in    | 30 +++++++++++++++++++++++++++++-
 package/connman/connman.hash |  2 +-
 package/connman/connman.mk   | 14 ++++++++++----
 3 files changed, 40 insertions(+), 6 deletions(-)
package/connman/Config.in +29 -1
index 30eae23c96..5e4ac8bb7d 100644
@@ -8,7 +8,6 @@ config BR2_PACKAGE_CONNMAN
 	depends on !BR2_TOOLCHAIN_USES_MUSL # missing res_ninit()
 	select BR2_PACKAGE_DBUS
 	select BR2_PACKAGE_LIBGLIB2
-	select BR2_PACKAGE_IPTABLES
 	help
 	  The Connection Manager (ConnMan) project provides a daemon
 	  for managing internet connections within embedded devices
@@ -18,10 +17,39 @@ config BR2_PACKAGE_CONNMAN
 
 if BR2_PACKAGE_CONNMAN
 
+choice
+	prompt "Firewall type"
+	default BR2_PACKAGE_CONNMAN_IPTABLES
+	help
+	  Select which firewall type is used.
+
+config BR2_PACKAGE_CONNMAN_IPTABLES
+	bool "iptables"
+	select BR2_PACKAGE_IPTABLES
+	help
+	  Use iptables as firewall.
+
+config BR2_PACKAGE_CONNMAN_NFTABLES
+	bool "nftables"
+	select BR2_PACKAGE_NFTABLES
+	help
+	  Use nftables as firewall.
+endchoice
+
 config BR2_PACKAGE_CONNMAN_ETHERNET
 	bool "enable Ethernet support"
 	default y
 
+config BR2_PACKAGE_CONNMAN_WIREGUARD
+	bool "enable WireGuard support"
+	select BR2_PACKAGE_LIBMNL
+	select BR2_PACKAGE_WIREGUARD_LINUX_COMPAT
+	select BR2_PACKAGE_WIREGUARD_TOOLS
+	help
+	  Enable WiFi support (scan and static/dhcp interface
+	  setup). ConnMan detects the start of wpa_supplicant
+	  automatically.
+
 config BR2_PACKAGE_CONNMAN_WIFI
 	bool "enable WiFi support"
 	select BR2_PACKAGE_WPA_SUPPLICANT # runtime
package/connman/connman.hash +1 -1
index ff5b4d48f0..3039105027 100644
@@ -1,4 +1,4 @@
 # From https://www.kernel.org/pub/linux/network/connman/sha256sums.asc
-sha256 6ce29b3eb0bb16a7387bc609c39455fd13064bdcde5a4d185fab3a0c71946e16  connman-1.37.tar.xz
+sha256 cb30aca97c2f79ccaed8802aa2909ac5100a3969de74c0af8a9d73b85fc4932b  connman-1.38.tar.xz
 # Locally computed
 sha256 b499eddebda05a8859e32b820a64577d91f1de2b52efa2a1575a2cb4000bc259  COPYING
package/connman/connman.mk +10 -4
index 2cbf3fe752..505e77854a 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-CONNMAN_VERSION = 1.37
+CONNMAN_VERSION = 1.38
 CONNMAN_SOURCE = connman-$(CONNMAN_VERSION).tar.xz
 CONNMAN_SITE = $(BR2_KERNEL_MIRROR)/linux/network/connman
 CONNMAN_DEPENDENCIES = libglib2 dbus iptables
@@ -13,19 +13,25 @@ CONNMAN_LICENSE = GPL-2.0
 CONNMAN_LICENSE_FILES = COPYING
 CONNMAN_CONF_OPTS += \
 	--with-dbusconfdir=/etc \
+	$(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \
 	$(if $(BR2_PACKAGE_CONNMAN_DEBUG),--enable-debug,--disable-debug) \
 	$(if $(BR2_PACKAGE_CONNMAN_ETHERNET),--enable-ethernet,--disable-ethernet) \
-	$(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \
-	$(if $(BR2_PACKAGE_CONNMAN_WISPR),--enable-wispr,--disable-wispr) \
-	$(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \
+	$(if $(BR2_PACKAGE_CONNMAN_IPTABLES),--with-firewall=iptables) \
 	$(if $(BR2_PACKAGE_CONNMAN_LOOPBACK),--enable-loopback,--disable-loopback) \
 	$(if $(BR2_PACKAGE_CONNMAN_NEARD),--enable-neard,--disable-neard) \
+	$(if $(BR2_PACKAGE_CONNMAN_NFTABLES),--with-firewall=nftables) \
 	$(if $(BR2_PACKAGE_CONNMAN_OFONO),--enable-ofono,--disable-ofono) \
+	$(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \
+	$(if $(BR2_PACKAGE_CONNMAN_WIREGUARD),--enable-wireguard,--disable-wireguard) \
+	$(if $(BR2_PACKAGE_CONNMAN_WISPR),--enable-wispr,--disable-wispr) \
 	$(if $(BR2_INIT_SYSTEMD),--with-systemdunitdir=/usr/lib/systemd/system)
 
 CONNMAN_DEPENDENCIES += \
+	$(if $(BR2_PACKAGE_CONNMAN_IPTABLES),iptables) \
 	$(if $(BR2_PACKAGE_CONNMAN_NEARD),neard) \
+	$(if $(BR2_PACKAGE_CONNMAN_NFTABLES),nftables) \
 	$(if $(BR2_PACKAGE_CONNMAN_OFONO),ofono) \
+	$(if $(BR2_PACKAGE_CONNMAN_WIREGUARD),libmnl) \
 	$(if $(BR2_PACKAGE_CONNMAN_WISPR),gnutls)
 
 define CONNMAN_INSTALL_INIT_SYSV
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 package/connman: bump to 1.38

Hello Petr,

Thanks for this new version!

Quoted 5 lines · On Thu, 27 Feb 2020 21:15:53 +0100 Petr Vorel <[email protected]> wrote:

Add choice for either iptables or nftables as firewall types. Add option to enable/disable wireguard support. This release requires libmnl (if WireGuard enabled).

I think this really needs to be split into several commits: version bump, iptables/nftables selection, wireguard support. Each logical change should be in a separate commit.

Quoted 21 lines
package/connman/Config.in +5 -1
index 30eae23c96..5e4ac8bb7d 100644
@@ -8,7 +8,6 @@ config BR2_PACKAGE_CONNMAN
 	depends on !BR2_TOOLCHAIN_USES_MUSL # missing res_ninit()
 	select BR2_PACKAGE_DBUS
 	select BR2_PACKAGE_LIBGLIB2
-	select BR2_PACKAGE_IPTABLES
 	help
 	  The Connection Manager (ConnMan) project provides a daemon
 	  for managing internet connections within embedded devices
@@ -18,10 +17,39 @@ config BR2_PACKAGE_CONNMAN
 
 if BR2_PACKAGE_CONNMAN
 
+choice
+	prompt "Firewall type"
+	default BR2_PACKAGE_CONNMAN_IPTABLES
+	help
+	  Select which firewall type is used.

package/connman/Config.in config BR2_PACKAGE_CONNMAN · line 34

Quoted 10 lines
package/connman/Config.in +10 -0
+
+config BR2_PACKAGE_CONNMAN_IPTABLES
+	bool "iptables"
+	select BR2_PACKAGE_IPTABLES
+	help
+	  Use iptables as firewall.
+
+config BR2_PACKAGE_CONNMAN_NFTABLES
+	bool "nftables"
+	select BR2_PACKAGE_NFTABLES

This needs:

depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12

package/connman/Config.in config BR2_PACKAGE_CONNMAN · line 46

Quoted 12 lines
package/connman/Config.in +8 -0
+	help
+	  Use nftables as firewall.
+endchoice
+
 config BR2_PACKAGE_CONNMAN_ETHERNET
 	bool "enable Ethernet support"
 	default y
 
+config BR2_PACKAGE_CONNMAN_WIREGUARD
+	bool "enable WireGuard support"
+	select BR2_PACKAGE_LIBMNL
+	select BR2_PACKAGE_WIREGUARD_LINUX_COMPAT

I don't think you should select this. Indeed, this is only needed if you use an "older" kernel which doesn't have upstream support for Wireguard. With a very recent kernel (Linux 5.6+), wireguard-linux-compat should not be used.

package/connman/Config.in config BR2_PACKAGE_CONNMAN · line 51

Quoted 5 lines
package/connman/Config.in +5 -0
+	select BR2_PACKAGE_WIREGUARD_TOOLS
+	help
+	  Enable WiFi support (scan and static/dhcp interface
+	  setup). ConnMan detects the start of wpa_supplicant
+	  automatically.

This help text seems weird to document wireguard support :-)

Quoted 14 lines
package/connman/Config.in +2 -3
-CONNMAN_VERSION = 1.37
+CONNMAN_VERSION = 1.38
 CONNMAN_SOURCE = connman-$(CONNMAN_VERSION).tar.xz
 CONNMAN_SITE = $(BR2_KERNEL_MIRROR)/linux/network/connman
 CONNMAN_DEPENDENCIES = libglib2 dbus iptables
@@ -13,19 +13,25 @@ CONNMAN_LICENSE = GPL-2.0
 CONNMAN_LICENSE_FILES = COPYING
 CONNMAN_CONF_OPTS += \
 	--with-dbusconfdir=/etc \
+	$(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \
 	$(if $(BR2_PACKAGE_CONNMAN_DEBUG),--enable-debug,--disable-debug) \
 	$(if $(BR2_PACKAGE_CONNMAN_ETHERNET),--enable-ethernet,--disable-ethernet) \
-	$(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \
-	$(if $(BR2_PACKAGE_CONNMAN_WISPR),--enable-wispr,--disable-wispr) \

package/connman/Config.in CONNMAN_LICENSE = GPL-2.0 · line 27

Quoted 10 lines
package/connman/Config.in +5 -1
-	$(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \
+	$(if $(BR2_PACKAGE_CONNMAN_IPTABLES),--with-firewall=iptables) \
 	$(if $(BR2_PACKAGE_CONNMAN_LOOPBACK),--enable-loopback,--disable-loopback) \
 	$(if $(BR2_PACKAGE_CONNMAN_NEARD),--enable-neard,--disable-neard) \
+	$(if $(BR2_PACKAGE_CONNMAN_NFTABLES),--with-firewall=nftables) \
 	$(if $(BR2_PACKAGE_CONNMAN_OFONO),--enable-ofono,--disable-ofono) \
+	$(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \
+	$(if $(BR2_PACKAGE_CONNMAN_WIREGUARD),--enable-wireguard,--disable-wireguard) \
+	$(if $(BR2_PACKAGE_CONNMAN_WISPR),--enable-wispr,--disable-wispr) \
 	$(if $(BR2_INIT_SYSTEMD),--with-systemdunitdir=/usr/lib/systemd/system)

You're doing some spurious changes here, like doing alphabetic ordering. This is good, but do it in a separate patch.

Also I think this method of splitting CONF_OPTS and DEPENDENCIES is not great, and is not the typical way we use in Buildroot.

We normally prefer:

ifeq ($(feature),y)
pkg_CONF_OPTS += --enable-feature
pkg_DEPENDENCIES += some-other-pkg
else
pkg_CONF_OPTS += --disable-feature
endif

Perhaps we should convert connman.mk to that logic as a preparation patch.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com