Patchwork [meta-fsl-ppc,v4,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:30 a.m.
Message ID <1362799812-16444-9-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/45781/
State Changes Requested
Delegated to: Otavio Salvador
Headers show

Comments

Ting Liu - March 9, 2013, 3:30 a.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      |    8 +++---
 2 files changed, 25 insertions(+), 4 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 f3ddb8e..f938e92 100644
--- a/recipes-core/udev/udev-extraconf_1.0.bbappend
+++ b/recipes-core/udev/udev-extraconf_1.0.bbappend
@@ -1,11 +1,11 @@ 
 FILESEXTRAPATHS_prepend := "${THISDIR}/udev-extraconf:"
+PRINC := "${@int(PRINC) + 2}"
 
-PRINC := "${@int(PRINC) + 1}"
-
-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
 }