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

gluon-core: get LAN and WAN interfaces from board.json

Instead of looking at the initial UCI config, we can read this
information from board.json.
parent 2891454f
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,12 @@ end ...@@ -11,9 +11,12 @@ end
local platform = require 'gluon.platform' local platform = require 'gluon.platform'
local site = require 'gluon.site' local site = require 'gluon.site'
local json = require 'jsonc'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local unistd = require 'posix.unistd' local unistd = require 'posix.unistd'
local board_data = json.load('/etc/board.json')
local network_data = (board_data or {}).network
local function iface_exists(ifaces) local function iface_exists(ifaces)
if not ifaces then return nil end if not ifaces then return nil end
...@@ -26,8 +29,8 @@ local function iface_exists(ifaces) ...@@ -26,8 +29,8 @@ local function iface_exists(ifaces)
end end
local lan_ifname = iface_exists(uci:get('network', 'lan', 'ifname')) local lan_ifname = iface_exists((network_data.lan or {}).ifname)
local wan_ifname = iface_exists(uci:get('network', 'wan', 'ifname')) local wan_ifname = iface_exists((network_data.wan or {}).ifname)
if platform.match('ar71xx', 'generic', { if platform.match('ar71xx', 'generic', {
'cpe210', 'cpe210',
......
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