base-files: provide option to specify label MAC address in board.d
For many devices, MAC addresses cannot be retrieved via the device tree alias. To still provide the label MAC address for those, this implements a second mechanism that will put the address into uci config. Note that this stores the actual MAC address, whereas in DTS we reference the bearing device. This is based on the work of Rosy Song <rosysong@rosinson.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
committed by
Petr Štetiar
parent
0340718863
commit
469e347f19
@@ -19,6 +19,7 @@ get_mac_label() {
|
||||
|
||||
[ -n "$macdevice" ] && 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)
|
||||
[ -n "$macaddr" ] || macaddr=$(uci -q get system.@system[0].label_macaddr)
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user