diff --git a/package/gluon-legacy/Makefile b/package/gluon-legacy/Makefile deleted file mode 100644 index 64607ea3..00000000 --- a/package/gluon-legacy/Makefile +++ /dev/null @@ -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)) diff --git a/package/gluon-legacy/check_site.lua b/package/gluon-legacy/check_site.lua deleted file mode 100644 index 1ec26de0..00000000 --- a/package/gluon-legacy/check_site.lua +++ /dev/null @@ -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' diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/000-legacy b/package/gluon-legacy/luasrc/lib/gluon/upgrade/000-legacy deleted file mode 100755 index 78436676..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/000-legacy +++ /dev/null @@ -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 diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/019-legacy-interfaces b/package/gluon-legacy/luasrc/lib/gluon/upgrade/019-legacy-interfaces deleted file mode 100755 index 691e4ad7..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/019-legacy-interfaces +++ /dev/null @@ -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 - - diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/210-legacy-wireless b/package/gluon-legacy/luasrc/lib/gluon/upgrade/210-legacy-wireless deleted file mode 100755 index d8fd1720..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/210-legacy-wireless +++ /dev/null @@ -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 diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-setup-mode b/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-setup-mode deleted file mode 100755 index d2a67484..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-setup-mode +++ /dev/null @@ -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 diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-simple-tc b/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-simple-tc deleted file mode 100755 index 652c53c9..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/290-legacy-simple-tc +++ /dev/null @@ -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 diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd b/package/gluon-legacy/luasrc/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd deleted file mode 100755 index 21f95e07..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd +++ /dev/null @@ -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 diff --git a/package/gluon-legacy/luasrc/lib/gluon/upgrade/990-legacy-late b/package/gluon-legacy/luasrc/lib/gluon/upgrade/990-legacy-late deleted file mode 100755 index efb6b675..00000000 --- a/package/gluon-legacy/luasrc/lib/gluon/upgrade/990-legacy-late +++ /dev/null @@ -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