Skip to content
Snippets Groups Projects
Unverified Commit 0c5b5373 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: primary-mac: load board.json only once

parent c90b400c
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,8 @@ local json = require 'jsonc'
local platform = require 'gluon.platform'
local util = require 'gluon.util'
local board_data = json.load('/etc/board.json')
local network_data = (board_data or {}).network
local function sysfs(...)
local path = string.format(...)
......@@ -33,9 +35,9 @@ end
local function board(iface)
return function()
local data = json.load('/etc/board.json')
if data and data.network and data.network[iface] then
return data.network[iface].macaddr
local ifdata = network_data[iface] or {}
if ifdata.macaddr then
return ifdata.macaddr
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment