From d8b944ea954e1169dcdc183232b5595be4221803 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Mon, 9 Mar 2020 18:30:20 +0100 Subject: [PATCH 1/2] lantiq-xway: add support for NETGEAR DGN3500B --- docs/user/supported_devices.rst | 4 ++++ targets/lantiq-xway | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 88b3f7cb..a885d74f 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -274,6 +274,10 @@ lantiq-xway - FRITZ!Box 7330 [#avmflash]_ [#lan_as_wan]_ - FRITZ!Box 7330 SL [#avmflash]_ [#lan_as_wan]_ +* NETGEAR + + - DGN3500B [#lan_as_wan]_ + mpc85xx-generic --------------- diff --git a/targets/lantiq-xway b/targets/lantiq-xway index 7810df9f..e4b6874a 100644 --- a/targets/lantiq-xway +++ b/targets/lantiq-xway @@ -6,3 +6,7 @@ device('avm-fritz-box-7320', 'avm_fritz7320', { factory = false, aliases = {'avm-fritz-box-7330', 'avm-fritz-box-7330-sl'}, }) + +device('netgear-dgn3500b', 'netgear_dgn3500b', { + factory_ext = '.img', +}) From 3bd67ab25fa5b1c14aa84cbde120cdabecc4bb51 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 12 Mar 2020 00:41:06 +0100 Subject: [PATCH 2/2] gluon-core: retrieve primary MAC address from board.json for Netgear DGN3500B --- .../luasrc/lib/gluon/upgrade/010-primary-mac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 7fce9014..2a5bc2c7 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -8,6 +8,7 @@ if sysconfig.primary_mac then end +local json = require 'jsonc' local platform = require 'gluon.platform' local util = require 'gluon.util' @@ -30,6 +31,15 @@ local function phy(index) return sysfs('/sys/class/ieee80211/phy%d/macaddress', index) 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 + end + end +end + -- Entries are matched in the order they are listed local primary_addrs = { @@ -111,6 +121,11 @@ local primary_addrs = { 'dir-860l-b1', }}, }}, + {board('lan'), { + {'lantiq', 'xway', { + 'netgear,dgn3500b', + }}, + }}, -- phy0 default {phy(0), { {}, -- matches everything