gluon-core: split dual lan devices

This commit is contained in:
aiyion.prime 2022-06-15 18:12:07 +02:00
parent 01a0e42a72
commit 8ee1d44567
3 changed files with 33 additions and 0 deletions

View File

@ -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 {}

View 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')

View File

@ -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