[LEDE-DEV] ar71xx: Need advice on parsing specific board config data on TP-Link TL-WR942N

Chuanhong Guo gch981213 at gmail.com
Wed Feb 22 02:11:09 PST 2017


The mac address is saved at 0xe40000 of the flash and you can write a
function similar to ath79_nvram_parse_mac_addr which is defined in
target/linux/ar71xx/files/arch/mips/ath79/nvram.c
BTW this function is used by WD My Net N750:
https://github.com/lede-project/source/blob/master/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c#L152

it seems that it's OK to use sscanf(addr,
"%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx") :-)

this can also be done at userspace but in this way you need to load
ART and modify the mac address by the firmware hotplug script like
what Netgear WNDR4300 have done.

Regards
Chuanhong Guo

2017-02-22 4:47 GMT+08:00 Sergey Studzinski <serguzhg at gmail.com>:
>>> Most work is already done against 17.01-rc2 and there is working
>>> factory and sysupgrade images.
>>
>>Please, base your work on master branch.
>
> Most work was done against master but later backported to rc2 in
> terms of stability in packages. It is not a problem to revert it
> back to master.
>
>>Just checking, have you tried to look for MAC in binary format in
>>whole flash dump?
>
> There is definitely no other place with valid MAC elsewhere in flash.
> MAC in ART is fake one like 000203040506. As seen in bootlogs factory
> firmware starts with random MACs and then use special init script and
> nvrammanager binary utility to parse data from partition default-mac.
> Can look at fullflash here http://fex.net/get/227411653165/2400918
>
>>[1] https://github.com/lede-project/source/blob/master/package/base-files/files/lib/functions/system.sh#L11
>>[2] https://github.com/lede-project/source/blob/master/target/linux/ar71xx/base-files/etc/board.d/02_network#L483
>
> Will look at it. Thank you.
> Sergey
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list