layerscape: add Traverse LS1043-S support
[openwrt/openwrt.git] / target / linux / layerscape / base-files / lib / preinit / 05_layerscape_reorder_eth
1 #!/bin/sh
2
3 reorder_layerscape_interfaces() {
4 if [ ! -f /tmp/sysinfo/board_name ]; then
5 echo "No board name found, not doing reorder_layerscape_interfaces"
6 return 0
7 fi
8
9 board=$(cat /tmp/sysinfo/board_name)
10 case "$board" in
11 "traverse,ls1043v" | \
12 "traverse,ls1043s")
13
14 # Reorder ethernet interfaces to match the physical order
15 ip link set eth2 name fm1-mac3
16 ip link set eth4 name eth2
17 ip link set eth3 name fm1-mac4
18 ip link set eth5 name eth3
19 ip link set fm1-mac3 name eth4
20 ip link set fm1-mac4 name eth5
21 ;;
22 default)
23 echo "Unknown board $board"
24 ;;
25 esac
26 }
27
28 boot_hook_add preinit_main reorder_layerscape_interfaces