Patchwork [meta-fsl-ppc,v5,8/8] udev-extraconf: add rule to rename network interfaces for t4/b4

login
register
mail settings
Submitter Ting Liu
Date March 9, 2013, 3:32 p.m.
Message ID <1362843123-18078-9-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/45805/
State Accepted
Delegated to: Matthew McClintock
Headers show

Comments

Ting Liu - March 9, 2013, 3:32 p.m.
From: Ting Liu <b28495@freescale.com>

Since on FManv3 a MEMAC can be configured either as 1G or 10G, rename
all interfaces on T4/B4 to "fmX-macY", with X in the range 1..2 and
Y in the range 1..10.

Signed-off-by: Zhenhua Luo <b19537@freescale.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Signed-off-by: Ting Liu <b28495@freescale.com>
---
 .../72-fsl-dpaa-persistent-networking.rules        |   21 ++++++++++++++++++++
 recipes-core/udev/udev-extraconf_1.0.bbappend      |    7 +++--
 2 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100644 recipes-core/udev/udev-extraconf/72-fsl-dpaa-persistent-networking.rules

Patch

diff --git a/recipes-core/udev/udev-extraconf/72-fsl-dpaa-persistent-networking.rules b/recipes-core/udev/udev-extraconf/72-fsl-dpaa-persistent-networking.rules
new file mode 100644
index 0000000..34e72a3
--- /dev/null
+++ b/recipes-core/udev/udev-extraconf/72-fsl-dpaa-persistent-networking.rules
@@ -0,0 +1,21 @@ 
+# Rules for handling naming the DPAA FMan ethernet ports in a consistent way
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4e0000", NAME="fm1-mac1"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4e2000", NAME="fm1-mac2"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4e4000", NAME="fm1-mac3"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4e6000", NAME="fm1-mac4"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4e8000", NAME="fm1-mac5"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4ea000", NAME="fm1-mac6"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4ec000", NAME="fm1-mac7"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4ee000", NAME="fm1-mac8"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4f0000", NAME="fm1-mac9"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe4f2000", NAME="fm1-mac10"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5e0000", NAME="fm2-mac1"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5e2000", NAME="fm2-mac2"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5e4000", NAME="fm2-mac3"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5e6000", NAME="fm2-mac4"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5e8000", NAME="fm2-mac5"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5ea000", NAME="fm2-mac6"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5ec000", NAME="fm2-mac7"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5ee000", NAME="fm2-mac8"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5f0000", NAME="fm2-mac9"
+SUBSYSTEM=="net", DRIVERS=="fsl_dpa", ATTR{device_addr}=="ffe5f2000", NAME="fm2-mac10"
diff --git a/recipes-core/udev/udev-extraconf_1.0.bbappend b/recipes-core/udev/udev-extraconf_1.0.bbappend
index 3b66250..056d037 100644
--- a/recipes-core/udev/udev-extraconf_1.0.bbappend
+++ b/recipes-core/udev/udev-extraconf_1.0.bbappend
@@ -1,11 +1,12 @@ 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-PRINC := "${@int(PRINC) + 1}"
+PRINC := "${@int(PRINC) + 2}"
 
-SRC_URI_append = " file://71-fsl-dpaa-persistent-networking.rules"
+SRC_URI_append = " file://${@bb.utils.contains("TUNE_FEATURES", "e6500", \
+    "72-fsl-dpaa-persistent-networking.rules", "71-fsl-dpaa-persistent-networking.rules", d)}"
 
 do_install_append () {
     install -d ${D}${sysconfdir}/udev/rules.d/
-    install -m 0644 ${WORKDIR}/71-fsl-dpaa-persistent-networking.rules ${D}${sysconfdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/*-fsl-dpaa-persistent-networking.rules ${D}${sysconfdir}/udev/rules.d
 }