Merge pull request #2364 from freifunk-gluon/migration-cleanup

Clean up obsolete upgrade migrations
This commit is contained in:
David Bauer 2022-01-01 18:20:42 +01:00 committed by GitHub
commit 0d0801da99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1 additions and 61 deletions

View File

@ -1,10 +0,0 @@
#!/usr/bin/lua
local sysconfig = require 'gluon.sysconfig'
local unistd = require 'posix.unistd'
if unistd.access('/lib/gluon/version/core') and not sysconfig.gluon_version then
-- This isn't an initial upgrade, so set gluon_version
sysconfig.gluon_version = ''
end

View File

@ -22,8 +22,4 @@ if uci:get('network', 'mesh_wan', 'transitive') == nil then
uci:set('network', 'mesh_wan', 'transitive', true) uci:set('network', 'mesh_wan', 'transitive', true)
end end
uci:delete('network', 'mesh_wan', 'auto')
uci:delete('network', 'mesh_wan', 'fixed_mtu')
uci:delete('network', 'mesh_wan', 'legacy')
uci:save('network') uci:save('network')

View File

@ -50,8 +50,4 @@ if uci:get('network', 'mesh_lan', 'transitive') == nil then
uci:set('network', 'mesh_lan', 'transitive', true) uci:set('network', 'mesh_lan', 'transitive', true)
end end
uci:delete('network', 'mesh_lan', 'auto')
uci:delete('network', 'mesh_lan', 'fixed_mtu')
uci:delete('network', 'mesh_lan', 'legacy')
uci:save('network') uci:save('network')

View File

@ -1,24 +0,0 @@
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
local function migrate_iface(iface)
if iface.proto ~= 'batadv' or iface.mesh ~= 'bat0' then
return
end
local s = iface['.name']
uci:set('network', s, 'proto', 'gluon_mesh')
uci:set('network', s, 'fixed_mtu', true)
if iface.mesh_no_rebroadcast then
uci:set('network', s, 'transitive', iface.mesh_no_rebroadcast)
end
uci:delete('network', s, 'mesh')
uci:delete('network', s, 'mesh_no_rebroadcast')
end
uci:foreach('network', 'interface', migrate_iface)
uci:save('network')

View File

@ -1,7 +0,0 @@
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
uci:delete('network', 'l3roam')
uci:delete('network', 'l3roamd_client')
uci:save('network')

View File

@ -6,14 +6,10 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local gw_mode = uci:get('network', 'gluon_bat0', 'gw_mode') or uci:get('network', 'bat0', 'gw_mode') or 'client'
uci:delete('batman-adv-legacy', 'bat0')
uci:save('batman-adv-legacy')
uci:delete('batman-adv', 'bat0') uci:delete('batman-adv', 'bat0')
uci:save('batman-adv') uci:save('batman-adv')
local gw_mode = uci:get('network', 'gluon_bat0', 'gw_mode') or 'client'
uci:delete('network', 'gluon_bat0') uci:delete('network', 'gluon_bat0')
uci:section('network', 'interface', 'gluon_bat0', { uci:section('network', 'interface', 'gluon_bat0', {
proto = 'gluon_bat0', proto = 'gluon_bat0',

View File

@ -21,10 +21,6 @@ uci:section('network', 'interface', 'client', {
query_response_interval = 500, query_response_interval = 500,
}) })
uci:delete('network', 'client_lan')
uci:delete('network', 'local_node_route')
uci:delete('network', 'local_node_route6') uci:delete('network', 'local_node_route6')
uci:section('network', 'route6', 'local_node_route6', { uci:section('network', 'route6', 'local_node_route6', {
interface = 'client', interface = 'client',
@ -42,6 +38,4 @@ networks = uci:get_list('firewall', 'drop', 'network')
util.remove_from_set(networks, 'client') util.remove_from_set(networks, 'client')
uci:set_list('firewall', 'drop', 'network', networks) uci:set_list('firewall', 'drop', 'network', networks)
uci:delete('firewall', 'local_node_dns')
uci:save('firewall') uci:save('firewall')

View File

@ -46,7 +46,6 @@ uci:section('fastd', 'fastd', 'mesh_vpn', {
packet_mark = 1, packet_mark = 1,
status_socket = '/var/run/fastd.mesh_vpn.socket', status_socket = '/var/run/fastd.mesh_vpn.socket',
}) })
uci:delete('fastd', 'mesh_vpn', 'user')
-- Collect list of groups that have peers with 'preserve' flag -- Collect list of groups that have peers with 'preserve' flag