diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-08-15 15:13:27 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-09-19 23:43:27 +0200 |
commit | 469e347f19ce9eefdc16f421b8e1f18ed60c310c (patch) | |
tree | c470df73ff45a454e9c3f37ecc53fce8c55ffb77 /package/base-files/files/bin | |
parent | 0340718863040919ecaba74b2173ed52ebc194ce (diff) | |
download | upstream-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/bin')
-rwxr-xr-x | package/base-files/files/bin/config_generate | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 3ca035ca8b..0b26afe57f 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -260,6 +260,11 @@ generate_static_system() { uci -q set "system.@system[-1].hostname=$hostname" fi + local label_macaddr + if json_get_var label_macaddr label_macaddr; then + uci -q set "system.@system[-1].label_macaddr=$label_macaddr" + fi + if json_is_a ntpserver array; then local keys key json_get_keys keys ntpserver |