ramips: fix reading mac address for hiwifi hc5962
authorTianling Shen <[email protected]>
Sun, 2 Mar 2025 12:06:49 +0000 (20:06 +0800)
committerHauke Mehrtens <[email protected]>
Mon, 17 Mar 2025 15:21:23 +0000 (16:21 +0100)
The spaces in variables have been stripped since commit 551e04f3c9c0
("base-files: strip space and tab characters from ASCII mac address"),
resulting "Vfac_mac " matches nothing. Fix the issue by removing the
space at end.

Signed-off-by: Tianling Shen <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18150
Signed-off-by: Hauke Mehrtens <[email protected]>
(cherry picked from commit 2091c29578ca99b468e79695149be6f4b6cccb36)

target/linux/ramips/mt7621/base-files/etc/board.d/02_network
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

index 8d94cd592d6e2f210e1e2f34df5df80f2b2c79e2..2374d5f60a28be0fbbd81d0f2382f7b538f4a145 100644 (file)
@@ -266,7 +266,7 @@ ramips_setup_macs()
                wan_mac=$label_mac
                ;;
        hiwifi,hc5962)
-               lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+               lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
                label_mac=$lan_mac
                [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
                wan_mac=$(macaddr_add "$lan_mac" 1)
index 4a056623abc021b006413bbd0ad1abb501c5b677..05e4ebe99ae04c9bc74c31148d56d5940189905e 100644 (file)
@@ -103,7 +103,7 @@ case "$board" in
                        macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress
                ;;
        hiwifi,hc5962)
-               label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+               label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
                [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
                echo -n "$label_mac" > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \