ath79: fortinet-fap-221-b: convert to nvmem-layout
[openwrt/staging/wigyori.git] / target / linux / ath79 / generic / base-files / lib / preinit / 10_fix_eth_mac.sh
index d9cb8d2b82e94bd31c73450048de1996dfcfbf9d..76f4b93a3560f26ea70d8d54c7c7cf3aee001c28 100644 (file)
@@ -1,4 +1,4 @@
-. /lib/functions.sh
+. /lib/functions/system.sh
 
 preinit_set_mac_address() {
        case $(board_name) in
@@ -12,6 +12,12 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
                ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
                ;;
+       engenius,epg5000|\
+       engenius,esr1200|\
+       engenius,esr1750|\
+       engenius,esr900)
+               ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
+               ;;
        enterasys,ws-ap3705i)
                ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env0 ethaddr)
                ;;
@@ -19,6 +25,13 @@ preinit_set_mac_address() {
        siemens,ws-ap3610)
                ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
                ;;
+       moxa,awk-1137c)
+               ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env mac_addr)
+               ;;
+       tplink,deco-s4-v2)
+               base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
+               ip link set dev eth0 address $base_mac
+               ;;
        zyxel,nbg6616)
                ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
                ip link set dev eth0 address $(macaddr_add $ethaddr 2)