Christian Marangi <[email protected]> writes:
> On Sat, Jan 07, 2023 at 01:05:42PM +0100, Rafał Miłecki wrote:
>> From: Rafał Miłecki <[email protected]>
>>
>> This reverts commit cd39aba402ea7e7a11e173b0b5aa96e42bf1f2ac.
>>
>> Adding "mac-address" property to the device tree seems to be done to
>> allow reading it using procfs (/proc/device-tree/). It seems like a hack
>> without a proper explanation WHY do we need that.
>>
>> Reading MAC address can be done other ways including fs based:
>> cat /sys/class/net/<foo>/address
>>
>> Cc: David Bauer <[email protected]>
>> Signed-off-by: Rafał Miłecki <[email protected]>
>> ---
>> David, everyone,
>>
>> it seems this patch never ended up being sent upstream and it sits in
>> our tree without actual explanation why do we need that.
>>
>> I was wondering if we can just drop it?
>
> I remember me dropping the patch when nvmem was introduced but that
> caused some regression as some script still used the procfs way... we
> should find and fix the affected script before dropping this.
>
> (hoping a simple grep is enough)
From package/base-files/files/lib/functions/system.sh:
get_mac_label_dt() {
local basepath="/proc/device-tree"
local macdevice="$(cat "$basepath/aliases/label-mac-device"
2>/dev/null)"
local macaddr
[ -n "$macdevice" ] || return
macaddr=$(get_mac_binary "$basepath/$macdevice/mac-address" 0
2>/dev/null)
[ -n "$macaddr" ] || macaddr=$(get_mac_binary
"$basepath/$macdevice/local-mac-address" 0 2>/dev/null)
echo $macaddr
}
Bjørn
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel