gluon-legacy: remove package

The maintenance overhead doesn't justify keeping this old stuff anymore.
This commit is contained in:
Matthias Schiffer 2017-01-19 12:36:16 +01:00
parent 718758f0e5
commit 6f48fc428f
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
9 changed files with 0 additions and 218 deletions

View File

@ -1,42 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-legacy
PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include ../gluon.mk
define Package/gluon-legacy
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Legacy update scripts
DEPENDS:=+gluon-core
endef
define Package/gluon-legacy/description
Gluon community wifi mesh firmware framework: legacy update scripts
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-legacy/install
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
endef
define Package/gluon-legacy/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-legacy))

View File

@ -1,8 +0,0 @@
need_string_array 'legacy.version_files'
need_string_array 'legacy.old_files'
need_string_array 'legacy.config_mode_configs'
need_string_array 'legacy.fastd_configs'
need_string 'legacy.mesh_ifname'
need_string_array 'legacy.tc_configs'
need_string_array 'legacy.wifi_names'

View File

@ -1,11 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
for _, file in ipairs(site.legacy.version_files) do
if os.remove(file) then
-- Set version being upgraded from to 'legacy'
sysconfig.gluon_version = 'legacy'
end
end

View File

@ -1,39 +0,0 @@
#!/usr/bin/lua
local gluon_util = require 'gluon.util'
local platform = require 'gluon.platform'
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
local util = require 'luci.util'
if sysconfig.gluon_version == 'legacy' then
local function iface_exists(name)
return (gluon_util.exec('ip', 'link', 'show', 'dev', (name:gsub('%..*$', ''))) == 0)
end
local function remove_bat0(iface)
return util.trim(string.gsub(' ' .. iface .. ' ', ' bat0 ', ' '))
end
local lan_ifname = remove_bat0(uci:get('network', site.legacy.mesh_ifname, 'ifname'))
local wan_ifname = uci:get('network', 'wan', 'ifname')
if wan_ifname and iface_exists(wan_ifname) then
sysconfig.wan_ifname = wan_ifname
sysconfig.lan_ifname = lan_ifname
else
sysconfig.wan_ifname = lan_ifname
end
uci:delete('network', site.legacy.mesh_ifname)
uci:delete('network', 'wan')
uci:save('network')
end

View File

@ -1,23 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if sysconfig.gluon_version == 'legacy' then
function delete_legacy_iface(iface)
for _, wifi in pairs(site.legacy.wifi_names) do
if wifi == iface['.name'] then
return true
end
end
return false
end
uci:delete_all('wireless', 'wifi-iface', delete_legacy_iface)
uci:save('wireless')
end

View File

@ -1,20 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if sysconfig.gluon_version == 'legacy' then
for _, config in ipairs(site.legacy.config_mode_configs) do
local old = uci:get_first(config, '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', '1')
uci:save('gluon-setup-mode')
break
end
end
end

View File

@ -1,28 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if sysconfig.gluon_version == 'legacy' then
for _, config in ipairs(site.legacy.tc_configs) do
local s = uci:get_first(config, 'bandwidth')
if s then
old = uci:get_all(config, s)
uci:section('simple-tc', 'interface', 'mesh_vpn',
{
ifname = 'mesh-vpn',
enabled = old.enabled,
limit_ingress = old.downstream,
limit_egress = old.upstream,
}
)
uci:save('simple-tc')
break
end
end
end

View File

@ -1,36 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if sysconfig.gluon_version == 'legacy' then
local secret
local enabled
for _, config in ipairs(site.legacy.fastd_configs) do
if not secret then
local s = uci:get_all('fastd', config)
if s then
secret = s.secret
enabled = s.enabled
end
end
uci:delete('fastd', config)
end
if secret then
uci:section('fastd', 'fastd', 'mesh_vpn',
{
secret = secret,
enabled = enabled,
}
)
end
uci:save('fastd')
end

View File

@ -1,11 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
if sysconfig.gluon_version == 'legacy' then
for _, file in ipairs(site.legacy.old_files) do
os.remove(file)
end
end