2 # Copyright (C) 2014-2015 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.org
6 preinit_set_mac_address() {
12 armada-xp-linksys-mamba)
13 mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
14 ifconfig eth0 hw ether $mac 2>/dev/null
15 ifconfig eth1 hw ether $mac 2>/dev/null
17 armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby)
18 # rename interfaces back to the way they were with 4.4
19 case "$(readlink /sys/class/net/eth0)" in
21 ip link set eth0 name tmp0
22 ip link set eth1 name eth0
23 ip link set tmp0 name eth1
27 mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
28 mac_wan=$(macaddr_setbit_la "$mac")
29 ifconfig eth1 hw ether $mac 2>/dev/null
30 ifconfig eth0 hw ether $mac_wan 2>/dev/null
32 armada-385-db-ap|armada-388-clearfog)
33 # rename interfaces back to the way they were with 4.4
34 case "$(readlink /sys/class/net/eth0)" in
36 ip link set eth0 name tmp0
37 ip link set eth1 name eth0
38 ip link set eth2 name eth1
39 ip link set tmp0 name eth2
46 boot_hook_add preinit_main preinit_set_mac_address