diff mbox series

[1/1] eudev: modify predictable network if name search

Message ID 20240110211203.1471586-1-joe.slater@windriver.com
State Accepted, archived
Commit 4a7b42fcf6981d3120c08091a7ed3d4d7bcd41f0
Headers show
Series [1/1] eudev: modify predictable network if name search | expand

Commit Message

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

Consider a name based on mac address in addition to
those based on slot or path.

Note that as of this commit predictable naming is
suppressed by eudev, but can be enabled by removing
/etc/udev/rules.d/80-net-name-slot.rules from the
root filesystem.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 meta/recipes-core/udev/eudev/netifnames.patch | 17 +++++++++++++++++
 meta/recipes-core/udev/eudev_3.2.14.bb        |  2 ++
 2 files changed, 19 insertions(+)
 create mode 100644 meta/recipes-core/udev/eudev/netifnames.patch

Comments

Randy MacLeod Jan. 10, 2024, 9:53 p.m. UTC | #1
On 2024-01-10 4:12 p.m., joe.slater@windriver.com wrote:
> From: Joe Slater<joe.slater@windriver.com>
>
> Consider a name based on mac address in addition to
> those based on slot or path.
>
> Note that as of this commit predictable naming is
> suppressed by eudev, but can be enabled by removing
> /etc/udev/rules.d/80-net-name-slot.rules from the
> root filesystem.

Thanks Joe.

For anyone wondering, this commit and:

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

are working on enabling predictable network interface names.

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/


Is there anyone else in favour of or opposed to  making PNI be the 
default for Yocto
for both sysvinit and systemd images?

I think we'd need to modify runqemu and probably fix several other 
tests, right Joe?

../Randy



>
> Signed-off-by: Joe Slater<joe.slater@windriver.com>
> ---
>   meta/recipes-core/udev/eudev/netifnames.patch | 17 +++++++++++++++++
>   meta/recipes-core/udev/eudev_3.2.14.bb        |  2 ++
>   2 files changed, 19 insertions(+)
>   create mode 100644 meta/recipes-core/udev/eudev/netifnames.patch
>
> diff --git a/meta/recipes-core/udev/eudev/netifnames.patch b/meta/recipes-core/udev/eudev/netifnames.patch
> new file mode 100644
> index 0000000000..a45b80118f
> --- /dev/null
> +++ b/meta/recipes-core/udev/eudev/netifnames.patch
> @@ -0,0 +1,17 @@
> +eudev: consider ID_NET_NAME_MAC as an interface name
> +
> +eudev might not create names based on slot or path.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Joe Slater<joe.slater@windriver.com>
> +
> +--- a/rules/80-net-name-slot.rules
> ++++ b/rules/80-net-name-slot.rules
> +@@ -10,5 +10,6 @@ ENV{net.ifnames}=="0", GOTO="net_name_sl
> + NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
> + NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
> + NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
> ++NAME=="", ENV{ID_NET_NAME_MAC}!="", NAME="$env{ID_NET_NAME_MAC}"
> +
> + LABEL="net_name_slot_end"
> diff --git a/meta/recipes-core/udev/eudev_3.2.14.bb b/meta/recipes-core/udev/eudev_3.2.14.bb
> index d0758691bd..ddb3c3340f 100644
> --- a/meta/recipes-core/udev/eudev_3.2.14.bb
> +++ b/meta/recipes-core/udev/eudev_3.2.14.bb
> @@ -10,6 +10,7 @@ DEPENDS = "gperf-native"
>   PROVIDES = "udev"
>   
>   SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
> +file://netifnames.patch  \
>              file://init  \
>              file://local.rules  \
>              "
> @@ -50,6 +51,7 @@ do_install:append() {
>   
>   	# Use classic network interface naming scheme
>   	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
> +
>   }
>   
>   do_install:prepend:class-target () {
Alexander Kanavin Jan. 11, 2024, 10:45 a.m. UTC | #2
On Wed, 10 Jan 2024 at 22:54, Randy MacLeod via lists.openembedded.org
<randy.macleod=windriver.com@lists.openembedded.org> wrote:
> +++ b/meta/recipes-core/udev/eudev/netifnames.patch
> @@ -0,0 +1,17 @@
> +eudev: consider ID_NET_NAME_MAC as an interface name
> +
> +eudev might not create names based on slot or path.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Joe Slater <joe.slater@windriver.com>

Please submit upstream first, or provide a reason for Pending (and it
better be good).

Alex
diff mbox series

Patch

diff --git a/meta/recipes-core/udev/eudev/netifnames.patch b/meta/recipes-core/udev/eudev/netifnames.patch
new file mode 100644
index 0000000000..a45b80118f
--- /dev/null
+++ b/meta/recipes-core/udev/eudev/netifnames.patch
@@ -0,0 +1,17 @@ 
+eudev: consider ID_NET_NAME_MAC as an interface name
+
+eudev might not create names based on slot or path.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/rules/80-net-name-slot.rules
++++ b/rules/80-net-name-slot.rules
+@@ -10,5 +10,6 @@ ENV{net.ifnames}=="0", GOTO="net_name_sl
+ NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
+ NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
+ NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
++NAME=="", ENV{ID_NET_NAME_MAC}!="", NAME="$env{ID_NET_NAME_MAC}"
+ 
+ LABEL="net_name_slot_end"
diff --git a/meta/recipes-core/udev/eudev_3.2.14.bb b/meta/recipes-core/udev/eudev_3.2.14.bb
index d0758691bd..ddb3c3340f 100644
--- a/meta/recipes-core/udev/eudev_3.2.14.bb
+++ b/meta/recipes-core/udev/eudev_3.2.14.bb
@@ -10,6 +10,7 @@  DEPENDS = "gperf-native"
 PROVIDES = "udev"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
+           file://netifnames.patch \
            file://init \
            file://local.rules \
            "
@@ -50,6 +51,7 @@  do_install:append() {
 
 	# Use classic network interface naming scheme
 	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
+
 }
 
 do_install:prepend:class-target () {