Skip to contentSkip to conversation

connman: fix nftables dependency

PATCH In review André Draszik 3 participants 7 messages Jun 19, 2017 – Jun 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 connman: fix nftables dependency

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Update the PACKAGECONFIG to reflect this.

---
 meta/recipes-connectivity/connman/connman.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman.inc +1 -1
index ab18f2fe01..132a58ff40 100644
@@ -51,7 +51,7 @@ PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t
 PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
 # WISPr support for logging into hotspots, requires TLS
 PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
-PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,nftables,nftables"
+PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
 PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
 
 INITSCRIPT_NAME = "connman"
Signature · 1 line
2.11.0
#1 lore raw

Hi André,

Quoted 11 lines · On Mon, 19 Jun 2017 11:32:38 +0100 André Draszik <[email protected]> wrote:

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Update the PACKAGECONFIG to reflect this.

packageconfig creates runtime dependencies for the modules you added. This will cause problems if the modules are built into the kernel binary. You should add runtime recommendations instead.

Regards,
Andreas

Quoted 19 lines
---
 meta/recipes-connectivity/connman/connman.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman.inc +1 -1
index ab18f2fe01..132a58ff40 100644
@@ -51,7 +51,7 @@ PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t
 PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
 # WISPr support for logging into hotspots, requires TLS
 PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
-PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,nftables,nftables"
+PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
 PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
 
 INITSCRIPT_NAME = "connman"
#2 lore raw
Quoted 14 lines · Andreas Oberritter

Hi André,

Quoted 9 lines · On Mon, 19 Jun 2017 11:32:38 +0100 André Draszik <[email protected]> wrote:

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Quoted 6 lines
Quoted 2 lines

Update the PACKAGECONFIG to reflect this.

packageconfig creates runtime dependencies for the modules you added. This will cause problems if the modules are built into the kernel binary. You should add runtime recommendations instead.

But they should all be fulfilled because of PACKAGES_DYNAMIC in kernel.bbclass, no?

Cheers,
Andre'

#3 lore raw
Quoted 18 lines · On Mon, 19 Jun 2017 13:06:41 +0100 André Draszik <[email protected]> wrote:
Quoted 17 lines · Andreas Oberritter

Hi André,

Quoted 11 lines · On Mon, 19 Jun 2017 11:32:38 +0100 André Draszik <[email protected]> wrote:

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Update the PACKAGECONFIG to reflect this.

Quoted 6 lines
Quoted 3 lines

packageconfig creates runtime dependencies for the modules you added. This will cause problems if the modules are built into the kernel binary. You should add runtime recommendations instead.

But they should all be fulfilled because of PACKAGES_DYNAMIC in kernel.bbclass, no?

This will let the build succeed, but the package manager still aborts when trying to install connman if some runtime dependencies don't exist on the package feed. Runtime recommendations get ignored if missing, but get installed by default otherwise.

Regards,
Andreas

Quoted 4 lines

Cheers,
Andre'

#4 lore raw
In reply to André Draszik

Hi,

Quoted 22 lines · André Draszik

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Update the PACKAGECONFIG to reflect this.

---
 meta/recipes-connectivity/connman/connman.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman.inc +0 -0
index ab18f2fe01..132a58ff40 100644

meta/recipes-connectivity/connman/connman.inc PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t · line 55

Quoted 6 lines
meta/recipes-connectivity/connman/connman.inc +1 -1
@@ -51,7 +51,7 @@ PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t
 PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
 # WISPr support for logging into hotspots, requires TLS
 PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
-PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,nftables,nftables"
+PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
 PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"

Thanks for fixing this. However, this patch introduces some warnings:

WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nf-tables-ipv4, but it isn't a build dependency? [build-deps]
WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nft-chain-nat-ipv4, but it isn't a build dependency? [build-deps]
WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nft-chain-route-ipv4, but it isn't a build dependency? [build-deps]
WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nft-masq-ipv4, but it isn't a build dependency? [build-deps]
WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nft-meta, but it isn't a build dependency? [build-deps]
WARNING: connman-1.34-r0 do_package_qa: QA Issue: connman rdepends on kernel-module-nft-nat, but it isn't a build dependency? [build-deps]
NOTE: Tasks Summary: Attempted 2032 tasks of which 2000 didn't need to be rerun and all succeeded.

Please consider fixing this as well.

Best Regards,
Maxin

#5 lore raw

RFC PATCH v2 1/2 base.bbclass: extend PACKAGECONFIG to also allow RRECOMMENDS

In reply to André Draszik

From: André Draszik <[email protected]>

It can be useful to add RRECOMMENDS to packages created, based on certain PACKAGECONFIGs.

In particular where a package depends on certain linux kernel infrastructure (kernel modules) which might or might not be built as a module, being able to RRECOMMENDS instead of RDEPENDS on the relevant packages avoids build failures in case those modules are built statically into the kernel, i.e. in case no package is being created for them.

Add another field to the PACKAGECONFIG syntax to achieve just that.

---
 meta/classes/base.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
meta/classes/base.bbclass +7 -3
index 78926656d7..3762c8addc 100644
@@ -384,7 +384,7 @@ python () {
     # These take the form:
     #
     # PACKAGECONFIG ??= "<default options>"
-    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
+    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends"
     pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
     if pkgconfigflags:
         pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
@@ -426,12 +426,13 @@ python () {
 
         extradeps = []
         extrardeps = []
+        extrarrecs = []
         extraconf = []
         for flag, flagval in sorted(pkgconfigflags.items()):
             items = flagval.split(",")
             num = len(items)
-            if num > 4:
-                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend can be specified!"
+            if num > 5:
+                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend can be specified!"
                     % (d.getVar('PN'), flag))
 
             if flag in pkgconfig:
@@ -439,12 +440,15 @@ python () {
                     extradeps.append(items[2])
                 if num >= 4 and items[3]:
                     extrardeps.append(items[3])
+                if num >= 5 and items[4]:
+                    extrarrecs.append(items[4])
                 if num >= 1 and items[0]:
                     extraconf.append(items[0])
             elif num >= 2 and items[1]:
                     extraconf.append(items[1])
         appendVar('DEPENDS', extradeps)
         appendVar('RDEPENDS_${PN}', extrardeps)
+        appendVar('RRECOMMENDS_${PN}', extrarrecs)
         appendVar('PACKAGECONFIG_CONFARGS', extraconf)
 
     pn = d.getVar('PN')
Signature · 1 line
2.11.0
#6 lore raw

PATCH v2 2/2 connman: fix nftables dependency

From: André Draszik <[email protected]>

When building with nftables support, connman doesn't ever depend on the nftables command line tool.

connman will depend on libmnl and libnftnl at build and run time. In addition, the nftables rules it creates depend on various kernel modules being present.

Update the PACKAGECONFIG to reflect this. We use the just introduced RRECOMMENDS field so as to make the build still succeed if those kernel modules have been linked statically into the kernel, i.e. when the packages haven't actually been created.

---
 meta/recipes-connectivity/connman/connman.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman.inc +1 -1
index ab18f2fe01..141a464121 100644
@@ -51,7 +51,7 @@ PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t
 PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
 # WISPr support for logging into hotspots, requires TLS
 PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
-PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,nftables,nftables"
+PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
 PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
 
 INITSCRIPT_NAME = "connman"
Signature · 1 line
2.11.0