meta-somdevices: Created ethname_1.0.bb to change eth interfaces names to eno using...
authorAlejandro Benete <abenete@somdevices.com>
Tue, 30 Mar 2021 09:01:20 +0000 (11:01 +0200)
committerAlejandro Benete <abenete@somdevices.com>
Tue, 30 Mar 2021 09:01:20 +0000 (11:01 +0200)
Signed-off-by: Alejandro Benete <abenete@somdevices.com>
recipes-somdevices/ethname/ethname_1.0.bb [new file with mode: 0644]
recipes-somdevices/ethname/files/20-ethernet.rules [new file with mode: 0644]

diff --git a/recipes-somdevices/ethname/ethname_1.0.bb b/recipes-somdevices/ethname/ethname_1.0.bb
new file mode 100644 (file)
index 0000000..cbeccdf
--- /dev/null
@@ -0,0 +1,22 @@
+SUMMARY = "Change ethernet interface names"
+DESCRIPTION = "Change order and interface names eth0 to eno2 and eth1 to eno1"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI += "\
+       file://20-ethernet.rules \
+"
+
+S = "${WORKDIR}"
+
+SYSTEMD_PACKAGES = "${PN}"
+
+FILES_${PN} += " 20-ethernet.rules \
+"
+
+do_install () {
+       install -d ${D}/etc/udev/rules.d
+       install -m 0644 ${WORKDIR}/20-ethernet.rules ${D}/etc/udev/rules.d
+}
+
diff --git a/recipes-somdevices/ethname/files/20-ethernet.rules b/recipes-somdevices/ethname/files/20-ethernet.rules
new file mode 100644 (file)
index 0000000..2a94081
--- /dev/null
@@ -0,0 +1,10 @@
+# Ethernet network device rules file
+#
+
+
+# Do not assign ethX names, since they might be already in use.
+# Use udevadm to get possible selectors.
+# udevadm info -a -p /sys/class/net/eth0
+
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="20b4000.ethernet", NAME="eno2"
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="2188000.ethernet", NAME="eno1"