diff mbox series

[1/1] init-ifupdown: add predictable interface names

Message ID 20240110211016.1470053-1-joe.slater@windriver.com
State Accepted, archived
Commit 4f1ca42b0ae09280247824f08a2b8f22f396b3d1
Headers show
Series [1/1] init-ifupdown: add predictable interface names | expand

Commit Message

Slater, Joseph Jan. 10, 2024, 9:10 p.m. UTC
From: Joe Slater <joe.slater@windriver.com>

Use a pattern to initialize interfaces which start
with 'en'.  Also, make 'eth0' a pattern so that we
do not see an initialization error if it has been
renamed.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 .../init-ifupdown/init-ifupdown-1.0/interfaces             | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Ross Burton April 10, 2024, 1:41 p.m. UTC | #1
On 10 Jan 2024, at 21:10, Joe Slater via lists.openembedded.org <joe.slater=windriver.com@lists.openembedded.org> wrote:
> -# Wired or wireless interfaces
> -auto eth0
> +# Wired or wireless interfaces including predictable names
> +auto /eth0

Obviously we’re days away from release but I think we need to revert or rewrite this.

The /name syntax is specific to “proper” ifupdown, so any system which uses busybox’s ifupdown will fail to have functional networking.  We don’t see this on the AB because there is a separate interfaces file for the qemuall override, this file is only used in non-qemu situations.

Ross
Richard Purdie April 10, 2024, 5:29 p.m. UTC | #2
On Wed, 2024-04-10 at 13:41 +0000, Ross Burton wrote:
> On 10 Jan 2024, at 21:10, Joe Slater via lists.openembedded.org
> <joe.slater=windriver.com@lists.openembedded.org> wrote:
> > -# Wired or wireless interfaces
> > -auto eth0
> > +# Wired or wireless interfaces including predictable names
> > +auto /eth0
> 
> Obviously we’re days away from release but I think we need to revert
> or rewrite this.
> 
> The /name syntax is specific to “proper” ifupdown, so any system
> which uses busybox’s ifupdown will fail to have functional
> networking.  We don’t see this on the AB because there is a separate
> interfaces file for the qemuall override, this file is only used in
> non-qemu situations.

I'm worried about the number of other changes over the last few months
that are related to this so a simple revert might not get us to a good
place.

I'd like to see a patch proposal on what we should do. Time is short as
testing changes takes time and we're now a bit behind already :/.

So specific proposals welcome.

Cheers,

Richard
Alexander Kanavin April 10, 2024, 6:18 p.m. UTC | #3
On Wed, 10 Apr 2024 at 19:29, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> I'd like to see a patch proposal on what we should do. Time is short as
> testing changes takes time and we're now a bit behind already :/.
>
> So specific proposals welcome.

If no one comes out with a better proposal, I'd suggest reverting the
top five commts, all of them:
https://git.yoctoproject.org/poky/log/?qt=author&q=slater

Alex
Slater, Joseph April 10, 2024, 7:29 p.m. UTC | #4
The easiest thing to do is to change "auto /eth0" back to "auto eth0".  This lets bitbake's ifupdown initialize eth0 and also allows the real ifupdown to initialize en* interfaces if they exist.

Joe

> -----Original Message-----
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> Sent: Wednesday, April 10, 2024 10:29 AM
> To: Ross Burton <ross.burton@arm.com>; Slater, Joseph
> <joe.slater@windriver.com>
> Cc: openembedded-core@lists.openembedded.org; MacLeod, Randy
> <Randy.MacLeod@windriver.com>
> Subject: Re: [oe-core][PATCH 1/1] init-ifupdown: add predictable interface names
> 
> On Wed, 2024-04-10 at 13:41 +0000, Ross Burton wrote:
> > On 10 Jan 2024, at 21:10, Joe Slater via lists.openembedded.org
> > <joe.slater=windriver.com@lists.openembedded.org> wrote:
> > > -# Wired or wireless interfaces
> > > -auto eth0
> > > +# Wired or wireless interfaces including predictable names auto
> > > +/eth0
> >
> > Obviously we’re days away from release but I think we need to revert
> > or rewrite this.
> >
> > The /name syntax is specific to “proper” ifupdown, so any system which
> > uses busybox’s ifupdown will fail to have functional networking.  We
> > don’t see this on the AB because there is a separate interfaces file
> > for the qemuall override, this file is only used in non-qemu
> > situations.
> 
> I'm worried about the number of other changes over the last few months that are
> related to this so a simple revert might not get us to a good place.
> 
> I'd like to see a patch proposal on what we should do. Time is short as testing
> changes takes time and we're now a bit behind already :/.
> 
> So specific proposals welcome.
> 
> Cheers,
> 
> Richard
Slater, Joseph April 10, 2024, 9:43 p.m. UTC | #5
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Joe Slater via
> lists.openembedded.org
> Sent: Wednesday, April 10, 2024 12:30 PM
> To: Richard Purdie <richard.purdie@linuxfoundation.org>; Ross Burton
> <ross.burton@arm.com>
> Cc: openembedded-core@lists.openembedded.org; MacLeod, Randy
> <Randy.MacLeod@windriver.com>
> Subject: Re: [oe-core][PATCH 1/1] init-ifupdown: add predictable interface names
> 
> The easiest thing to do is to change "auto /eth0" back to "auto eth0".  This lets
> bitbake's ifupdown initialize eth0 and also allows the real ifupdown to initialize
> en* interfaces if they exist.

Oops, that's busybox, not bitbake.  Since we would need ifupdown to process renamed interfaces, I'm preparing a patch for packagegroup-core-boot  to RRECOMMENDS it into the rootfs if sysvinit and pni-names are distro features.

Joe

> 
> Joe
> 
> > -----Original Message-----
> > From: Richard Purdie <richard.purdie@linuxfoundation.org>
> > Sent: Wednesday, April 10, 2024 10:29 AM
> > To: Ross Burton <ross.burton@arm.com>; Slater, Joseph
> > <joe.slater@windriver.com>
> > Cc: openembedded-core@lists.openembedded.org; MacLeod, Randy
> > <Randy.MacLeod@windriver.com>
> > Subject: Re: [oe-core][PATCH 1/1] init-ifupdown: add predictable
> > interface names
> >
> > On Wed, 2024-04-10 at 13:41 +0000, Ross Burton wrote:
> > > On 10 Jan 2024, at 21:10, Joe Slater via lists.openembedded.org
> > > <joe.slater=windriver.com@lists.openembedded.org> wrote:
> > > > -# Wired or wireless interfaces
> > > > -auto eth0
> > > > +# Wired or wireless interfaces including predictable names auto
> > > > +/eth0
> > >
> > > Obviously we’re days away from release but I think we need to revert
> > > or rewrite this.
> > >
> > > The /name syntax is specific to “proper” ifupdown, so any system
> > > which uses busybox’s ifupdown will fail to have functional
> > > networking.  We don’t see this on the AB because there is a separate
> > > interfaces file for the qemuall override, this file is only used in
> > > non-qemu situations.
> >
> > I'm worried about the number of other changes over the last few months
> > that are related to this so a simple revert might not get us to a good place.
> >
> > I'd like to see a patch proposal on what we should do. Time is short
> > as testing changes takes time and we're now a bit behind already :/.
> >
> > So specific proposals welcome.
> >
> > Cheers,
> >
> > Richard
Alexander Kanavin April 11, 2024, 7:29 a.m. UTC | #6
On Wed, 10 Apr 2024 at 23:43, Joe Slater via lists.openembedded.org
<joe.slater=windriver.com@lists.openembedded.org> wrote:
> Oops, that's busybox, not bitbake.  Since we would need ifupdown to process renamed interfaces, I'm preparing a patch for packagegroup-core-boot  to RRECOMMENDS it into the rootfs if sysvinit and pni-names are distro features.

We also need to resolve the situation in the 'systemd: make
predictable name mac policy opt-out' thread, can you please look into
it?

Alex
diff mbox series

Patch

diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
index 0acf4cf441..e617fcf69b 100644
--- a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -13,11 +13,14 @@  iface wlan0 inet dhcp
 
 iface atml0 inet dhcp
 
-# Wired or wireless interfaces
-auto eth0
+# Wired or wireless interfaces including predictable names
+auto /eth0
 iface eth0 inet dhcp
 iface eth1 inet dhcp
 
+auto /en*=eth
+iface eth inet dhcp
+
 # Ethernet/RNDIS gadget (g_ether)
 # ... or on host side, usbnet and random hwaddr
 iface usb0 inet static