Merge Lean's source
This commit is contained in:
commit
d78868c0aa
@ -1,26 +1,26 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2019.06.03
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=cd917ed86b63ce8d93947979f1f18948f03a4ac0ad89ec25227b36ac00dc54bf
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
|
||||
PKG_SOURCE_DATE:=2017-10-20
|
||||
PKG_SOURCE_VERSION:=4343d359ed5e7404de8803a74df186457b26ab79
|
||||
PKG_MIRROR_HASH:=5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/wireless-regdb
|
||||
PKGARCH:=all
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/
|
||||
URL:=$(patsubst pub/scm,cgit,$(PKG_SOURCE_URL))
|
||||
TITLE:=Wireless Regulatory Database
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(STAGING_DIR_HOST)/bin/$(PYTHON) $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt
|
||||
python $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt
|
||||
endef
|
||||
|
||||
define Package/wireless-regdb/install
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
From 651e39dee8605995b736b6056c6f7dc5c5a9c948 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Thu, 22 Aug 2019 21:46:27 +0200
|
||||
Subject: [PATCH] regdb: fix compatibility with python2
|
||||
|
||||
Various changes in the commit mentioned below broke
|
||||
compatibility with python2. Restore it in a way that
|
||||
makes it worth with both versions.
|
||||
|
||||
Fixes: f3c4969c2485 ("wireless-regdb: make scripts compatible with Python 3")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
|
||||
---
|
||||
db2bin.py | 2 +-
|
||||
db2fw.py | 2 +-
|
||||
dbparse.py | 3 +--
|
||||
3 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/db2bin.py
|
||||
+++ b/db2bin.py
|
||||
@@ -118,7 +118,7 @@ reg_country_ptr.set()
|
||||
for alpha2 in countrynames:
|
||||
coll = countries[alpha2]
|
||||
# struct regdb_file_reg_country
|
||||
- output.write(struct.pack('>BBxBI', alpha2[0], alpha2[1], coll.dfs_region, reg_rules_collections[coll.permissions]))
|
||||
+ output.write(struct.pack('>2sxBI', alpha2, coll.dfs_region, reg_rules_collections[coll.permissions]))
|
||||
|
||||
|
||||
if len(sys.argv) > 3:
|
||||
--- a/db2fw.py
|
||||
+++ b/db2fw.py
|
||||
@@ -85,7 +85,7 @@ countrynames = list(countries)
|
||||
countrynames.sort()
|
||||
for alpha2 in countrynames:
|
||||
coll = countries[alpha2]
|
||||
- output.write(struct.pack('>BB', alpha2[0], alpha2[1]))
|
||||
+ output.write(struct.pack('>2s', alpha2))
|
||||
country_ptrs[alpha2] = PTR(output)
|
||||
output.write(b'\x00' * 4)
|
||||
|
||||
--- a/dbparse.py
|
||||
+++ b/dbparse.py
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
-from builtins import bytes
|
||||
from functools import total_ordering
|
||||
import sys, math
|
||||
from math import ceil, log
|
||||
@@ -359,7 +358,7 @@ class DBParser(object):
|
||||
for cname in cnames:
|
||||
if len(cname) != 2:
|
||||
self._warn("country '%s' not alpha2" % cname)
|
||||
- cname = bytes(cname, 'ascii')
|
||||
+ cname = cname.encode('ascii')
|
||||
if not cname in self._countries:
|
||||
self._countries[cname] = Country(dfs_region, comments=self._comments)
|
||||
self._current_countries[cname] = self._countries[cname]
|
||||
@ -0,0 +1,251 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Mon, 9 Oct 2017 11:50:57 +0200
|
||||
Subject: [PATCH] regdb: write firmware file format (version code 20)
|
||||
|
||||
TODO: clean up the Makefile stuff ...
|
||||
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
create mode 100755 db2fw.py
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,5 @@
|
||||
# Install prefix
|
||||
PREFIX ?= /usr
|
||||
-CRDA_PATH ?= $(PREFIX)/lib/crda
|
||||
-CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys
|
||||
|
||||
MANDIR ?= $(PREFIX)/share/man/
|
||||
|
||||
@@ -30,39 +28,47 @@ REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO
|
||||
fi)
|
||||
|
||||
REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem
|
||||
-REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem
|
||||
-
|
||||
-REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem
|
||||
+REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem
|
||||
|
||||
REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \
|
||||
if [ $$? -ne 0 ]; then \
|
||||
- echo maintainer-clean $(REGDB_PUBKEY); \
|
||||
+ echo maintainer-clean $(REGDB_PUBCERT); \
|
||||
fi)
|
||||
|
||||
.PHONY: all clean mrproper install maintainer-clean install-distro-key
|
||||
|
||||
-all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt
|
||||
+all: $(REGDB_CHANGED) regulatory.db.p7s sha1sum.txt
|
||||
|
||||
clean:
|
||||
@rm -f *.pyc *.gz
|
||||
|
||||
maintainer-clean: clean
|
||||
- @rm -f regulatory.bin
|
||||
+ @rm -f regulatory.db regulatory.db.p7s
|
||||
|
||||
mrproper: clean maintainer-clean
|
||||
- @echo Removed public key, regulatory.bin and compresed man pages
|
||||
- @rm -f $(REGDB_PUBKEY) .custom
|
||||
+ @echo Removed public key, regulatory.db* and compressed man pages
|
||||
+ @rm -f $(REGDB_PUBCERT) .custom
|
||||
|
||||
-regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY)
|
||||
- @echo Generating $@ digitally signed by $(REGDB_AUTHOR)...
|
||||
- ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY)
|
||||
+regulatory.db: db.txt db2fw.py
|
||||
+ @echo "Generating $@"
|
||||
+ ./db2fw.py regulatory.db db.txt
|
||||
+
|
||||
+regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT)
|
||||
+ @echo "Signing regulatory.db (by $(REGDB_AUTHOR))..."
|
||||
+ @openssl smime -sign \
|
||||
+ -signer $(REGDB_PUBCERT) \
|
||||
+ -inkey $(REGDB_PRIVKEY) \
|
||||
+ -in $< -nosmimecap -binary \
|
||||
+ -outform DER -out $@
|
||||
|
||||
sha1sum.txt: db.txt
|
||||
sha1sum $< > $@
|
||||
|
||||
-$(REGDB_PUBKEY): $(REGDB_PRIVKEY)
|
||||
- @echo "Generating public key for $(REGDB_AUTHOR)..."
|
||||
- openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM
|
||||
+$(REGDB_PUBCERT): $(REGDB_PRIVKEY)
|
||||
+ @echo "Generating certificate for $(REGDB_AUTHOR)..."
|
||||
+ @openssl req -config regulatory.openssl.conf \
|
||||
+ -key $(REGDB_PRIVKEY) -days 36500 -utf8 -nodes -batch \
|
||||
+ -x509 -outform PEM -out $(REGDB_PUBCERT)
|
||||
@echo $(REGDB_PUBKEY) > .custom
|
||||
|
||||
|
||||
@@ -97,16 +103,7 @@ install-distro-key: maintainer-clean $(D
|
||||
# make maintainer-clean
|
||||
# make
|
||||
# sudo make install
|
||||
-install: regulatory.bin.5.gz
|
||||
- install -m 755 -d $(DESTDIR)/$(CRDA_PATH)
|
||||
- install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH)
|
||||
- if [ -f .custom ]; then \
|
||||
- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \
|
||||
- fi
|
||||
- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY)
|
||||
- install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin
|
||||
+install: regulatory.db.5.gz
|
||||
+ install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.db
|
||||
install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/
|
||||
- install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz
|
||||
-
|
||||
-uninstall:
|
||||
- rm -rf $(DESTDIR)/$(CRDA_PATH)/
|
||||
+ install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.db.5.gz
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -18,8 +18,8 @@ python module is used by the web viewer
|
||||
implemented as a MoinMoin macro (and used on http://wireless.kernel.org)
|
||||
to allow viewing the database for verification.
|
||||
|
||||
-The dbparse module is also used by db2bin.py, the `compiler', which
|
||||
-compiles and signs the binary database.
|
||||
+The dbparse module is also used by db2bin.py and db2fw.py, the `compilers'
|
||||
+that compile the database to its binary formats.
|
||||
|
||||
For more information, please see the CRDA git repository:
|
||||
|
||||
--- /dev/null
|
||||
+++ b/db2fw.py
|
||||
@@ -0,0 +1,133 @@
|
||||
+#!/usr/bin/env python
|
||||
+
|
||||
+from cStringIO import StringIO
|
||||
+import struct
|
||||
+import hashlib
|
||||
+from dbparse import DBParser
|
||||
+import sys
|
||||
+
|
||||
+MAGIC = 0x52474442
|
||||
+VERSION = 20
|
||||
+
|
||||
+if len(sys.argv) < 3:
|
||||
+ print 'Usage: %s output-file input-file' % sys.argv[0]
|
||||
+ sys.exit(2)
|
||||
+
|
||||
+def create_rules(countries):
|
||||
+ result = {}
|
||||
+ for c in countries.itervalues():
|
||||
+ for rule in c.permissions:
|
||||
+ result[rule] = 1
|
||||
+ return result.keys()
|
||||
+
|
||||
+def create_collections(countries):
|
||||
+ result = {}
|
||||
+ for c in countries.itervalues():
|
||||
+ result[(c.permissions, c.dfs_region)] = 1
|
||||
+ return result.keys()
|
||||
+
|
||||
+
|
||||
+def be32(output, val):
|
||||
+ output.write(struct.pack('>I', val))
|
||||
+def be16(output, val):
|
||||
+ output.write(struct.pack('>H', val))
|
||||
+
|
||||
+class PTR(object):
|
||||
+ def __init__(self, output):
|
||||
+ self._output = output
|
||||
+ self._pos = output.tell()
|
||||
+ be16(output, 0)
|
||||
+ self._written = False
|
||||
+
|
||||
+ def set(self, val=None):
|
||||
+ if val is None:
|
||||
+ val = self._output.tell()
|
||||
+ assert val & 3 == 0
|
||||
+ self._offset = val
|
||||
+ pos = self._output.tell()
|
||||
+ self._output.seek(self._pos)
|
||||
+ be16(self._output, val >> 2)
|
||||
+ self._output.seek(pos)
|
||||
+ self._written = True
|
||||
+
|
||||
+ def get(self):
|
||||
+ return self._offset
|
||||
+
|
||||
+ @property
|
||||
+ def written(self):
|
||||
+ return self._written
|
||||
+
|
||||
+p = DBParser()
|
||||
+countries = p.parse(file(sys.argv[2]))
|
||||
+rules = create_rules(countries)
|
||||
+rules.sort(cmp=lambda x, y: cmp(x.freqband, y.freqband))
|
||||
+collections = create_collections(countries)
|
||||
+collections.sort(cmp=lambda x, y: cmp(x[0][0].freqband, y[0][0].freqband))
|
||||
+
|
||||
+output = StringIO()
|
||||
+
|
||||
+# struct regdb_file_header
|
||||
+be32(output, MAGIC)
|
||||
+be32(output, VERSION)
|
||||
+
|
||||
+country_ptrs = {}
|
||||
+countrynames = countries.keys()
|
||||
+countrynames.sort()
|
||||
+for alpha2 in countrynames:
|
||||
+ coll = countries[alpha2]
|
||||
+ output.write(struct.pack('>cc', str(alpha2[0]), str(alpha2[1])))
|
||||
+ country_ptrs[alpha2] = PTR(output)
|
||||
+output.write('\x00' * 4)
|
||||
+
|
||||
+reg_rules = {}
|
||||
+flags = 0
|
||||
+for reg_rule in rules:
|
||||
+ freq_range, power_rule = reg_rule.freqband, reg_rule.power
|
||||
+ reg_rules[reg_rule] = output.tell()
|
||||
+ assert power_rule.max_ant_gain == 0
|
||||
+ flags = 0
|
||||
+ # convert to new rule flags
|
||||
+ assert reg_rule.flags & ~0x899 == 0
|
||||
+ if reg_rule.flags & 1<<0:
|
||||
+ flags |= 1<<0
|
||||
+ if reg_rule.flags & 1<<3:
|
||||
+ flags |= 1<<1
|
||||
+ if reg_rule.flags & 1<<4:
|
||||
+ flags |= 1<<2
|
||||
+ if reg_rule.flags & 1<<7:
|
||||
+ flags |= 1<<3
|
||||
+ if reg_rule.flags & 1<<11:
|
||||
+ flags |= 1<<4
|
||||
+ rule_len = 16
|
||||
+ cac_timeout = 0 # TODO
|
||||
+ if not (flags & 1<<2):
|
||||
+ cac_timeout = 0
|
||||
+ if cac_timeout:
|
||||
+ rule_len += 2
|
||||
+ output.write(struct.pack('>BBHIII', rule_len, flags, power_rule.max_eirp * 100,
|
||||
+ freq_range.start * 1000, freq_range.end * 1000, freq_range.maxbw * 1000,
|
||||
+ ))
|
||||
+ if cac_timeout:
|
||||
+ output.write(struct.pack('>H', cac_timeout))
|
||||
+ while rule_len % 4:
|
||||
+ output.write('\0')
|
||||
+ rule_len += 1
|
||||
+
|
||||
+for coll in collections:
|
||||
+ for alpha2 in countrynames:
|
||||
+ if (countries[alpha2].permissions, countries[alpha2].dfs_region) == coll:
|
||||
+ assert not country_ptrs[alpha2].written
|
||||
+ country_ptrs[alpha2].set()
|
||||
+ slen = 3
|
||||
+ output.write(struct.pack('>BBBx', slen, len(list(coll[0])), coll[1]))
|
||||
+ coll = list(coll[0])
|
||||
+ for regrule in coll:
|
||||
+ be16(output, reg_rules[regrule] >> 2)
|
||||
+ if len(coll) % 2:
|
||||
+ be16(output, 0)
|
||||
+
|
||||
+for alpha2 in countrynames:
|
||||
+ assert country_ptrs[alpha2].written
|
||||
+
|
||||
+outfile = open(sys.argv[1], 'w')
|
||||
+outfile.write(output.getvalue())
|
||||
@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
--- a/db.txt
|
||||
+++ b/db.txt
|
||||
@@ -16,7 +16,7 @@ country 00:
|
||||
@@ -6,7 +6,7 @@ country 00:
|
||||
# Channel 14. Only JP enables this and for 802.11b only
|
||||
(2474 - 2494 @ 20), (20), NO-IR, NO-OFDM
|
||||
# Channel 36 - 48
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 7eb6313910023f1be6015a8cd9e1b380ae01af64 Mon Sep 17 00:00:00 2001
|
||||
From: Chen Minqiang <ptpt52@gmail.com>
|
||||
Date: Sun, 7 Jan 2018 14:38:36 +0800
|
||||
Subject: [PATCH] custom fix txpower and dfs
|
||||
|
||||
---
|
||||
db.txt | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/db.txt b/db.txt
|
||||
index 75dc0a3..24989ad 100644
|
||||
--- a/db.txt
|
||||
+++ b/db.txt
|
||||
@@ -277,9 +277,9 @@ country CL: DFS-JP
|
||||
(5735 - 5835 @ 80), (20)
|
||||
|
||||
country CN: DFS-FCC
|
||||
- (2402 - 2482 @ 40), (20)
|
||||
- (5170 - 5250 @ 80), (23), AUTO-BW
|
||||
- (5250 - 5330 @ 80), (23), DFS, AUTO-BW
|
||||
+ (2402 - 2482 @ 40), (30)
|
||||
+ (5170 - 5250 @ 80), (30), AUTO-BW
|
||||
+ (5250 - 5330 @ 80), (30), AUTO-BW
|
||||
(5735 - 5835 @ 80), (30)
|
||||
# 60 GHz band channels 1,4: 28dBm, channels 2,3: 44dBm
|
||||
# ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf
|
||||
@@ -1238,9 +1238,9 @@ country UG: DFS-FCC
|
||||
country US: DFS-FCC
|
||||
(2402 - 2472 @ 40), (30)
|
||||
# 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients
|
||||
- (5170 - 5250 @ 80), (23), AUTO-BW
|
||||
- (5250 - 5330 @ 80), (23), DFS, AUTO-BW
|
||||
- (5490 - 5730 @ 160), (23), DFS
|
||||
+ (5170 - 5250 @ 80), (30), AUTO-BW
|
||||
+ (5250 - 5330 @ 80), (30), AUTO-BW
|
||||
+ (5490 - 5730 @ 160), (30)
|
||||
(5735 - 5835 @ 80), (30)
|
||||
# 60g band
|
||||
# reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=autocore
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=27
|
||||
PKG_RELEASE:=28
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -731,7 +731,7 @@
|
||||
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
|
||||
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
|
||||
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
|
||||
<tr><td width="33%"><%:CPU Usage%></td><td id="cpuusage">-</td></tr>
|
||||
<tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@ -8,11 +8,11 @@ if [ ! -f "/tmp/adbyby.updated" ];then
|
||||
wget-ssl --spider --quiet --tries=1 --timeout=3 www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
wget_ok="1"
|
||||
touch /tmp/lazy.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/video.txt
|
||||
touch /tmp/lazy.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
touch /tmp/md5.json && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/md5.json
|
||||
touch /tmp/md5.json && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
rm -f /usr/share/adbyby/data/*.bak
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /usr/share/adbyby/data/lazy.txt /usr/share/adbyby/data/video.txt > /tmp/local-md5.json
|
||||
touch /tmp/md5.json && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/md5.json
|
||||
touch /tmp/md5.json && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
@ -12,8 +12,8 @@ video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4
|
||||
|
||||
if [ "$lazy_online"x != "$lazy_local"x -o "$video_online"x != "$video_local"x ]; then
|
||||
echo "MD5 not match! Need update!"
|
||||
touch /tmp/lazy.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://coding.net/u/adbyby/p/xwhyc-rules/git/raw/master/video.txt
|
||||
touch /tmp/lazy.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
|
||||
@ -14,6 +14,8 @@ local dsp = require "luci.dispatcher"
|
||||
const dom = doms[index];
|
||||
const port = ports[index];
|
||||
if (!dom) res()
|
||||
port.innerHTML = '<font color="#0072c3">connecting...</font>';
|
||||
|
||||
XHR.get('<%=dsp.build_url("admin/services/shadowsocksr/ping")%>', {
|
||||
index,
|
||||
domain: dom.getAttribute("hint"),
|
||||
@ -28,24 +30,22 @@ local dsp = require "luci.dispatcher"
|
||||
}
|
||||
dom.innerHTML = `<font color="${col}">${(result.ping ? result.ping : "--") + " ms"}</font>`
|
||||
if (result.socket) {
|
||||
port.innerHTML = '<font color="#249400">ok</font>'
|
||||
port.innerHTML = '<font color="#249400">ok</font>';
|
||||
} else {
|
||||
port.innerHTML = '<font color="#ff0000">fail</font>'
|
||||
port.innerHTML = '<font color="#ff0000">fail</font>';
|
||||
}
|
||||
res()
|
||||
res();
|
||||
});
|
||||
})
|
||||
}
|
||||
(async () => {
|
||||
for (let group = 0; group < Math.ceil(doms.length / 5); group++) {
|
||||
await Promise.all([
|
||||
xhr(group * 5 + 0),
|
||||
xhr(group * 5 + 1),
|
||||
xhr(group * 5 + 2),
|
||||
xhr(group * 5 + 3),
|
||||
xhr(group * 5 + 4),
|
||||
])
|
||||
let task = -1;
|
||||
const thread = () => {
|
||||
task = task + 1
|
||||
if (doms[task]) {
|
||||
xhr(task).then(thread);
|
||||
}
|
||||
})()
|
||||
//]]>
|
||||
</script>
|
||||
}
|
||||
for (let i = 0; i < 10; i++) {
|
||||
thread()
|
||||
}
|
||||
</script>
|
||||
@ -1,3 +1,3 @@
|
||||
<%+cbi/valueheader%>
|
||||
<span class="socket-connected" hint="<%=self:cfgvalue(section)%>">connecting</span>
|
||||
<span class="socket-connected" hint="<%=self:cfgvalue(section)%>">wait</span>
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
@ -105,7 +105,6 @@ local function processData(szType, content)
|
||||
-- kcp_port = 0,
|
||||
kcp_param = '--nocomp'
|
||||
}
|
||||
result.hashkey = type(content) == 'string' and md5(content) or md5(jsonStringify(content))
|
||||
if szType == 'ssr' then
|
||||
local dat = split(content, "/\\?")
|
||||
local hostInfo = split(dat[1], ':')
|
||||
@ -226,6 +225,11 @@ local function processData(szType, content)
|
||||
if not result.alias then
|
||||
result.alias = result.server .. ':' .. result.server_port
|
||||
end
|
||||
-- alias 不参与 hashkey 计算
|
||||
local alias = result.alias
|
||||
result.alias = nil
|
||||
result.hashkey = md5(jsonStringify(result))
|
||||
result.alias = alias
|
||||
return result
|
||||
end
|
||||
-- wget
|
||||
|
||||
@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=wireguard-tools
|
||||
|
||||
PKG_VERSION:=1.0.20200121
|
||||
PKG_VERSION:=1.0.20200206
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
|
||||
PKG_HASH:=15bfdbdbecbd3870ced9a7e68286c871bfcb2071d165f113808081f2e428faa3
|
||||
PKG_HASH:=f5207248c6a3c3e3bfc9ab30b91c1897b00802ed861e1f9faaed873366078c64
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
@ -33,7 +33,7 @@ MAKE_VARS += PLATFORM=linux
|
||||
define Package/wireguard-tools
|
||||
$(call Package/wireguard/Default)
|
||||
TITLE:=WireGuard userspace control program (wg)
|
||||
DEPENDS:=+libmnl +ip
|
||||
DEPENDS:=+ip
|
||||
endef
|
||||
|
||||
define Package/wireguard-tools/description
|
||||
|
||||
Loading…
Reference in New Issue
Block a user