eudev: allow for predictable network interface names
PATCH 1/1 eudev: allow for predictable network interface names
From: Joe Slater <[email protected]>
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.
--- meta/recipes-core/udev/eudev_3.2.14.bb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/udev/eudev_3.2.14.bb +4 -3
@@ -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', 'false', 'true', d)}; then + touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules + fi } do_install:prepend:class-target () {
Signature · 1 line
2.25.1
Quoted 25 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Joe Slater via lists.openembedded.org
Sent: den 31 januari 2024 19:54
To: [email protected]
Cc: [email protected]; [email protected]
Subject: [oe-core][PATCH 1/1] eudev: allow for predictable network interface namesFrom: Joe Slater <[email protected]>
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 <[email protected]>--- meta/recipes-core/udev/eudev_3.2.14.bb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)meta/recipes-core/udev/eudev_3.2.14.bb +0
-0
meta/recipes-core/udev/eudev_3.2.14.bb do_install:append() { · line 53
Quoted 8 lines
meta/recipes-core/udev/eudev_3.2.14.bb +2
-3@@ -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', 'false', 'true', d)}; then
May I suggest to write that as:
if ! ${@bb.utils.contains('DISTRO_FEATURES', 'pni-names', 'true', 'false', d)}; thenAt least I find it much easier to read code like this that mixes shell code with Python code where bb.utils.contains() is only used to determine whether a feature is set if it actually returns 'true' when the feature is set. An alternative is to write it as:
if [ ! "${@bb.utils.filter('DISTRO_FEATURES', 'pni-names', d)}" ]; thenQuoted 7 lines
meta/recipes-core/udev/eudev_3.2.14.bb +2
-1+ touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules + fi } do_install:prepend:class-target () { --2.25.1
//Peter