Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
184cb101
Unverified
Commit
184cb101
authored
8 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: add single_as_lan option to configure a single ethernet port as LAN instead of WAN
parent
e39cbcbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/gluon-core/check_site.lua
+1
-0
1 addition, 0 deletions
package/gluon-core/check_site.lua
package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
+18
-6
18 additions, 6 deletions
package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
with
19 additions
and
6 deletions
package/gluon-core/check_site.lua
+
1
−
0
View file @
184cb101
...
@@ -70,3 +70,4 @@ end
...
@@ -70,3 +70,4 @@ end
need_boolean
(
'mesh_on_wan'
,
false
)
need_boolean
(
'mesh_on_wan'
,
false
)
need_boolean
(
'mesh_on_lan'
,
false
)
need_boolean
(
'mesh_on_lan'
,
false
)
need_boolean
(
'single_as_lan'
,
false
)
This diff is collapsed.
Click to expand it.
package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
+
18
−
6
View file @
184cb101
...
@@ -10,17 +10,24 @@ end
...
@@ -10,17 +10,24 @@ end
local
util
=
require
'gluon.util'
local
util
=
require
'gluon.util'
local
platform
=
require
'gluon.platform'
local
platform
=
require
'gluon.platform'
local
site
=
require
'gluon.site_config'
local
uci
=
require
(
'simple-uci'
).
cursor
()
local
uci
=
require
(
'simple-uci'
).
cursor
()
local
function
iface_exists
(
name
)
local
function
iface_exists
(
ifaces
)
return
util
.
exec
(
'ip'
,
'link'
,
'show'
,
'dev'
,
(
name
:
gsub
(
'%..*$'
,
''
)))
==
0
if
not
ifaces
then
return
nil
end
for
iface
in
ifaces
:
gmatch
(
'%S+'
)
do
if
util
.
exec
(
'ip'
,
'link'
,
'show'
,
'dev'
,
(
iface
:
gsub
(
'%..*$'
,
''
)))
==
0
then
return
ifaces
end
end
end
end
local
lan_ifname
=
uci
:
get
(
'network'
,
'lan'
,
'ifname'
)
local
lan_ifname
=
iface_exists
(
uci
:
get
(
'network'
,
'lan'
,
'ifname'
)
)
local
wan_ifname
=
uci
:
get
(
'network'
,
'wan'
,
'ifname'
)
local
wan_ifname
=
iface_exists
(
uci
:
get
(
'network'
,
'wan'
,
'ifname'
)
)
if
platform
.
match
(
'ar71xx'
,
'generic'
,
{
if
platform
.
match
(
'ar71xx'
,
'generic'
,
{
'cpe210'
,
'cpe210'
,
...
@@ -36,11 +43,16 @@ if platform.match('ar71xx', 'generic', {
...
@@ -36,11 +43,16 @@ if platform.match('ar71xx', 'generic', {
lan_ifname
,
wan_ifname
=
wan_ifname
,
lan_ifname
lan_ifname
,
wan_ifname
=
wan_ifname
,
lan_ifname
end
end
if
wan_ifname
and
iface_exists
(
w
an_ifname
)
then
if
wan_ifname
and
l
an_ifname
then
sysconfig
.
wan_ifname
=
wan_ifname
sysconfig
.
wan_ifname
=
wan_ifname
sysconfig
.
lan_ifname
=
lan_ifname
sysconfig
.
lan_ifname
=
lan_ifname
else
else
sysconfig
.
wan_ifname
=
lan_ifname
local
single_ifname
=
lan_ifname
or
wan_ifname
if
site
.
single_as_lan
then
sysconfig
.
lan_ifname
=
single_ifname
else
sysconfig
.
wan_ifname
=
single_ifname
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