[Buildroot] [PATCH v2 1/1] package/connman: bump to 1.38

Subsystems: the rest

2 messages, 2 authors, 2020-02-27 · open the first message on its own page

[Buildroot] [PATCH v2 1/1] package/connman: bump to 1.38

From: Petr Vorel <hidden>
Date: 2020-02-27 20:15:53

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

Signed-off-by: Petr Vorel <redacted>
---
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(-)
diff --git a/package/connman/Config.in b/package/connman/Config.in
index 30eae23c96..5e4ac8bb7d 100644
--- a/package/connman/Config.in
+++ b/package/connman/Config.in
@@ -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
diff --git a/package/connman/connman.hash b/package/connman/connman.hash
index ff5b4d48f0..3039105027 100644
--- a/package/connman/connman.hash
+++ b/package/connman/connman.hash
@@ -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
diff --git a/package/connman/connman.mk b/package/connman/connman.mk
index 2cbf3fe752..505e77854a 100644
--- a/package/connman/connman.mk
+++ b/package/connman/connman.mk
@@ -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
-- 
2.25.1

[Buildroot] [PATCH v2 1/1] package/connman: bump to 1.38

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: 2020-02-27 22:08:46

Hello Petr,

Thanks for this new version!

On Thu, 27 Feb 2020 21:15:53 +0100
Petr Vorel [off-list ref] 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).

Signed-off-by: Petr Vorel <redacted>
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 hunk
diff --git a/package/connman/Config.in b/package/connman/Config.in
index 30eae23c96..5e4ac8bb7d 100644
--- a/package/connman/Config.in
+++ b/package/connman/Config.in
@@ -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
This needs:

        depends on BR2_USE_WCHAR
        depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+	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.
+	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 hunk
-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)
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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help