diff mbox series

[meta-networking] nftables: add systemd PACKAGECONFIG

Message ID 20260506172256.1259293-1-piotr.wejman@arm.com
State Accepted
Headers show
Series [meta-networking] nftables: add systemd PACKAGECONFIG | expand

Commit Message

Piotr Wejman May 6, 2026, 5:22 p.m. UTC
Add a systemd PACKAGECONFIG option to install nftables systemd unit files.
When "systemd" is present in DISTRO_FEATURES, the option is enabled and
the service is installed but disabled by default.

Signed-off-by: Piotr Wejman <piotr.wejman@arm.com>
---
 meta-networking/recipes-filter/nftables/nftables_1.1.6.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Khem Raj May 13, 2026, 4:21 a.m. UTC | #1
seeing this error
https://errors.yoctoproject.org/Errors/Details/938664/

Seems to be related to this patch

On Wed, May 6, 2026 at 10:24 AM Piotr Wejman <piotr.wejman@arm.com> wrote:

> Add a systemd PACKAGECONFIG option to install nftables systemd unit files.
> When "systemd" is present in DISTRO_FEATURES, the option is enabled and
> the service is installed but disabled by default.
>
> Signed-off-by: Piotr Wejman <piotr.wejman@arm.com>
> ---
>  meta-networking/recipes-filter/nftables/nftables_1.1.6.bb | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
> b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
> index d27e60a18d..dbe0e8f9f5 100644
> --- a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
> +++ b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
> @@ -16,9 +16,9 @@ SRC_URI = "
> http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz \
>            "
>  SRC_URI[sha256sum] =
> "372931bda8556b310636a2f9020adc710f9bab66f47efe0ce90bff800ac2530c"
>
> -inherit autotools manpages pkgconfig ptest python3native
> +inherit autotools manpages pkgconfig ptest python3native systemd
>
> -PACKAGECONFIG ?= "python readline json"
> +PACKAGECONFIG ?= "python readline json
> ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
>  PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise
> readline"
>  PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
>  PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , ,
> editline readline"
> @@ -27,10 +27,14 @@ PACKAGECONFIG[mini-gmp] = "--with-mini-gmp,
> --without-mini-gmp"
>  PACKAGECONFIG[python] = ""
>  PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline
> linenoise"
>  PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
> +PACKAGECONFIG[systemd] = "--with-unitdir=${systemd_system_unitdir},
> --without-unitdir"
>
>  EXTRA_OECONF = " \
>      ${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise
> readline', '', '--without-cli', d)}"
>
> +SYSTEMD_SERVICE:${PN} = "nftables.service"
> +SYSTEMD_AUTO_ENABLE:${PN} = "disable"
> +
>  PEP517_SOURCE_PATH = "${S}/py"
>
>  # xtables will need it on musl see iptables
>
Piotr Wejman May 13, 2026, 2:22 p.m. UTC | #2
Hi,

Thanks for reporting. I pushed a fixed v2 patch:
https://patchwork.yoctoproject.org/project/oe/patch/20260513131442.2582068-1-piotr.wejman@arm.com/

Piotr

________________________________________
From: Khem Raj <raj.khem@gmail.com>
Sent: Wednesday, May 13, 2026 6:21 AM
To: Piotr Wejman
Cc: openembedded-devel@lists.openembedded.org; joe@deserted.net; Ross Burton; Vincent Mailhol
Subject: Re: [meta-networking][PATCH] nftables: add systemd PACKAGECONFIG

seeing this error
https://errors.yoctoproject.org/Errors/Details/938664/

Seems to be related to this patch

On Wed, May 6, 2026 at 10:24 AM Piotr Wejman <piotr.wejman@arm.com<mailto:piotr.wejman@arm.com>> wrote:
Add a systemd PACKAGECONFIG option to install nftables systemd unit files.
When "systemd" is present in DISTRO_FEATURES, the option is enabled and
the service is installed but disabled by default.

Signed-off-by: Piotr Wejman <piotr.wejman@arm.com<mailto:piotr.wejman@arm.com>>
---
 meta-networking/recipes-filter/nftables/nftables_1.1.6.bb<http://nftables_1.1.6.bb> | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb<http://nftables_1.1.6.bb> b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb<http://nftables_1.1.6.bb>
index d27e60a18d..dbe0e8f9f5 100644
--- a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb<http://nftables_1.1.6.bb>
+++ b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb<http://nftables_1.1.6.bb>
@@ -16,9 +16,9 @@ SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz<http://www.netfilter.org/projects/nftables/files/$%7BBP%7D.tar.xz> \
           "
 SRC_URI[sha256sum] = "372931bda8556b310636a2f9020adc710f9bab66f47efe0ce90bff800ac2530c"

-inherit autotools manpages pkgconfig ptest python3native
+inherit autotools manpages pkgconfig ptest python3native systemd

-PACKAGECONFIG ?= "python readline json"
+PACKAGECONFIG ?= "python readline json ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise readline"
 PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
 PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline"
@@ -27,10 +27,14 @@ PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp"
 PACKAGECONFIG[python] = ""
 PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise"
 PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
+PACKAGECONFIG[systemd] = "--with-unitdir=${systemd_system_unitdir}, --without-unitdir"

 EXTRA_OECONF = " \
     ${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}"

+SYSTEMD_SERVICE:${PN} = "nftables.service"
+SYSTEMD_AUTO_ENABLE:${PN} = "disable"
+
 PEP517_SOURCE_PATH = "${S}/py"

 # xtables will need it on musl see iptables
diff mbox series

Patch

diff --git a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
index d27e60a18d..dbe0e8f9f5 100644
--- a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
+++ b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
@@ -16,9 +16,9 @@  SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz \
           "
 SRC_URI[sha256sum] = "372931bda8556b310636a2f9020adc710f9bab66f47efe0ce90bff800ac2530c"
 
-inherit autotools manpages pkgconfig ptest python3native
+inherit autotools manpages pkgconfig ptest python3native systemd
 
-PACKAGECONFIG ?= "python readline json"
+PACKAGECONFIG ?= "python readline json ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise readline"
 PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
 PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline"
@@ -27,10 +27,14 @@  PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp"
 PACKAGECONFIG[python] = ""
 PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise"
 PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
+PACKAGECONFIG[systemd] = "--with-unitdir=${systemd_system_unitdir}, --without-unitdir"
 
 EXTRA_OECONF = " \
     ${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}"
 
+SYSTEMD_SERVICE:${PN} = "nftables.service"
+SYSTEMD_AUTO_ENABLE:${PN} = "disable"
+
 PEP517_SOURCE_PATH = "${S}/py"
 
 # xtables will need it on musl see iptables