iptables: Use update alternatives for "ebtables"
PATCH v2 1/1 iptables: Use update alternatives for "ebtables"
The ebtables utility can be provided by both ebtables and iptables packages. Set higher priority for the version provided by iptables to prefer it.
Signed-off-by Zhang Xiao <[email protected]>
--- meta/recipes-extended/iptables/iptables_1.8.13.bb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-extended/iptables/iptables_1.8.13.bb +6 -1
@@ -21,7 +21,7 @@ SYSTEMD_SERVICE:${PN} = "\ ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'ip6tables.service', '', d)} \ " -inherit autotools pkgconfig systemd +inherit autotools pkgconfig systemd update-alternatives EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
@@ -122,3 +122,8 @@ ALLOW_EMPTY:${PN}-modules = "1" INSANE_SKIP:${PN}-module-xt-conntrack = "dev-so" INSANE_SKIP:${PN}-module-xt-ct = "dev-so" INSANE_SKIP:${PN}-module-xt-nat = "dev-so" + +ALTERNATIVE:${PN} = "" +ALTERNATIVE:${PN}:append = "${@bb.utils.contains('PACKAGECONFIG', 'libnftnl', ' ebtables', '', d)}" +ALTERNATIVE_LINK_NAME[ebtables] = "${sbindir}/ebtables" +ALTERNATIVE_PRIORITY[ebtables] = "100"
Signature · 1 line
2.53.0
Review
Quoted 2 lines · ZhangXiao via lists.openembedded.org
(quoted diff) +2
-0+ALTERNATIVE:${PN} = "" +ALTERNATIVE:${PN}:append = "${@bb.utils.contains('PACKAGECONFIG', 'libnftnl', ' ebtables', '', d)}”
Assigning the empty string and then run-time appending is wasteful, just do this in one line:
ALTERNATIVE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'libnftnl', ' ebtables', '', d)}”
Ross