summaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth
blob: 141aac8a6d7a911c6ac9c9af4721886089262bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
reorder_layerscape_interfaces() {
	if [ ! -f /tmp/sysinfo/board_name ]; then
		echo "No board name found, not doing reorder_layerscape_interfaces"
		return 0
	fi

	board=$(cat /tmp/sysinfo/board_name)
	case "$board" in
	"traverse,ls1043v" | \
	"traverse,ls1043s")

		# Reorder ethernet interfaces to match the physical order
		ip link set eth2 name fm1-mac3
		ip link set eth4 name eth2
		ip link set eth3 name fm1-mac4
		ip link set eth5 name eth3
		ip link set fm1-mac3 name eth4
		ip link set fm1-mac4 name eth5
		;;
	default)
		echo "Unknown board $board"
		;;
	esac
}

boot_hook_add preinit_main reorder_layerscape_interfaces