gluon-core: split dual lan devices
This commit is contained in:
parent
01a0e42a72
commit
8ee1d44567
@ -57,6 +57,10 @@ elseif platform.match('ath79', 'generic', {
|
|||||||
}) then
|
}) then
|
||||||
-- Temporary solution to separate interfaces in bridged default setup
|
-- Temporary solution to separate interfaces in bridged default setup
|
||||||
lan_ifname, wan_ifname = 'eth0', 'eth1'
|
lan_ifname, wan_ifname = 'eth0', 'eth1'
|
||||||
|
elseif platform.match('ath79', 'generic', {
|
||||||
|
'ubnt,unifiac-pro',
|
||||||
|
}) then
|
||||||
|
lan_ifname, wan_ifname = 'eth0.2', 'eth0.1'
|
||||||
elseif platform.match('lantiq') then
|
elseif platform.match('lantiq') then
|
||||||
local switch_data = board_data.switch or {}
|
local switch_data = board_data.switch or {}
|
||||||
local switch0_data = switch_data.switch0 or {}
|
local switch0_data = switch_data.switch0 or {}
|
||||||
|
28
package/gluon-core/luasrc/lib/gluon/upgrade/115-swconfig
Executable file
28
package/gluon-core/luasrc/lib/gluon/upgrade/115-swconfig
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local platform = require 'gluon.platform'
|
||||||
|
local uci = require('simple-uci').cursor()
|
||||||
|
|
||||||
|
local switch_vlans = {
|
||||||
|
-- device identifier, lan ports, wan ports
|
||||||
|
["ubnt,unifiac-pro"] = {"2 0t", "3 0t"},
|
||||||
|
}
|
||||||
|
|
||||||
|
local board_name = platform.get_board_name()
|
||||||
|
local assignments = switch_vlans[board_name]
|
||||||
|
|
||||||
|
if not platform.match('ath79', 'generic') or not assignments then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
uci:delete_all('network', 'switch_vlan')
|
||||||
|
|
||||||
|
for vlan, ports in ipairs(assignments) do
|
||||||
|
uci:section("network", "switch_vlan", nil, {
|
||||||
|
device = "switch0",
|
||||||
|
vlan = vlan,
|
||||||
|
ports = ports,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
uci:save('network')
|
@ -6,6 +6,7 @@ local sysconfig = require 'gluon.sysconfig'
|
|||||||
if platform.is_outdoor_device() or
|
if platform.is_outdoor_device() or
|
||||||
platform.match('ath79', 'generic', {
|
platform.match('ath79', 'generic', {
|
||||||
'ubnt,unifi-ap-pro',
|
'ubnt,unifi-ap-pro',
|
||||||
|
'ubnt,unifiac-pro',
|
||||||
})
|
})
|
||||||
then
|
then
|
||||||
sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.wan_ifname
|
sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.wan_ifname
|
||||||
|
Loading…
Reference in New Issue
Block a user