Browse Source

Remove ffho-ath9k-blackout-workaround, it's not needed any more

Michael Schwarz 5 years ago
parent
commit
7a9065c79d

+ 0 - 22
ffho-ath9k-blackout-workaround/LICENSE

@@ -1,22 +0,0 @@
-Copyright (c) 2016, Karsten Böddeker <freifunk@kb-light.de>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-  1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 0 - 27
ffho-ath9k-blackout-workaround/Makefile

@@ -1,27 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ffho-ath9k-blackout-workaround
-PKG_VERSION:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(TOPDIR)/../package/gluon.mk
-
-define Package/ffho-ath9k-blackout-workaround
-  SECTION:=ffho
-  CATEGORY:=Workarounds
-  TITLE:=ATH9K-Blackout workaround
-  DEPENDS:=+gluon-core +micrond
-  MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
-endef
-
-define Package/ffho-ath9k-blackout-workaround/description
-	Restartes the wifi if possible blckout is detected.
-endef
-
-define Package/ffho-ath9k-blackout-workaround/postinst
-#!/bin/sh
-$(call GluonCheckSite,check_site.lua)
-endef
-
-$(eval $(call BuildPackageGluon,$(PKG_NAME)))

+ 0 - 29
ffho-ath9k-blackout-workaround/ReadMe.md

@@ -1,29 +0,0 @@
-ffho-ath9k-blackout-workaround
-==============================
-
-In order to avoid further WiFi-Blackouts that *might* be caused by buggy ath9k,
-we try to detect problems and restart the wifi.
-
-site.conf
----------
-
-**ath9k_workaround.blackout_wait:**
-- minimum delay in minutes to detect a possible blackout as blackout
-
-**ath9k_workaround.reset_wait:**
-- minimum delay in minutes between reset
-
-**ath9k_workaround.step_size**
-- execute the cronjob each x minutes
-
-### example
-```lua
-{
-  ath9k_workaround = {
-    blackout_wait = 720,
-    reset_wait = 1440,
-    step_size = 10,
-  },
-  ...
-},
-```

+ 0 - 3
ffho-ath9k-blackout-workaround/check_site.lua

@@ -1,3 +0,0 @@
-need_number('ath9k_workaround.blackout_wait')
-need_number('ath9k_workaround.reset_wait')
-need_number('ath9k_workaround.step_size')

+ 0 - 15
ffho-ath9k-blackout-workaround/files/etc/hotplug.d/iface/90-ath9k-blackout-workaround

@@ -1,15 +0,0 @@
-#!/bin/sh
-[[ "${ACTION}" != "ifup" ]] && exit 0;
-
-. /lib/functions.sh
-config_load "wireless"
-
-local RADIO
-config_get RADIO ${INTERFACE} device
-[[ -z ${RADIO} ]] && exit 0;
-
-local HWMODE
-config_get HWMODE ${RADIO} hwmode
-[[ "${HWMODE}" != "11g" ]] && exit 0;
-
-date +%s > /tmp/ath9k-reset

+ 0 - 10
ffho-ath9k-blackout-workaround/luasrc/lib/gluon/upgrade/900-ath9k-blackout-workaround

@@ -1,10 +0,0 @@
-#!/usr/bin/lua
-
-local fs = require 'nixio.fs'
-local site = require 'gluon.site'
-
-local step_size = site.ath9k_workaround.step_size()
-
-local f = io.open('/usr/lib/micron.d/ath9k-blackout-workaround', 'w')
-f:write(string.format('*/%i * * * * /usr/sbin/ath9k-blackout-workaround\n', step_size))
-f:close()

+ 0 - 66
ffho-ath9k-blackout-workaround/luasrc/usr/sbin/ath9k-blackout-workaround

@@ -1,66 +0,0 @@
-#!/usr/bin/lua
-local fs = require 'nixio.fs'
-local uci = require('simple-uci').cursor()
-local iwinfo = require 'iwinfo'
-local site = require 'gluon.site'
-
-local fileOk = '/tmp/ath9k-ok'
-local fileReset = '/tmp/ath9k-reset'
-
-function time2file (file)
-  local f = io.open(file, 'w')
-  f:write(string.format('%i', os.time()))
-  f:close()
-end
-
-function devOk (iface)
-  local radio = uci:get('wireless', iface, 'device')
-  if uci:get_bool('wireless', iface, 'disabled') or uci:get_bool('wireless', radio, 'disabled') then
-    return null
-  end
-  if uci:get('wireless', radio, 'hwmode') ~= '11g' then
-    return null
-  end
-
-  local ifname = uci:get('wireless', iface, 'ifname')
-  local wifitype = iwinfo.type(radio)
-  local assoclist = iwinfo[wifitype].assoclist(ifname)
-  if next(assoclist) then
-    return true
-  end
-  return false
-end
-
-function check_wifi()
-  local ok = false
-  uci:foreach('wireless', 'wifi-iface',
-    function(s)
-      ok = ok or devOk(s['.name'])
-    end
-  )
-  return ok
-end
-
-if not fs.readfile(fileReset) then
-  time2file(fileReset)
-end
-
-if check_wifi() or not fs.readfile(fileOk) then
-  time2file(fileOk)
-  os.exit(0)
-end
-
-local blackout_wait_secs = site.ath9k_workaround.blackout_wait() * 60
-local reset_wait_secs = site.ath9k_workaround.reset_wait() * 60
-
-if os.difftime(os.time(), tonumber(fs.readfile(fileReset))) <= reset_wait_secs then
-  os.exit(0)
-end
-
-if os.difftime(os.time(), tonumber(fs.readfile(fileOk))) <= blackout_wait_secs then
-  os.exit(0)
-end
-
-io.popen('logger -s -t ath9k-blackout-workaround -p local0.info "blackout detected, resart wifi"')
-time2file(fileReset)
-os.execute('wifi')