2
0
forked from Ivasoft/openwrt

ramips: TP-Link EC330-G5u v1: switch to mac-address-ascii

The TP-Link EC330-G5u v1 router has MAC address that stored in factory mtd
in ascii format. This commit makes the router use of "mac-address-ascii"
in dts.

After the change:
1. All MAC addresses are explicitly assigned in dts (the workarounds in
   network scripts are no longer needed);
2. gmac0 (eth0) MAC address is no longer random.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
This commit is contained in:
Mikhail Zhilkin
2023-04-22 06:58:01 +00:00
committed by Hauke Mehrtens
parent c31319b669
commit 15e21d373b
3 changed files with 26 additions and 10 deletions

View File

@@ -161,11 +161,6 @@ case "$board" in
hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"
macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress"
;;
tplink,ec330-g5u-v1)
hw_mac_addr="$(mtd_get_mac_text factory 0x165)"
[ "$PHYNBR" = "0" ] && echo -n $hw_mac_addr > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
;;
yuncore,ax820)
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress