From 1db37211ca9115fedb84e5e680dd3ee90e010069 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Fri, 27 Dec 2024 01:43:50 +0100 Subject: [PATCH] core: remove old migrations v2023.2 did only support upgrades from v2022.x we can therefore remove these old migrations for the next release --- .../lib/gluon/upgrade/005-wireless-migration | 20 ---------------- .../lib/gluon/upgrade/021-interface-roles | 21 ----------------- .../upgrade/190-preserve-wireless-channels | 23 ------------------- .../luasrc/lib/gluon/upgrade/200-wireless | 6 ----- 4 files changed, 70 deletions(-) delete mode 100755 package/gluon-core/luasrc/lib/gluon/upgrade/005-wireless-migration delete mode 100755 package/gluon-core/luasrc/lib/gluon/upgrade/190-preserve-wireless-channels diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/005-wireless-migration b/package/gluon-core/luasrc/lib/gluon/upgrade/005-wireless-migration deleted file mode 100755 index fc79249bd0..0000000000 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/005-wireless-migration +++ /dev/null @@ -1,20 +0,0 @@ -#!/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') diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles b/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles index 3040341155..08dd778480 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles @@ -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 -- diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/190-preserve-wireless-channels b/package/gluon-core/luasrc/lib/gluon/upgrade/190-preserve-wireless-channels deleted file mode 100755 index ee25c13087..0000000000 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/190-preserve-wireless-channels +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/lua - -local wireless = require 'gluon.wireless' -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, -}) -uci:save('gluon') diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless index 9550a887d3..6ca8462816 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless @@ -1,6 +1,5 @@ #!/usr/bin/lua -local util = require 'gluon.util' local wireless = require 'gluon.wireless' local site = require 'gluon.site' local sysconfig = require 'gluon.sysconfig' @@ -222,11 +221,6 @@ wireless.foreach_radio(uci, function(radio, index, config) uci:set('wireless', radio_name, 'legacy_rates', false) configure_mesh_wireless(radio, index, config) elseif (band == '5g') then - -- ToDo: Remove in v2024.x - local hostapd_options = uci:get_list('wireless', radio_name, 'hostapd_options') - util.remove_from_set(hostapd_options, 'country3=0x4f') - uci:set_list('wireless', radio_name, 'hostapd_options', hostapd_options) - if is_outdoor() then -- enforce outdoor channels by filtering the regdom for outdoor channels uci:set('wireless', radio_name, 'country3', '0x4f')