Browse Source

ath79: read label MAC address from flash instead of using phy0/phy1

This replaces all uses of $(cat /sys/class/ieee80211/phyX/macaddress)
by retrieval from the proper flash locations. This will make
02_network independent of WiFi setup again.

For future reference:

The MAC addresses of the FRITZ!WLAN Repeater 300E can be extracted
from the urlader key value store:

maca        *:6B
macb        *:6C
macwlan     *:6D
macdsl      *:6E

and be set by e.g.
addr=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))

Signed-off-by: Adrian Schmutzler <[email protected]>
Adrian Schmutzler 6 years ago
parent
commit
d421a8b944
1 changed files with 2 additions and 2 deletions
  1. 2 2
      target/linux/ath79/generic/base-files/etc/board.d/02_network

+ 2 - 2
target/linux/ath79/generic/base-files/etc/board.d/02_network

@@ -292,11 +292,11 @@ ath79_setup_macs()
 	ubnt,nanostation-m|\
 	ubnt,rocket-m|\
 	ubnt,unifi)
-		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+		label_mac=$(mtd_get_mac_binary art 0x1002)
 		;;
 	avm,fritz300e)
 		lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
-		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+		label_mac=$(fritz_tffs -n macwlan -i $(find_mtd_part "tffs (1)"))
 		;;
 	avm,fritz4020)
 		lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))