diff mbox series

[v2] iptables: Use update alternatives for "ebtables"

Message ID 20260403062107.2913612-1-xiao.zhang@windriver.com
State Under Review
Headers show
Series [v2] iptables: Use update alternatives for "ebtables" | expand

Commit Message

Zhang, Xiao April 3, 2026, 6:21 a.m. UTC
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 <xiao.zhang@windriver.com>
---
 meta/recipes-extended/iptables/iptables_1.8.13.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-extended/iptables/iptables_1.8.13.bb b/meta/recipes-extended/iptables/iptables_1.8.13.bb
index 11b287ed3b..52173b338e 100644
--- a/meta/recipes-extended/iptables/iptables_1.8.13.bb
+++ b/meta/recipes-extended/iptables/iptables_1.8.13.bb
@@ -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"