Merge pull request #2548 from AiyionPrime/ath79-lan-split

gluon-core: split dual lan devices
This commit is contained in:
David Bauer 2022-06-25 18:06:46 +02:00 committed by GitHub
commit ef3e195340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -57,6 +57,10 @@ elseif platform.match('ath79', 'generic', {
}) then
-- Temporary solution to separate interfaces in bridged default setup
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
local switch_data = board_data.switch 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
platform.match('ath79', 'generic', {
'ubnt,unifi-ap-pro',
'ubnt,unifiac-pro',
})
then
sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.wan_ifname