Merge pull request #2382 from freifunk-gluon/cleanup

Removal of more obsolete migrations, minor cleanup and improvements to lsupgrade.sh
This commit is contained in:
Matthias Schiffer 2022-02-01 23:31:41 +01:00 committed by GitHub
commit 1041014cf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 71 deletions

View File

@ -28,7 +28,7 @@ fi
pushd "$(dirname "$0")/.." >/dev/null pushd "$(dirname "$0")/.." >/dev/null
find ./package packages -name Makefile | while read -r makefile; do find ./package packages -name Makefile | grep -v '^packages/packages/' | while read -r makefile; do
dir="$(dirname "$makefile")" dir="$(dirname "$makefile")"
pushd "$dir" >/dev/null pushd "$dir" >/dev/null
@ -37,13 +37,12 @@ find ./package packages -name Makefile | while read -r makefile; do
dirname="$(dirname "$dir" | cut -d/ -f 3-)" dirname="$(dirname "$dir" | cut -d/ -f 3-)"
package="$(basename "$dir")" package="$(basename "$dir")"
for file in "${SUFFIX1}"/*; do for file in "${SUFFIX1}"/* "${SUFFIX2}"/*; do
echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX1})" basename="$(basename "${file}")"
done suffix="$(dirname "${file}")"
for file in "${SUFFIX2}"/*; do printf "%s\t%s\n" "${basename}" "${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${suffix}/${GREEN}${basename}${RESET}"
echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX2})"
done done
popd >/dev/null popd >/dev/null
done | sort done | sort | cut -f2-
popd >/dev/null popd >/dev/null

View File

@ -31,7 +31,6 @@ endef
define Package/gluon-core/conffiles define Package/gluon-core/conffiles
/etc/config/gluon /etc/config/gluon
/etc/config/gluon-core
endef endef
define Package/gluon-core/install define Package/gluon-core/install

View File

@ -1 +0,0 @@
config wireless

View File

@ -123,7 +123,7 @@ function M.foreach_radio(uci, f)
end end
function M.preserve_channels(uci) function M.preserve_channels(uci)
return uci:get_first('gluon-core', 'wireless', 'preserve_channels') return uci:get('gluon', 'wireless', 'preserve_channels')
end end
function M.device_supports_wpa3() function M.device_supports_wpa3()

View File

@ -9,6 +9,11 @@ local uci = require('simple-uci').cursor()
local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose' local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose'
local secret = uci:get('fastd', 'mesh_vpn', 'secret')
if not secret or not secret:match(('%x'):rep(64)) then
secret = 'generate'
end
local methods local methods
if site.mesh_vpn.fastd.configurable(false) then if site.mesh_vpn.fastd.configurable(false) then
@ -38,6 +43,7 @@ end
uci:section('fastd', 'fastd', 'mesh_vpn', { uci:section('fastd', 'fastd', 'mesh_vpn', {
group = 'gluon-mesh-vpn', group = 'gluon-mesh-vpn',
syslog_level = syslog_level, syslog_level = syslog_level,
secret = secret,
interface = vpn_core.get_interface(), interface = vpn_core.get_interface(),
mode = 'tap', mode = 'tap',
mtu = site.mesh_vpn.mtu(), mtu = site.mesh_vpn.mtu(),

View File

@ -1,12 +0,0 @@
#!/usr/bin/lua
local uci = require 'simple-uci'
local c = uci.cursor()
local secret = c:get("fastd", "mesh_vpn", "secret")
if not secret or not secret:match(("%x"):rep(64)) then
c:set("fastd", "mesh_vpn", "secret", "generate")
c:save("fastd")
end

View File

@ -7,22 +7,7 @@ local vpn_core = require 'gluon.mesh-vpn'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local enabled
-- Delete old broker config section (remove in 2019)
if not uci:get('tunneldigger', 'mesh_vpn') then
if uci:get_first('tunneldigger', 'broker', 'interface') == 'mesh-vpn' then
enabled = uci:get_first('tunneldigger', 'broker', 'enabled')
end
-- In the usual case (no migration from old tunneldigger package), the
-- enabled state is set in the 500-mesh-vpn script
uci:delete_all('tunneldigger', 'broker')
end
uci:section('tunneldigger', 'broker', 'mesh_vpn', { uci:section('tunneldigger', 'broker', 'mesh_vpn', {
enabled = enabled,
uuid = util.node_id(), uuid = util.node_id(),
interface = vpn_core.get_interface(), interface = vpn_core.get_interface(),
bind_interface = 'br-wan', bind_interface = 'br-wan',

View File

@ -1,15 +0,0 @@
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
local util = require 'gluon.util'
local sname = uci:get_first('gluon-node-info', 'location')
if sname then
local options = {'longitude', 'latitude', 'altitude'}
for _, option in ipairs(options) do
local value = uci:get('gluon-node-info', sname, option)
if value then
uci:set('gluon-node-info', sname, option, util.trim(value))
end
end
uci:save('gluon-node-info')
end

View File

@ -1,5 +0,0 @@
#!/usr/bin/lua
local users = require 'gluon.users'
users.remove_user('gluon-radvd')

View File

@ -1,14 +0,0 @@
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
local old = uci:get_first('gluon-config-mode', 'wizard', 'configured')
if old == '1' then
local setup_mode = uci:get_first('gluon-setup-mode', 'setup_mode')
uci:set('gluon-setup-mode', setup_mode, 'configured', true)
uci:save('gluon-setup-mode')
end
os.remove('/etc/config/gluon-config-mode')