From: Koen Kooi <koen.kooi@oss.qualcomm.com>
To: eichest@gmail.com
Cc: openembedded-core@lists.openembedded.org,
Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [OE-core] [PATCH] systemd: Allow overriding PNI name policies
Date: Thu, 10 Apr 2025 09:34:03 +0200 [thread overview]
Message-ID: <AAAA74B5-1C74-4FCD-8FDE-ADA8C89EBB30@oss.qualcomm.com> (raw)
In-Reply-To: <20250409101545.5936-1-eichest@gmail.com>
> Op 9 apr 2025, om 12:15 heeft Stefan Eichenberger via lists.openembedded.org <eichest=gmail.com@lists.openembedded.org> het volgende geschreven:
>
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>
> Add two new variables, PNI_NAME_POLICY and PNI_ALTNAMES_POLICY, to allow
> overriding the default Predictable Network Interface (PNI) name and
> alternative name policies respectively.
>
> This allows setting different name policies via a .bbappend file if the
> defaults are not suitable for a specific use case.
Nice! This scratches an itch I had for a looooong time now :)
regards,
Koen
>
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
> meta/recipes-core/systemd/systemd_257.4.bb | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/meta/recipes-core/systemd/systemd_257.4.bb b/meta/recipes-core/systemd/systemd_257.4.bb
> index 24aad11c0a..00edd702fb 100644
> --- a/meta/recipes-core/systemd/systemd_257.4.bb
> +++ b/meta/recipes-core/systemd/systemd_257.4.bb
> @@ -273,6 +273,10 @@ WATCHDOG_TIMEOUT ??= "60"
> # and the watchdog is enabled. (defaults is no hardware watchdog use)
> WATCHDOG_RUNTIME_SEC ??= ""
>
> +# Predictable network interface name policies
> +PNI_NAME_POLICY ??= "keep kernel database onboard slot path mac"
> +PNI_ALTERNATIVE_NAMES_POLICY ??= "database onboard slot path mac"
> +
> do_install() {
> meson_do_install
>
> @@ -398,12 +402,8 @@ do_install() {
> 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
> + sed -i 's/^NamePolicy=.*/NamePolicy=${PNI_NAME_POLICY}/' ${D}${nonarch_libdir}/systemd/network/99-default.link
> + sed -i 's/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=${PNI_ALTERNATIVE_NAMES_POLICY}/' ${D}${nonarch_libdir}/systemd/network/99-default.link
> else
> # Actively disable Predictable Network Interface Names
> sed -i 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/' ${D}${nonarch_libdir}/systemd/network/99-default.link
> --
> 2.45.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#214582): https://lists.openembedded.org/g/openembedded-core/message/214582
> Mute This Topic: https://lists.openembedded.org/mt/112169516/9418801
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [koen.kooi@oss.qualcomm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2025-04-10 7:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 10:15 [PATCH] systemd: Allow overriding PNI name policies Stefan Eichenberger
2025-04-10 7:34 ` Koen Kooi [this message]
2025-04-14 17:03 ` [OE-core] " Joshua Watt
2025-04-15 6:56 ` Koen Kooi
2025-04-15 7:21 ` Stefan Eichenberger
2025-05-29 20:03 ` Ross Burton
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=AAAA74B5-1C74-4FCD-8FDE-ADA8C89EBB30@oss.qualcomm.com \
--to=koen.kooi@oss.qualcomm.com \
--cc=eichest@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=stefan.eichenberger@toradex.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