Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
3bd67ab2
Commit
3bd67ab2
authored
5 years ago
by
Matthias Schiffer
Committed by
Andreas Ziegler
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: retrieve primary MAC address from board.json for Netgear DGN3500B
parent
d8b944ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
+15
-0
15 additions, 0 deletions
package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
with
15 additions
and
0 deletions
package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
+
15
−
0
View file @
3bd67ab2
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment