Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <koen.kooi@oss.qualcomm.com>, <openembedded-core@lists.openembedded.org>
Cc: "Adrian Freihofer" <adrian.freihofer@siemens.com>,
	"Peter Marko" <peter.marko@siemens.com>,
	"Ross Burton" <ross.burton@arm.com>,
	"Jose Quaresma" <jose.quaresma@oss.qualcomm.com>
Subject: Re: [OE-core] [PATCH] systemd: stop enabling non-standard MAC policy when using the 'pni-names' DISTRO_FEATURE
Date: Fri, 05 Sep 2025 10:33:13 +0200	[thread overview]
Message-ID: <DCKQ7KX5D934.3FS2DI6M1I2L1@bootlin.com> (raw)
In-Reply-To: <20250902090925.2904294-1-koen.kooi@oss.qualcomm.com>

On Tue Sep 2, 2025 at 11:09 AM CEST, Koen Kooi via lists.openembedded.org wrote:
> This recipe enabled an additional, non-standard policy for predictable
> network names: the MAC policy. This is a deviation from upstream
> policies and in cases where no MAC address is available, it makes it
> actively worse by changing the name(s) every boot.
>
> Change the logic to disable predictable naming when the DISTRO_FEATURE
> isn't enabled and only use upstream logic with it *is* enabled.
>
> For DISTROs that wish to use non-standard policies, a DISTRO layer is the correct place.
> E.g. in DISTRO_LAYER/recipes-core/systemd/systemd_%.bbappend:
>
> do_install:append:DISTRO() {
>        if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then
>                if ! grep -q '^NamePolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
>                        sed -i '/^NamePolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
>                fi
>                if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
>                        sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
>                fi
> }
>
> Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
> ---
>  meta/recipes-core/systemd/systemd_257.8.bb | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/meta/recipes-core/systemd/systemd_257.8.bb b/meta/recipes-core/systemd/systemd_257.8.bb
> index 174372be03..6399c57640 100644
> --- a/meta/recipes-core/systemd/systemd_257.8.bb
> +++ b/meta/recipes-core/systemd/systemd_257.8.bb
> @@ -400,15 +400,8 @@ do_install() {
>  			${D}/${sysconfdir}/systemd/system.conf
>  	fi
>  
> -	if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then
> -		if ! grep -q '^NamePolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
> -			sed -i '/^NamePolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
> -		fi
> -		if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
> -			sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
> -		fi
> -	else
> -		# Actively disable Predictable Network Interface Names
> +	# Actively disable Predictable Network Interface Names
> +	if ${@ 'true' if not bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d) else 'false'}; then

This could be simplified to 

if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'false', 'true', d)}; then

no?

Antonin

-- 
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



  parent reply	other threads:[~2025-09-05  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  9:09 [PATCH] systemd: stop enabling non-standard MAC policy when using the 'pni-names' DISTRO_FEATURE Koen Kooi
2025-09-02  9:15 ` Patchtest results for " patchtest
2025-09-02  9:36   ` Koen Kooi
2025-09-02 17:18 ` Ross Burton
2025-09-05  8:33 ` Antonin Godard [this message]
2025-09-05  9:09   ` [OE-core] " Ross Burton
2025-09-05 12:02     ` Koen Kooi
     [not found]     ` <18626142A7130E51.28137@lists.openembedded.org>
2025-09-05 13:09       ` Koen Kooi
2025-09-05 13:15         ` Antonin Godard
2025-09-05 13:17           ` Ross Burton
2025-09-09  9:40           ` Koen Kooi
2025-09-09  9:43             ` Ross Burton
2025-09-09 11:25               ` Koen Kooi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DCKQ7KX5D934.3FS2DI6M1I2L1@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=jose.quaresma@oss.qualcomm.com \
    --cc=koen.kooi@oss.qualcomm.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.marko@siemens.com \
    --cc=ross.burton@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox