mvebu: add support for the Linksys WRT1900ACS (Shelby)
[openwrt/svn-archive/archive.git] / target / linux / mvebu / base-files / lib / preinit / 06_set_iface_mac
1 #
2 # Copyright (C) 2014-2015 OpenWrt.org
3 #
4
5 preinit_set_mac_address() {
6 local mac
7
8 . /lib/functions.sh
9 . /lib/mvebu.sh
10
11 case $(mvebu_board_name) in
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
16 ;;
17 armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby)
18 mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
19 mac_wan=$(macaddr_setbit_la "$mac")
20 ifconfig eth1 hw ether $mac 2>/dev/null
21 ifconfig eth0 hw ether $mac_wan 2>/dev/null
22 ;;
23 esac
24 }
25
26 boot_hook_add preinit_main preinit_set_mac_address