diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-12-08 13:42:39 +0100 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-12-12 13:11:28 +0100 |
commit | ed975a58e43db95748e3a23039d84a50f79712e0 (patch) | |
tree | 7acf99dc683397461c5849f1e4d134fb00dbf706 /target | |
parent | 98d9158d2f671ea4724252b08f9cdc5c5e47f286 (diff) | |
download | upstream-ed975a58e43db95748e3a23039d84a50f79712e0.tar.gz upstream-ed975a58e43db95748e3a23039d84a50f79712e0.tar.bz2 upstream-ed975a58e43db95748e3a23039d84a50f79712e0.zip |
ramips: mt7621: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.
The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target')
-rwxr-xr-x | target/linux/ramips/mt7621/base-files/etc/board.d/02_network | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index e7e225a148..2828cf67dc 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -147,30 +147,21 @@ ramips_setup_macs() local label_mac="" case $board in - adslr,g7|\ + adslr,g7) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe00c)" 1) + ;; afoundry,ew1200|\ asiarf,ap7621-001|\ asiarf,ap7621-nv1|\ firefly,firewrt|\ gehua,ghl-r-001|\ - mediatek,ap-mt7621a-v60|\ - mikrotik,rb750gr3|\ - mikrotik,rbm33g|\ mqmaker,witi|\ - mtc,wr1201|\ - netgear,r6220|\ - netgear,wndr3700-v5|\ - storylink,sap-g3200u3|\ - telco-electronics,x1|\ totolink,a7000r|\ - ubiquiti,edgerouterx|\ - ubiquiti,edgerouterx-sfp|\ unielec,u7621-06-16m|\ unielec,u7621-06-64m|\ - xiaoyu,xy-c5|\ xzwifi,creativebox-v1|\ zbtlink,zbt-wg2626) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1) ;; alfa-network,quad-e4g|\ asus,rt-ac57u|\ @@ -215,17 +206,36 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) ;; iodata,wn-ax1167gr|\ - iodata,wn-gx300gr) + iodata,wn-gx300gr|\ + mtc,wr1201|\ + netgear,r6220|\ + netgear,wndr3700-v5|\ + xiaoyu,xy-c5) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) ;; iodata,wnpr2600g) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; + mediatek,ap-mt7621a-v60) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x5)" 1) + ;; + mikrotik,rb750gr3|\ + mikrotik,rbm33g) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary hard_config 0x10)" 2) + ;; netgear,r6260|\ netgear,r6350|\ netgear,r6850) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2) + ;; + storylink,sap-g3200u3|\ + telco-electronics,x1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe006)" 1) + ;; + ubiquiti,edgerouterx|\ + ubiquiti,edgerouterx-sfp) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x22)" 1) ;; wevo,11acnas|\ wevo,w2914ns-v2) @@ -249,7 +259,7 @@ ramips_setup_macs() ;; zbtlink,zbt-wg3526-16m|\ zbtlink,zbt-wg3526-32m) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1) label_mac=$(mtd_get_mac_binary factory 0x4) ;; esac |