From 2c3f9e8f216edd7256022eec74ba8ab1c6b1c330 Mon Sep 17 00:00:00 2001 From: Alejandro Benete Date: Tue, 30 Mar 2021 11:01:20 +0200 Subject: [PATCH] meta-somdevices: Created ethname_1.0.bb to change eth interfaces names to eno using udev. Signed-off-by: Alejandro Benete --- recipes-somdevices/ethname/ethname_1.0.bb | 22 +++++++++++++++++++ .../ethname/files/20-ethernet.rules | 10 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 recipes-somdevices/ethname/ethname_1.0.bb create mode 100644 recipes-somdevices/ethname/files/20-ethernet.rules diff --git a/recipes-somdevices/ethname/ethname_1.0.bb b/recipes-somdevices/ethname/ethname_1.0.bb new file mode 100644 index 0000000..cbeccdf --- /dev/null +++ b/recipes-somdevices/ethname/ethname_1.0.bb @@ -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 index 0000000..2a94081 --- /dev/null +++ b/recipes-somdevices/ethname/files/20-ethernet.rules @@ -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" -- 2.17.1