Skip to content
Snippets Groups Projects
Unverified Commit d7225ba7 authored by Florian Maurer's avatar Florian Maurer
Browse files

core: remove old migrations

v2023.2 did only support upgrades from v2022.x
we can therefore remove these old migrations for the next release
parent 5e1849e2
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
-- Migration from hwmode to band (OpenWrt 21.02)
-- Use uci:foreach(), as wireless.foreach_radio() depends on band already being set
uci:foreach('wireless', 'wifi-device', function(radio)
local radio_name = radio['.name']
local hwmode = radio.hwmode
if not radio.band then
if hwmode == '11g' or hwmode == '11ng' then
uci:set('wireless', radio_name, 'band', '2g')
elseif hwmode == '11a' or hwmode == '11na' then
uci:set('wireless', radio_name, 'band', '5g')
end
end
uci:delete('wireless', radio_name, 'hwmode')
end)
uci:save('wireless')
......@@ -12,27 +12,6 @@ local roles = {
}
roles.single = site.interfaces.single.default_roles({unpack(roles.wan)})
-- Migration of Mesh-on-WAN/LAN setting from Gluon 2021.1 and older (to be removed in 2024)
--
-- Wired meshing is enabled for single interfaces if either of the settings
-- was previously enabled
local mesh_lan_disabled = uci:get('network_gluon-old', 'mesh_lan', 'disabled')
local mesh_wan_disabled = uci:get('network_gluon-old', 'mesh_wan', 'disabled')
if mesh_wan_disabled == '0' then
util.add_to_set(roles.wan, 'mesh')
util.add_to_set(roles.single, 'mesh')
elseif mesh_wan_disabled == '1' then
util.remove_from_set(roles.wan, 'mesh')
util.remove_from_set(roles.single, 'mesh')
end
if mesh_lan_disabled == '0' then
util.add_to_set(roles.lan, 'mesh')
util.add_to_set(roles.single, 'mesh')
elseif mesh_lan_disabled == '1' then
util.remove_from_set(roles.lan, 'mesh')
util.remove_from_set(roles.single, 'mesh')
end
-- Migration of single to WAN/LAN or vice-versa (an interface was added or removed)
-- We identify the WAN with the single interface in this case
--
......
......@@ -5,18 +5,6 @@ local uci = require('simple-uci').cursor()
local preserve_channels = wireless.preserve_channels(uci)
-- Migrate preserve channels from pre-2022.01
local core_wireless = uci:get_first('gluon-core', 'wireless')
if core_wireless ~= nil then
local preserve_legacy = uci:get_bool('gluon-core', core_wireless, 'preserve_channels')
if preserve_legacy then
preserve_channels = true
end
uci:delete('gluon-core', core_wireless)
uci:save('gluon-core')
end
uci:section('gluon', 'wireless', 'wireless', {
preserve_channels = preserve_channels or false,
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment