aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions/uci-defaults.sh
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-08-15 15:13:27 +0200
committerPetr Štetiar <ynezz@true.cz>2019-09-19 23:43:27 +0200
commit469e347f19ce9eefdc16f421b8e1f18ed60c310c (patch)
treec470df73ff45a454e9c3f37ecc53fce8c55ffb77 /package/base-files/files/lib/functions/uci-defaults.sh
parent0340718863040919ecaba74b2173ed52ebc194ce (diff)
downloadupstream-469e347f19ce9eefdc16f421b8e1f18ed60c310c.tar.gz
upstream-469e347f19ce9eefdc16f421b8e1f18ed60c310c.tar.bz2
upstream-469e347f19ce9eefdc16f421b8e1f18ed60c310c.zip
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>
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 2fb7555969..c2c6dc3fdc 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -307,6 +307,14 @@ ucidef_set_interface_macaddr() {
ucidef_set_interface "$network" macaddr "$macaddr"
}
+ucidef_set_label_macaddr() {
+ local macaddr="$1"
+
+ json_select_object system
+ json_add_string label_macaddr "$macaddr"
+ json_select ..
+}
+
ucidef_add_atm_bridge() {
local vpi="$1"
local vci="$2"