diff mbox series

systemd: make predictable name mac policy opt-out

Message ID 20240408070450.27686-1-peter.marko@siemens.com
State New
Headers show
Series systemd: make predictable name mac policy opt-out | expand

Commit Message

Marko, Peter April 8, 2024, 7:04 a.m. UTC
From: Peter Marko <peter.marko@siemens.com>

Even the patch says it's inappropriate for upstream,
and it's also inappropriate for some downstream projects, too.
So make it possible to opt-out on it.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 meta/recipes-core/systemd/systemd_255.4.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin April 9, 2024, 9:16 a.m. UTC | #1
On Mon, 8 Apr 2024 at 09:06, Peter Marko via lists.openembedded.org
<peter.marko=siemens.com@lists.openembedded.org> wrote:
> -           file://0001-NamePolicy.patch \
> +           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \

Conditional patches are terrible for maintainability. Please make it a
proper meson option, and submit upstream.

Alex
Marko, Peter April 9, 2024, 9:57 a.m. UTC | #2
-----Original Message-----
From: Alexander Kanavin <alex.kanavin@gmail.com> 
Sent: Tuesday, April 9, 2024 11:16
To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-out

> On Mon, 8 Apr 2024 at 09:06, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > -           file://0001-NamePolicy.patch \
> > +           ${@bb.utils.contains('PACKAGECONFIG', 
> > + 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \
>
> Conditional patches are terrible for maintainability. Please make it a proper meson option, and submit upstream.
>
> Alex

This patch has status upstream inappropriate.
Pushing something like that to upstream doesn't sound like a good plan.

What about reverting the inappropriate patch completely instead?

Peter
Alexander Kanavin April 9, 2024, 10:02 a.m. UTC | #3
On Tue, 9 Apr 2024 at 11:57, Marko, Peter <Peter.Marko@siemens.com> wrote:
>
> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: Tuesday, April 9, 2024 11:16
> To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-out
>
> > On Mon, 8 Apr 2024 at 09:06, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > > -           file://0001-NamePolicy.patch \
> > > +           ${@bb.utils.contains('PACKAGECONFIG',
> > > + 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \
> >
> > Conditional patches are terrible for maintainability. Please make it a proper meson option, and submit upstream.
> >
> > Alex
>
> This patch has status upstream inappropriate.
> Pushing something like that to upstream doesn't sound like a good plan.

It's inappropriate as it is now, but with a meson option it would be
very appropriate.

> What about reverting the inappropriate patch completely instead?

I'm okay with that too. Please work this out with the patch author.

Alex
Ross Burton April 10, 2024, 3:59 p.m. UTC | #4
On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> +           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \

There’s a few other places which use the pni-names DISTRO_FEATURE (which probably needs to be documented), this should respect that I guess.

Ross
Ross Burton April 10, 2024, 4:18 p.m. UTC | #5
On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> 
> From: Peter Marko <peter.marko@siemens.com>
> 
> Even the patch says it's inappropriate for upstream,
> and it's also inappropriate for some downstream projects, too.
> So make it possible to opt-out on it.

I’m looking at these patches because of the fallout from the use of matches in the interfaces file.   Presumably you want to make this opt-out for concrete reasons, can you explain what broke?

Ross
Marko, Peter April 10, 2024, 6:04 p.m. UTC | #6
-----Original Message-----
From: Ross Burton <Ross.Burton@arm.com> 
Sent: Wednesday, April 10, 2024 18:18
To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-out

> On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > 
> > From: Peter Marko <peter.marko@siemens.com>
> > 
> > Even the patch says it's inappropriate for upstream, and it's also 
> > inappropriate for some downstream projects, too.
> > So make it possible to opt-out on it.
>
> I’m looking at these patches because of the fallout from the use of matches in the interfaces file.   Presumably you want to make this opt-out for concrete reasons, can you explain what broke?
>
> Ross

Basically, we have networkmanager and firewalld configuration matching interface names.
In addition, also our applications are hardcoding the interface names to be able to configure interfaces on demand.
Switching to dynamic names is not realistic.

After upgrading from 5.0_M3 to 5.0_M4 our wlan0 interface gets renamed by udev and thus networking breaks.
Unlike our ethernet ports with names defined in device tree, wifi chip uses external vendor kernel module so I'm not sure if I'm able to configure a stable kernel name for it.

Peter
Francesco Dolcini April 11, 2024, 3:31 p.m. UTC | #7
Hello Marko and Ross

On Wed, Apr 10, 2024 at 06:04:30PM +0000, Marko, Peter wrote:
> From: Ross Burton <Ross.Burton@arm.com> 
> > On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > > From: Peter Marko <peter.marko@siemens.com>
> > > 
> > > Even the patch says it's inappropriate for upstream, and it's also
> > > inappropriate for some downstream projects, too.  So make it
> > > possible to opt-out on it.
> >
> > I’m looking at these patches because of the fallout from the use of
> > matches in the interfaces file.   Presumably you want to make this
> > opt-out for concrete reasons, can you explain what broke?
> 
> Basically, we have networkmanager and firewalld configuration matching
> interface names.  In addition, also our applications are hardcoding
> the interface names to be able to configure interfaces on demand.
> Switching to dynamic names is not realistic.
> 
> After upgrading from 5.0_M3 to 5.0_M4 our wlan0 interface gets renamed
> by udev and thus networking breaks.  Unlike our ethernet ports with
> names defined in device tree, wifi chip uses external vendor kernel
> module so I'm not sure if I'm able to configure a stable kernel name
> for it.

I can confirm that this is an issue also for my use case, for similar
reasons.

Francesco
Slater, Joseph April 11, 2024, 6:48 p.m. UTC | #8
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Peter Marko via
> lists.openembedded.org
> Sent: Wednesday, April 10, 2024 11:05 AM
> To: Ross Burton <Ross.Burton@arm.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-
> out
> 
> 
> -----Original Message-----
> From: Ross Burton <Ross.Burton@arm.com>
> Sent: Wednesday, April 10, 2024 18:18
> To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-
> out
> 
> > On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org
> <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > >
> > > From: Peter Marko <peter.marko@siemens.com>
> > >
> > > Even the patch says it's inappropriate for upstream, and it's also
> > > inappropriate for some downstream projects, too.
> > > So make it possible to opt-out on it.
> >
> > I’m looking at these patches because of the fallout from the use of matches in
> the interfaces file.   Presumably you want to make this opt-out for concrete
> reasons, can you explain what broke?
> >
> > Ross
> 
> Basically, we have networkmanager and firewalld configuration matching
> interface names.
> In addition, also our applications are hardcoding the interface names to be able
> to configure interfaces on demand.
> Switching to dynamic names is not realistic.
> 
> After upgrading from 5.0_M3 to 5.0_M4 our wlan0 interface gets renamed by
> udev and thus networking breaks.
> Unlike our ethernet ports with names defined in device tree, wifi chip uses
> external vendor kernel module so I'm not sure if I'm able to configure a stable
> kernel name for it.
> 
> Peter

Commit 37bd8e8... sets the configuration in 99-default.link to include mac-based "predictable" names.  I think we should decide on a default and let people who don't like it put a modified version of 99-default.link under /etc/system/network.  The impetus to allow mac based names is that some bsp's don't produce anything else, but that makes the default different than the upstream version.  Everyone will not want the provided 99-default.link, so we just need to decide who we cater to.

Joe
Marko, Peter April 12, 2024, 1:47 p.m. UTC | #9
-----Original Message-----
From: Ross Burton <Ross.Burton@arm.com> 
Sent: Wednesday, April 10, 2024 18:00
To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-out

> On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > +           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \
>
> There’s a few other places which use the pni-names DISTRO_FEATURE (which probably needs to be documented), this should respect that I guess.

Sent a v2, maybe it's more acceptable as it uses distro feature and does not conditionally patch the sources.

Note that I have added the pni-names condition only to the systemd part.
If this is accepted, the components from the other 4 patches should follow this.

Peter

>
> Ross
Richard Purdie April 12, 2024, 4:41 p.m. UTC | #10
On Fri, 2024-04-12 at 13:47 +0000, Marko, Peter wrote:
> -----Original Message-----
> From: Ross Burton <Ross.Burton@arm.com> 
> Sent: Wednesday, April 10, 2024 18:00
> To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH] systemd: make predictable name mac
> policy opt-out
> 
> > On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org
> > <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > > +           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-
> > > if-mac', 'file://0001-NamePolicy.patch', '', d)} \
> > 
> > There’s a few other places which use the pni-names DISTRO_FEATURE
> > (which probably needs to be documented), this should respect that I
> > guess.
> 
> Sent a v2, maybe it's more acceptable as it uses distro feature and
> does not conditionally patch the sources.

FWIW I much prefer it thanks.

> Note that I have added the pni-names condition only to the systemd
> part.
> If this is accepted, the components from the other 4 patches should
> follow this.

I'm struggling to keep track of all the details but I think this is an
improvement so I've queued it.

Cheers,

Richard
Marko, Peter April 12, 2024, 8:55 p.m. UTC | #11
-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Friday, April 12, 2024 18:41
To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>; Ross Burton <Ross.Burton@arm.com>; Kanavin, Alexander (EXT) (Linutronix GmbH) <alex@linutronix.de>; joe.slater@windriver.com
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] systemd: make predictable name mac policy opt-out

> On Fri, 2024-04-12 at 13:47 +0000, Marko, Peter wrote:
> > -----Original Message-----
> > From: Ross Burton <Ross.Burton@arm.com>
> > Sent: Wednesday, April 10, 2024 18:00
> > To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core][PATCH] systemd: make predictable name mac 
> > policy opt-out
> > 
> > > On 8 Apr 2024, at 08:04, Peter Marko via lists.openembedded.org 
> > > <peter.marko=siemens.com@lists.openembedded.org> wrote:
> > > > +           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-
> > > > if-mac', 'file://0001-NamePolicy.patch', '', d)} \
> > > 
> > > There’s a few other places which use the pni-names DISTRO_FEATURE 
> > > (which probably needs to be documented), this should respect that I 
> > > guess.
> > 
> > Sent a v2, maybe it's more acceptable as it uses distro feature and 
> > does not conditionally patch the sources.
>
> FWIW I much prefer it thanks.
>
> > Note that I have added the pni-names condition only to the systemd 
> > part.
> > If this is accepted, the components from the other 4 patches should 
> > follow this.
>
> I'm struggling to keep track of all the details but I think this is an improvement so I've queued it.

I have checked and I think we should be good now.
The 5 commits introducing the pni changes were:
- "init-ifupdown: add predictable interface names" - does not enable pni, just handles if it's enabled
    - found problems were fixed by "init-ifupdown: modify interfaces for busybox" and "packagegroup-core-boot: recommend ifupdown"
- "eudev: modify predictable network if name search" - does not enable pmi, just handles if it's enabled
- "eudev: allow for predictable network interface names" - guarded by pni-names
- "qemuboot: predictable network interface names" - guarded by pni-names
- "systemd: enable mac based names in NamePolicy" - guarded by pni-names now after my commit

Peter

> Cheers,
>
> Richard
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_255.4.bb b/meta/recipes-core/systemd/systemd_255.4.bb
index 8a816c4bc1..17f28a9897 100644
--- a/meta/recipes-core/systemd/systemd_255.4.bb
+++ b/meta/recipes-core/systemd/systemd_255.4.bb
@@ -28,7 +28,7 @@  SRC_URI += " \
            file://systemd-pager.sh \
            file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
            file://0008-implment-systemd-sysv-install-for-OE.patch \
-           file://0001-NamePolicy.patch \
+           ${@bb.utils.contains('PACKAGECONFIG', 'predictable-if-mac', 'file://0001-NamePolicy.patch', '', d)} \
            "
 
 # patches needed by musl
@@ -88,6 +88,7 @@  PACKAGECONFIG ??= " \
     nss \
     nss-mymachines \
     nss-resolve \
+    predictable-if-mac \
     quotacheck \
     randomseed \
     resolved \
@@ -197,6 +198,7 @@  PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
 PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
 PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
 PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false"
+PACKAGECONFIG[predictable-if-mac] = ",,,"
 PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode"
 PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
 PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"