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
0c5b5373
Unverified
Commit
0c5b5373
authored
4 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: primary-mac: load board.json only once
parent
c90b400c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+5
-3
5 additions, 3 deletions
package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
with
5 additions
and
3 deletions
package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
+
5
−
3
View file @
0c5b5373
...
...
@@ -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
if
data
=
network_data
[
iface
]
or
{}
if
if
data
.
macaddr
then
return
if
data
.
macaddr
end
end
end
...
...
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