Yocto Project Documentation
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <quentin.schulz@cherry.de>, <docs@lists.yoctoproject.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Koen Kooi" <koen.kooi@oss.qualcomm.com>,
	"Ross Burton" <Ross.Burton@arm.com>
Subject: Re: [docs] [PATCH] migration-guides/migration-5.3.rst: add note on systemd pni-names change
Date: Wed, 10 Sep 2025 15:32:48 +0200	[thread overview]
Message-ID: <DCP5POSAGUMF.23UE4FM0ZY1DN@bootlin.com> (raw)
In-Reply-To: <bec3b912-1220-4478-a30e-4c4d828860b5@cherry.de>

On Wed Sep 10, 2025 at 3:16 PM CEST, Quentin Schulz via lists.yoctoproject.org wrote:
> Hi Antonin,
>
> On 9/10/25 3:08 PM, Antonin Godard wrote:
>> On Tue Sep 9, 2025 at 3:59 PM CEST, Quentin Schulz via lists.yoctoproject.org wrote:
>>> Hi Antonin,
>>>
>>> On 9/9/25 3:29 PM, Antonin Godard via lists.yoctoproject.org wrote:
>>>> Add a migration note on the pni-names default policy change after commit
>>>> <> in OE-Core.
>>>>
>>>
>>> General question, the systemd manpage specifies the policy as mac and
>>> not MAC, should we follow that as well?
>>>
>>>> Cc: Koen Kooi <koen.kooi@oss.qualcomm.com>
>>>> Cc: Ross Burton <Ross.Burton@arm.com>
>>>> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
>>>> ---
>>>>    documentation/migration-guides/migration-5.3.rst | 25 ++++++++++++++++++++++++
>>>>    1 file changed, 25 insertions(+)
>>>>
>>>> diff --git a/documentation/migration-guides/migration-5.3.rst b/documentation/migration-guides/migration-5.3.rst
>>>> index 2d2f8d91a..8aa7b537f 100644
>>>> --- a/documentation/migration-guides/migration-5.3.rst
>>>> +++ b/documentation/migration-guides/migration-5.3.rst
>>>> @@ -118,6 +118,31 @@ class. Instead, one should create a new recipe to build this FIT image, as
>>>>    described in the :ref:`Removed Classes <migration-guides/migration-5.3:Removed
>>>>    Classes>` section of the Migration notes for |yocto-ver| (|yocto-codename|).
>>>>    
>>>> +systemd Predictable Interface Names no longer MAC policy by default
>>>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> +
>>>> +The :oe_git:`systemd recipe </openembedded-core/tree/meta/recipes-core/systemd>`
>>>> +used to forcibly set the MAC policy by default when the ``pni-names``
>>>> +:term:`distro feature <DISTRO_FEATURES>` was enabled. See
>>>
>>> s/was/is/ ?
>>>
>>>> +https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html#AlternativeNamesPolicy=.
>>>> +
>>>> +This is no longer the case. Instead, when the ``pni-names`` :term:`distro
>>>
>>> SHould we justify here why it is no longer the case?
>>>
>>>> +feature <DISTRO_FEATURES>` is enabled, the default policy from systemd is
>>>> +selected (from https://github.com/systemd/systemd/blob/main/network/99-default.link).
>>>> +
>>>> +To set the MAC policy to systemd, add the following to a systemd ``.bbappend``
>>>
>>> s/to systemd/in systemd/ ?
>>>
>>>> +file in your custom layer::
>>>> +
>>>> +   do_install:append() {
>>>> +          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
>>>
>>> My brain's sh parser says this is invalid because we're missing a
>>> closing fi for the outermost if block.
>> 
>> Yes, my bad I must have removed it by mistake
>> 
>>> I'm also a bit worried about this code snippet as it'll just not be
>>> tested or maintained once this gets merged.
>> 
>> This snippet belongs to a release note for 5.3 so it already matches the Yocto
>> version? I will include the version of systemd version here at the time of
>> writing to give some more context.
>> 
>
> Does this mean that we already know it's not going to be compatible with 
> Wrynose?
>
> People are told to follow each migration manual between their current 
> and target Yocto releases, so this will essentially be understood as 
> "apply for any release starting from 5.3".
>
> We already saw how well maintained old example recipes were since we 
> don't test them, I'm not sure it makes sense to have code snippets we'll 
> likely never test as well?

A simpler approach could be to say:

"""
To set the mac policy to systemd, modify the ``99-default-link.link`` file
provided by systemd in a ``.bbappend`` file to set the ``NamePolicy=`` and
``AlternativeNamesPolicy=`` settings to "mac".
"""

This should not require maintenance. Do you agree?

Antonin

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



  reply	other threads:[~2025-09-10 13:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 13:29 [PATCH] migration-guides/migration-5.3.rst: add note on systemd pni-names change Antonin Godard
2025-09-09 13:59 ` [docs] " Quentin Schulz
2025-09-10 13:08   ` Antonin Godard
2025-09-10 13:16     ` Quentin Schulz
2025-09-10 13:32       ` Antonin Godard [this message]
2025-09-10 14:08         ` Quentin Schulz
2025-09-12 11:27           ` Antonin Godard

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=DCP5POSAGUMF.23UE4FM0ZY1DN@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=Ross.Burton@arm.com \
    --cc=docs@lists.yoctoproject.org \
    --cc=koen.kooi@oss.qualcomm.com \
    --cc=quentin.schulz@cherry.de \
    --cc=thomas.petazzoni@bootlin.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