diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
index 0d17338ebbf20126134f3773b359f71eb958d299..b1e32b0931195f6ece4e989d0082124a8ce1ceb3 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
@@ -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