diff mbox series

[v2,1/1] eudev: allow for predictable network interface names

Message ID 20240205153302.670089-1-joe.slater@windriver.com
State Accepted, archived
Commit dc7cd56df85f28f2a3a3dd97730d475522b7b0f7
Headers show
Series [v2,1/1] eudev: allow for predictable network interface names | expand

Commit Message

Slater, Joseph Feb. 5, 2024, 3:33 p.m. UTC
From: Joe Slater <joe.slater@windriver.com>

Do not suppress renaming by eudev if 'pni-names' is
a distro feature.  The previous behavior was to always
suppress renaming.

eudev is used when sysvinit is the init manager.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 meta/recipes-core/udev/eudev_3.2.14.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Peter Kjellerstedt Feb. 5, 2024, 5:07 p.m. UTC | #1
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Joe Slater via lists.openembedded.org
> Sent: den 5 februari 2024 16:33
> To: openembedded-core@lists.openembedded.org
> Cc: joe.slater@windriver.com; randy.macleod@windriver.com
> Subject: [v2][oe-core][PATCH 1/1] eudev: allow for predictable network interface names
> 
> From: Joe Slater <joe.slater@windriver.com>
> 
> Do not suppress renaming by eudev if 'pni-names' is
> a distro feature.  The previous behavior was to always
> suppress renaming.
> 
> eudev is used when sysvinit is the init manager.
> 
> Signed-off-by: Joe Slater <joe.slater@windriver.com>
> ---
>  meta/recipes-core/udev/eudev_3.2.14.bb | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-core/udev/eudev_3.2.14.bb b/meta/recipes-
> core/udev/eudev_3.2.14.bb
> index ddb3c3340f..5c522d0db7 100644
> --- a/meta/recipes-core/udev/eudev_3.2.14.bb
> +++ b/meta/recipes-core/udev/eudev_3.2.14.bb
> @@ -49,9 +49,10 @@ do_install:append() {
>  	install -d ${D}${sysconfdir}/udev/rules.d
>  	install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
> 
> -	# Use classic network interface naming scheme
> -	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
> -
> +	# Use classic network interface naming scheme if no 'pni-names' distro feature
> +	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'pni-names', 'true', 'false', d)}; then
> +		touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
> +	fi
>  }
> 
>  do_install:prepend:class-target () {
> --
> 2.25.1

While I appreciate the effort after my comments, the original patch has 
already been merged.

//Peter
diff mbox series

Patch

diff --git a/meta/recipes-core/udev/eudev_3.2.14.bb b/meta/recipes-core/udev/eudev_3.2.14.bb
index ddb3c3340f..5c522d0db7 100644
--- a/meta/recipes-core/udev/eudev_3.2.14.bb
+++ b/meta/recipes-core/udev/eudev_3.2.14.bb
@@ -49,9 +49,10 @@  do_install:append() {
 	install -d ${D}${sysconfdir}/udev/rules.d
 	install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
 
-	# Use classic network interface naming scheme
-	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
-
+	# Use classic network interface naming scheme if no 'pni-names' distro feature
+	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'pni-names', 'true', 'false', d)}; then
+		touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
+	fi
 }
 
 do_install:prepend:class-target () {