You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth

29 lines
642 B
Bash

#!/bin/sh
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