Merge branch 'openwrt:master' into master
This commit is contained in:
commit
0020885440
44 changed files with 1470 additions and 232 deletions
|
@ -11,7 +11,7 @@ include perlver.mk
|
|||
|
||||
PKG_NAME:=perl
|
||||
PKG_VERSION:=$(PERL_VERSION)
|
||||
PKG_RELEASE:=9
|
||||
PKG_RELEASE:=10
|
||||
|
||||
PKG_SOURCE_URL:=\
|
||||
https://cpan.metacpan.org/src/5.0 \
|
||||
|
|
21
lang/perl/files/riscv64.config
Normal file
21
lang/perl/files/riscv64.config
Normal file
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=micropython-lib
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
|
||||
|
@ -50,7 +50,7 @@ endef
|
|||
define Package/micropython-lib-unix
|
||||
$(call Package/micropython-lib/Default)
|
||||
TITLE+= - Unix port packages
|
||||
DEPENDS:=+micropython +libpcre +librt +libsqlite3
|
||||
DEPENDS:=+micropython +libpcre2 +librt +libsqlite3
|
||||
endef
|
||||
|
||||
define Package/micropython-lib-unix-src
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
From 1cbe8c4dd653336c5766dfd75eb379ad37f04249 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 28 Sep 2023 20:59:26 +0200
|
||||
Subject: [PATCH] unix-ffi: re: convert to PCRE2
|
||||
|
||||
PCRE is marked as EOL and won't receive any new security update.
|
||||
|
||||
Convert the re module to PCRE2 API to enforce security.
|
||||
Additional dependency is now needed with uctypes due to changes in how
|
||||
PCRE2 return the match_data in a pointer and require special handling.
|
||||
|
||||
The converted module is tested with the test_re.py with no regression.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
unix-ffi/re/re.py | 73 +++++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 48 insertions(+), 25 deletions(-)
|
||||
|
||||
--- a/unix-ffi/re/re.py
|
||||
+++ b/unix-ffi/re/re.py
|
||||
@@ -1,36 +1,55 @@
|
||||
import sys
|
||||
import ffilib
|
||||
import array
|
||||
+import uctypes
|
||||
|
||||
+pcre2 = ffilib.open("libpcre2-8")
|
||||
|
||||
-pcre = ffilib.open("libpcre")
|
||||
-
|
||||
-# pcre *pcre_compile(const char *pattern, int options,
|
||||
-# const char **errptr, int *erroffset,
|
||||
-# const unsigned char *tableptr);
|
||||
-pcre_compile = pcre.func("p", "pcre_compile", "sipps")
|
||||
-
|
||||
-# int pcre_exec(const pcre *code, const pcre_extra *extra,
|
||||
-# const char *subject, int length, int startoffset,
|
||||
-# int options, int *ovector, int ovecsize);
|
||||
-pcre_exec = pcre.func("i", "pcre_exec", "PPsiiipi")
|
||||
-
|
||||
-# int pcre_fullinfo(const pcre *code, const pcre_extra *extra,
|
||||
-# int what, void *where);
|
||||
-pcre_fullinfo = pcre.func("i", "pcre_fullinfo", "PPip")
|
||||
-
|
||||
-
|
||||
-IGNORECASE = I = 1
|
||||
-MULTILINE = M = 2
|
||||
-DOTALL = S = 4
|
||||
-VERBOSE = X = 8
|
||||
-PCRE_ANCHORED = 0x10
|
||||
+# pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length,
|
||||
+# uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset,
|
||||
+# pcre2_compile_context *ccontext);
|
||||
+pcre2_compile = pcre2.func("p", "pcre2_compile_8", "siippp")
|
||||
+
|
||||
+# int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject,
|
||||
+# PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options,
|
||||
+# pcre2_match_data *match_data, pcre2_match_context *mcontext);
|
||||
+pcre2_match = pcre2.func("i", "pcre2_match_8", "Psiiipp")
|
||||
+
|
||||
+# int pcre2_pattern_info(const pcre2_code *code, uint32_t what,
|
||||
+# void *where);
|
||||
+pcre2_pattern_info = pcre2.func("i", "pcre2_pattern_info_8", "Pip")
|
||||
+
|
||||
+# PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data);
|
||||
+pcre2_get_ovector_pointer = pcre2.func("p", "pcre2_get_ovector_pointer_8", "p")
|
||||
+
|
||||
+# pcre2_match_data *pcre2_match_data_create_from_pattern(const pcre2_code *code,
|
||||
+# pcre2_general_context *gcontext);
|
||||
+pcre2_match_data_create_from_pattern = pcre2.func(
|
||||
+ "p", "pcre2_match_data_create_from_pattern_8", "Pp"
|
||||
+)
|
||||
+
|
||||
+# PCRE2_SIZE that is of type size_t.
|
||||
+# Use ULONG as type to support both 32bit and 64bit.
|
||||
+PCRE2_SIZE_SIZE = uctypes.sizeof({"field": 0 | uctypes.ULONG})
|
||||
+PCRE2_SIZE_TYPE = "L"
|
||||
+
|
||||
+# Real value in pcre2.h is 0xFFFFFFFF for 32bit and
|
||||
+# 0x0xFFFFFFFFFFFFFFFF for 64bit that is equivalent
|
||||
+# to -1
|
||||
+PCRE2_ZERO_TERMINATED = -1
|
||||
+
|
||||
+
|
||||
+IGNORECASE = I = 0x8
|
||||
+MULTILINE = M = 0x400
|
||||
+DOTALL = S = 0x20
|
||||
+VERBOSE = X = 0x80
|
||||
+PCRE2_ANCHORED = 0x80000000
|
||||
|
||||
# TODO. Note that Python3 has unicode by default
|
||||
ASCII = A = 0
|
||||
UNICODE = U = 0
|
||||
|
||||
-PCRE_INFO_CAPTURECOUNT = 2
|
||||
+PCRE2_INFO_CAPTURECOUNT = 0x4
|
||||
|
||||
|
||||
class PCREMatch:
|
||||
@@ -67,19 +86,23 @@ class PCREPattern:
|
||||
def search(self, s, pos=0, endpos=-1, _flags=0):
|
||||
assert endpos == -1, "pos: %d, endpos: %d" % (pos, endpos)
|
||||
buf = array.array("i", [0])
|
||||
- pcre_fullinfo(self.obj, None, PCRE_INFO_CAPTURECOUNT, buf)
|
||||
+ pcre2_pattern_info(self.obj, PCRE2_INFO_CAPTURECOUNT, buf)
|
||||
cap_count = buf[0]
|
||||
- ov = array.array("i", [0, 0, 0] * (cap_count + 1))
|
||||
- num = pcre_exec(self.obj, None, s, len(s), pos, _flags, ov, len(ov))
|
||||
+ match_data = pcre2_match_data_create_from_pattern(self.obj, None)
|
||||
+ num = pcre2_match(self.obj, s, len(s), pos, _flags, match_data, None)
|
||||
if num == -1:
|
||||
# No match
|
||||
return None
|
||||
+ ov_ptr = pcre2_get_ovector_pointer(match_data)
|
||||
+ # pcre2_get_ovector_pointer return PCRE2_SIZE
|
||||
+ ov_buf = uctypes.bytearray_at(ov_ptr, PCRE2_SIZE_SIZE * (cap_count + 1) * 2)
|
||||
+ ov = array.array(PCRE2_SIZE_TYPE, ov_buf)
|
||||
# We don't care how many matching subexpressions we got, we
|
||||
# care only about total # of capturing ones (including empty)
|
||||
return PCREMatch(s, cap_count + 1, ov)
|
||||
|
||||
def match(self, s, pos=0, endpos=-1):
|
||||
- return self.search(s, pos, endpos, PCRE_ANCHORED)
|
||||
+ return self.search(s, pos, endpos, PCRE2_ANCHORED)
|
||||
|
||||
def sub(self, repl, s, count=0):
|
||||
if not callable(repl):
|
||||
@@ -141,9 +164,9 @@ class PCREPattern:
|
||||
|
||||
|
||||
def compile(pattern, flags=0):
|
||||
- errptr = bytes(4)
|
||||
+ errcode = bytes(4)
|
||||
erroffset = bytes(4)
|
||||
- regex = pcre_compile(pattern, flags, errptr, erroffset, None)
|
||||
+ regex = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, flags, errcode, erroffset, None)
|
||||
assert regex
|
||||
return PCREPattern(regex)
|
||||
|
||||
@@ -154,7 +177,7 @@ def search(pattern, string, flags=0):
|
||||
|
||||
|
||||
def match(pattern, string, flags=0):
|
||||
- r = compile(pattern, flags | PCRE_ANCHORED)
|
||||
+ r = compile(pattern, flags | PCRE2_ANCHORED)
|
||||
return r.search(string)
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=exim
|
||||
PKG_VERSION:=4.96.1
|
||||
PKG_VERSION:=4.96.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://ftp.exim.org/pub/exim/exim4/
|
||||
PKG_HASH:=93ac0755c317e1fdbbea8ccb70a868876bdf3148692891c72ad0fe816767033d
|
||||
PKG_HASH:=038e327e8d1e93d005bac9bb06fd22aec44d5028930d6dbe8817ad44bbfc1de6
|
||||
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
|
|
@ -287,7 +287,7 @@ Last-Update: 2021-07-28
|
|||
#endif
|
||||
--- a/src/string.c
|
||||
+++ b/src/string.c
|
||||
@@ -418,6 +418,7 @@ return ss;
|
||||
@@ -428,6 +428,7 @@ return ss;
|
||||
|
||||
#if (defined(HAVE_LOCAL_SCAN) || defined(EXPAND_DLFUNC)) \
|
||||
&& !defined(MACRO_PREDEF) && !defined(COMPILE_UTILITY)
|
||||
|
@ -295,7 +295,7 @@ Last-Update: 2021-07-28
|
|||
/*************************************************
|
||||
* Copy and save string *
|
||||
*************************************************/
|
||||
@@ -463,6 +464,7 @@ string_copyn_function(const uschar * s,
|
||||
@@ -473,6 +474,7 @@ string_copyn_function(const uschar * s,
|
||||
{
|
||||
return string_copyn(s, n);
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gst1-libav
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gst-libav
|
||||
PKG_HASH:=2ec5c805808b4371a7e32b1da0202a1c8a6b36b6ce905080bf5c34097d12a923
|
||||
PKG_HASH:=7789e6408388a25f23cbf948cfc5c6230d735bbcd8b7f37f4a01c9e348a1e3a7
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-libav-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gst1-plugins-bad
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
|
||||
PKG_HASH:=e1798fee2d86127f0637481c607f983293bf0fd81aad70a5c7b47205af3621d8
|
||||
PKG_HASH:=b4029cd2908a089c55f1d902a565d007495c95b1442d838485dc47fb12df7137
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -501,7 +501,7 @@ gst_plugins_bad_args = ['-DHAVE_CONFIG_H
|
||||
@@ -508,7 +508,7 @@ gst_plugins_bad_args = ['-DHAVE_CONFIG_H
|
||||
configinc = include_directories('.')
|
||||
libsinc = include_directories('gst-libs')
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gst1-plugins-base
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gst-plugins-base
|
||||
PKG_HASH:=1c596289a0d4207380233eba8c36a932c4d1aceba19932937d9b57c24cef89f3
|
||||
PKG_HASH:=50f2b4d17c02eefe430bbefa8c5cd134b1be78a53c0f60e951136d96cf49fd4b
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gst1-plugins-good
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gst-plugins-good/
|
||||
PKG_HASH:=af81154b3a2ef3f4d2feba395f25696feea6fd13ec62c92d3c7a973470710273
|
||||
PKG_HASH:=b3b07fe3f1ce7fe93aa9be7217866044548f35c4a7792280eec7e108a32f9817
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -461,7 +461,7 @@ endif
|
||||
@@ -469,7 +469,7 @@ endif
|
||||
|
||||
presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gst1-plugins-ugly
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gst-plugins-ugly
|
||||
PKG_HASH:=3dc98ed5c2293368b3c4e6ce55d89be834a0a62e9bf88ef17928cf03b7d5a360
|
||||
PKG_HASH:=3e31454c98cb2f7f6d2d355eceb933a892fa0f1dc09bc36c9abc930d8e29ca48
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gstreamer1
|
||||
PKG_VERSION:=1.22.3
|
||||
PKG_VERSION:=1.22.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gstreamer
|
||||
PKG_HASH:=9ffeab95053f9f6995eb3b3da225e88f21c129cd60da002d3f795db70d6d5974
|
||||
PKG_HASH:=f500e6cfddff55908f937711fc26a0840de28a1e9ec49621c0b6f1adbd8f818e
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
|
||||
|
|
|
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=adblock-fast
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ config adblock-fast 'config'
|
|||
# list force_dns_port '8443'
|
||||
option led 'none'
|
||||
option parallel_downloads '1'
|
||||
option pause_timeout '20'
|
||||
option procd_trigger_wan6 '0'
|
||||
option procd_boot_wan_timeout '60'
|
||||
option verbosity '2'
|
||||
|
|
|
@ -1155,7 +1155,7 @@ adb_allow() {
|
|||
for c in $string; do
|
||||
output 2 " $c "
|
||||
hf="$(echo "$c" | sed 's/\./\\./g')"
|
||||
if sed -i "/\(^\|\.\)${hf}$/d;" "$outputFile" && \
|
||||
if sed -i "\:\(/\|\.\)${hf}/:d" "$outputFile" && \
|
||||
uci_add_list_if_new "${packageName}" 'config' 'allowed_domain' "$c"; then
|
||||
output_ok
|
||||
else
|
||||
|
@ -1171,7 +1171,7 @@ adb_allow() {
|
|||
fi
|
||||
fi
|
||||
output 2 "Committing changes to config "
|
||||
if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then
|
||||
if uci_commit "$packageName"; then
|
||||
allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')"
|
||||
json set triggers
|
||||
json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})"
|
||||
|
@ -1196,7 +1196,8 @@ adb_allow() {
|
|||
output 2 "Allowing domain(s) \\n"
|
||||
for c in $string; do
|
||||
output 2 " $c "
|
||||
if sed -i "/${string}/d" "$outputFile" && \
|
||||
hf="$(echo "$c" | sed 's/\./\\./g')"
|
||||
if sed -i "\:\(\"\|\.\)${hf}\":d" "$outputFile" && \
|
||||
uci_add_list_if_new "$packageName" 'config' 'allowed_domain' "$string"; then
|
||||
output_ok
|
||||
else
|
||||
|
@ -1212,7 +1213,7 @@ adb_allow() {
|
|||
fi
|
||||
fi
|
||||
output 2 "Committing changes to config "
|
||||
if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then
|
||||
if uci_commit "$packageName"; then
|
||||
allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')"
|
||||
json set triggers
|
||||
json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})"
|
||||
|
@ -1725,7 +1726,7 @@ load_validate_config() {
|
|||
'config_update_enabled:bool:0' \
|
||||
'config_update_url:string:https://cdn.jsdelivr.net/gh/openwrt/packages/net/adblock-fast/files/adblock-fast.conf.update' \
|
||||
'download_timeout:range(1,60):20' \
|
||||
'pause_timeout:range(10,120):60' \
|
||||
'pause_timeout:range(1,60):20' \
|
||||
'curl_additional_param:or("", string)' \
|
||||
'curl_max_file_size:or("", uinteger)' \
|
||||
'curl_retry:range(0,30):3' \
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsproxy
|
||||
PKG_VERSION:=0.56.1
|
||||
PKG_VERSION:=0.56.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=09aca2248e36c8e50e0a5e68034e34526aaccd6f849bd4de708f2ea4a5b3a52f
|
||||
PKG_HASH:=b20a77e88567fbcb80a07faa0f47aee7446b4d32ee7c17036fbdf07c03f05e3a
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
|
|
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=https-dns-proxy
|
||||
PKG_VERSION:=2023-05-25
|
||||
PKG_RELEASE:=7
|
||||
PKG_RELEASE:=8
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copied from https://openwrt.org/docs/guide-user/advanced/hotplug_extras
|
||||
# shellcheck disable=SC1091
|
||||
. /lib/functions/network.sh
|
||||
network_flush_cache
|
||||
network_find_wan NET_IF
|
||||
network_find_wan6 NET_IF6
|
||||
[ "$INTERFACE" != "$NET_IF" ] && [ "$INTERFACE" != "$NET_IF6" ] && exit 0
|
||||
[ "$ACTION" != "ifup" ] && [ "$ACTION" != "ifupdate" ] && exit 0
|
||||
[ "$ACTION" = "ifupdate" ] && [ -z "$IFUPDATE_ADDRESSES" ] && \
|
||||
[ -z "$IFUPDATE_DATA" ] && exit 0
|
||||
|
||||
sleep 10
|
||||
/etc/init.d/https-dns-proxy start 'on_hotplug'
|
|
@ -28,6 +28,8 @@ readonly DEFAULT_BOOTSTRAP="${BOOTSTRAP_CF},${BOOTSTRAP_GOOGLE}"
|
|||
readonly canaryDomainsMozilla='use-application-dns.net'
|
||||
readonly canaryDomainsiCloud='mask.icloud.com mask-h2.icloud.com'
|
||||
|
||||
on_boot_trigger=
|
||||
|
||||
str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
|
||||
is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; }
|
||||
is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; }
|
||||
|
@ -133,7 +135,8 @@ resolver_health_check() { resolveip -t 3 one.one.one.one >/dev/null 2>&1; }
|
|||
|
||||
boot() {
|
||||
ubus -t 30 wait_for network.interface 2>/dev/null
|
||||
rc_procd start_service 'on_boot'
|
||||
on_boot_trigger=1
|
||||
rc_procd start_service 'on_boot' && rc_procd service_started 'on_boot'
|
||||
resolver_health_check || rc_procd stop_service 'on_boot'
|
||||
}
|
||||
|
||||
|
@ -295,9 +298,28 @@ stop_service() {
|
|||
}
|
||||
|
||||
service_triggers() {
|
||||
local wan wan6 i
|
||||
local procd_trigger_wan6
|
||||
if [ "$on_boot_trigger" = '1' ]; then
|
||||
procd_add_raw_trigger "interface.*.up" 3000 "/etc/init.d/${packageName}" restart 'on_interface_up'
|
||||
else
|
||||
config_load "$packageName"
|
||||
config_get_bool procd_trigger_wan6 'config' 'procd_trigger_wan6' '0'
|
||||
. /lib/functions/network.sh
|
||||
network_flush_cache
|
||||
network_find_wan wan
|
||||
wan="${wan:-wan}"
|
||||
if [ "$procd_trigger_wan6" -ne 0 ]; then
|
||||
network_find_wan6 wan6
|
||||
wan6="${wan6:-wan6}"
|
||||
fi
|
||||
for i in $wan $wan6; do
|
||||
procd_add_interface_trigger "interface.*" "$i" "/etc/init.d/${packageName}" restart 'on_interface_trigger'
|
||||
done
|
||||
fi
|
||||
procd_add_config_trigger "config.change" "$packageName" "/etc/init.d/${packageName}" reload 'on_config_change'
|
||||
}
|
||||
|
||||
service_started() { procd_set_config_changed firewall; }
|
||||
service_stopped() { procd_set_config_changed firewall; }
|
||||
restart() { procd_send_signal "$packageName"; rc_procd start_service "$*"; }
|
||||
|
|
|
@ -200,4 +200,9 @@ config NGINX_HTTP_SUB
|
|||
prompt "Enable HTTP sub module"
|
||||
default n
|
||||
|
||||
config NGINX_STREAM_REAL_IP
|
||||
bool
|
||||
prompt "Enable STREAM real ip module"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=nginx
|
||||
PKG_VERSION:=1.25.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://nginx.org/download/
|
||||
|
@ -82,6 +82,7 @@ PKG_CONFIG_DEPENDS := \
|
|||
CONFIG_NGINX_PCRE \
|
||||
CONFIG_NGINX_HTTP_REAL_IP \
|
||||
CONFIG_NGINX_HTTP_SECURE_LINK \
|
||||
CONFIG_NGINX_STREAM_REAL_IP \
|
||||
CONFIG_OPENSSL_ENGINE \
|
||||
CONFIG_OPENSSL_WITH_NPN \
|
||||
$(foreach m,$(PKG_MOD_EXTRA),CONFIG_PACKAGE_$(m))
|
||||
|
@ -449,6 +450,7 @@ CONFIGURE_ARGS += \
|
|||
$(if $(call IsEnabled,NGINX_HTTP_SECURE_LINK),--with-http_secure_link_module) \
|
||||
$(if $(call IsEnabled,NGINX_HTTP_SUB),--with-http_sub_module) \
|
||||
$(if $(CONFIG_PACKAGE_nginx-mod-stream),--with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module) \
|
||||
$(if $(call IsEnabled,NGINX_STREAM_REAL_IP),--with-stream_realip_module) \
|
||||
$(if $(CONFIG_PACKAGE_nginx-mod-naxsi),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-naxsi/naxsi_src) \
|
||||
$(foreach m,$(filter-out lua-resty-core lua-resty-lrucache naxsi,$(PKG_MOD_EXTRA)), \
|
||||
$(if $(CONFIG_PACKAGE_nginx-mod-$(m)),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-$(m)))
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ooniprobe
|
||||
PKG_VERSION:=3.18.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=probe-cli-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ooni/probe-cli/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=d28c050226c9282d7155da6cabf5547ddd43dc11eecacc485b6c05161c2d1d88
|
||||
|
||||
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec1@gmail.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/probe-cli-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
GO_PKG:=github.com/ooni/probe-cli
|
||||
GO_PKG_BUILD_PKG:=github.com/ooni/probe-cli/v3/cmd/ooniprobe
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../../lang/golang/golang-package.mk
|
||||
|
||||
define Package/ooniprobe
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=OONI probe-cli
|
||||
URL:=https://ooni.org
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/ooniprobe/description
|
||||
The next generation of Open Observatory of Network Interference (OONI)
|
||||
Probe Command Line Interface.
|
||||
endef
|
||||
|
||||
# Workaround for musl 1.2.4 compability in mattn/go-sqlite3
|
||||
# https://github.com/mattn/go-sqlite3/issues/1164
|
||||
ifneq ($(CONFIG_USE_MUSL),)
|
||||
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
|
||||
endif
|
||||
|
||||
$(eval $(call GoBinPackage,ooniprobe))
|
||||
$(eval $(call BuildPackage,ooniprobe))
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
ooniprobe version | grep "$2"
|
|
@ -6,12 +6,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rclone
|
||||
PKG_VERSION:=1.64.1
|
||||
PKG_VERSION:=1.64.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=c94ad2c2fa79485667aae4a239ed04e786bd6e26bced05f9d95dda6d10f7a014
|
||||
PKG_HASH:=85feffc2d60554bcc3c59140750dc4ccf008e109b52c451956a1f52387af1bd6
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
|
|
@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
|
|||
#
|
||||
PKG_NAME:=shadowsocks-libev
|
||||
PKG_VERSION:=3.3.5
|
||||
PKG_RELEASE:=9
|
||||
PKG_RELEASE:=10
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
|
||||
|
@ -29,7 +29,7 @@ PKG_FIXUP:=autoreconf
|
|||
PKG_INSTALL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16 lto
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=c-ares pcre
|
||||
PKG_BUILD_DEPENDS:=c-ares pcre2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
@ -71,8 +71,8 @@ define Package/shadowsocks-libev/Default
|
|||
|
||||
endef
|
||||
|
||||
DEPENDS_ss-local = +libpcre
|
||||
DEPENDS_ss-server = +libcares +libpcre
|
||||
DEPENDS_ss-local = +libpcre2
|
||||
DEPENDS_ss-server = +libcares +libpcre2
|
||||
|
||||
SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server
|
||||
define shadowsocks-libev/templates
|
||||
|
|
544
net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch
Normal file
544
net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch
Normal file
|
@ -0,0 +1,544 @@
|
|||
From d4f4d9761cbd41c3ab6de79383ff39b9f97bf452 Mon Sep 17 00:00:00 2001
|
||||
From: Syrone Wong <wong.syrone@gmail.com>
|
||||
Date: Sat, 18 Nov 2017 20:06:50 +0800
|
||||
Subject: [PATCH] Upgrade PCRE to PCRE2
|
||||
|
||||
- Use 8bit variant by default
|
||||
|
||||
This comes from a PR closed and never reopen as at times PCRE2 was too
|
||||
new(???.)
|
||||
|
||||
Ref: https://github.com/shadowsocks/shadowsocks-libev/pull/1792
|
||||
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
|
||||
[ squash the first 2 patch from PR, drop the last one ]
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
.travis.yml | 9 ++-
|
||||
configure.ac | 8 +--
|
||||
m4/pcre.m4 | 152 ------------------------------------------
|
||||
m4/pcre2.m4 | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/rule.c | 53 ++++++++++++---
|
||||
src/rule.h | 23 +++++--
|
||||
6 files changed, 253 insertions(+), 173 deletions(-)
|
||||
delete mode 100644 m4/pcre.m4
|
||||
create mode 100644 m4/pcre2.m4
|
||||
|
||||
# diff --git a/.travis.yml b/.travis.yml
|
||||
# index ee3424c..e7da08c 100644
|
||||
# --- a/.travis.yml
|
||||
# +++ b/.travis.yml
|
||||
# @@ -11,11 +11,12 @@ env:
|
||||
# global:
|
||||
# - LIBSODIUM_VER=1.0.12
|
||||
# - MBEDTLS_VER=2.4.0
|
||||
# + - PCRE2_VER=10.30
|
||||
# before_install:
|
||||
# - |
|
||||
# if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
# # All dependencies for macOS build. Some packages has been installed by travis so use reinstall.
|
||||
# - brew reinstall autoconf automake xmlto c-ares libev mbedtls libsodium asciidoc >> /dev/null 2>&1;
|
||||
# + brew reinstall autoconf automake xmlto pcre2 c-ares libev mbedtls libsodium asciidoc >> /dev/null 2>&1;
|
||||
# else
|
||||
# wget https://github.com/jedisct1/libsodium/releases/download/$LIBSODIUM_VER/libsodium-$LIBSODIUM_VER.tar.gz;
|
||||
# tar xvf libsodium-$LIBSODIUM_VER.tar.gz;
|
||||
# @@ -29,6 +30,12 @@ before_install:
|
||||
# make SHARED=1;
|
||||
# sudo make install;
|
||||
# popd;
|
||||
# + wget https://ftp.pcre.org/pub/pcre/pcre2-$PCRE2_VER.tar.gz;
|
||||
# + tar xvf pcre2-$PCRE2_VER.tar.gz;
|
||||
# + pushd pcre2-$PCRE2_VER;
|
||||
# + ./configure --prefix=/usr --enable-pcre2-16 --enable-pcre2-32 && make;
|
||||
# + sudo make install;
|
||||
# + popd;
|
||||
# # Load cached docker images
|
||||
# if [[ -d $HOME/docker ]]; then
|
||||
# ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load";
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -20,10 +20,10 @@ AC_DISABLE_STATIC
|
||||
AC_DISABLE_SHARED
|
||||
LT_INIT([dlopen])
|
||||
|
||||
-dnl Check for pcre library
|
||||
-TS_CHECK_PCRE
|
||||
-if test "x${enable_pcre}" != "xyes"; then
|
||||
- AC_MSG_ERROR([Cannot find pcre library. Configure --with-pcre=DIR])
|
||||
+dnl Check for pcre2 library
|
||||
+TS_CHECK_PCRE2
|
||||
+if test "x${enable_pcre2}" != "xyes"; then
|
||||
+ AC_MSG_ERROR([Cannot find pcre2 library. Configure --with-pcre2=DIR])
|
||||
fi
|
||||
|
||||
dnl Checks for using shared libraries from system
|
||||
--- a/m4/pcre.m4
|
||||
+++ /dev/null
|
||||
@@ -1,152 +0,0 @@
|
||||
-dnl -------------------------------------------------------- -*- autoconf -*-
|
||||
-dnl Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
-dnl contributor license agreements. See the NOTICE file distributed with
|
||||
-dnl this work for additional information regarding copyright ownership.
|
||||
-dnl The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
-dnl (the "License"); you may not use this file except in compliance with
|
||||
-dnl the License. You may obtain a copy of the License at
|
||||
-dnl
|
||||
-dnl http://www.apache.org/licenses/LICENSE-2.0
|
||||
-dnl
|
||||
-dnl Unless required by applicable law or agreed to in writing, software
|
||||
-dnl distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-dnl See the License for the specific language governing permissions and
|
||||
-dnl limitations under the License.
|
||||
-
|
||||
-dnl
|
||||
-dnl TS_ADDTO(variable, value)
|
||||
-dnl
|
||||
-dnl Add value to variable
|
||||
-dnl
|
||||
-AC_DEFUN([TS_ADDTO], [
|
||||
- if test "x$$1" = "x"; then
|
||||
- test "x$verbose" = "xyes" && echo " setting $1 to \"$2\""
|
||||
- $1="$2"
|
||||
- else
|
||||
- ats_addto_bugger="$2"
|
||||
- for i in $ats_addto_bugger; do
|
||||
- ats_addto_duplicate="0"
|
||||
- for j in $$1; do
|
||||
- if test "x$i" = "x$j"; then
|
||||
- ats_addto_duplicate="1"
|
||||
- break
|
||||
- fi
|
||||
- done
|
||||
- if test $ats_addto_duplicate = "0"; then
|
||||
- test "x$verbose" = "xyes" && echo " adding \"$i\" to $1"
|
||||
- $1="$$1 $i"
|
||||
- fi
|
||||
- done
|
||||
- fi
|
||||
-])dnl
|
||||
-
|
||||
-dnl
|
||||
-dnl TS_ADDTO_RPATH(path)
|
||||
-dnl
|
||||
-dnl Adds path to variable with the '-rpath' directive.
|
||||
-dnl
|
||||
-AC_DEFUN([TS_ADDTO_RPATH], [
|
||||
- AC_MSG_NOTICE([adding $1 to RPATH])
|
||||
- TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R$1])
|
||||
-])dnl
|
||||
-
|
||||
-dnl
|
||||
-dnl pcre.m4: Trafficserver's pcre autoconf macros
|
||||
-dnl
|
||||
-
|
||||
-dnl
|
||||
-dnl TS_CHECK_PCRE: look for pcre libraries and headers
|
||||
-dnl
|
||||
-AC_DEFUN([TS_CHECK_PCRE], [
|
||||
-enable_pcre=no
|
||||
-AC_ARG_WITH(pcre, [AC_HELP_STRING([--with-pcre=DIR],[use a specific pcre library])],
|
||||
-[
|
||||
- if test "x$withval" != "xyes" && test "x$withval" != "x"; then
|
||||
- pcre_base_dir="$withval"
|
||||
- if test "$withval" != "no"; then
|
||||
- enable_pcre=yes
|
||||
- case "$withval" in
|
||||
- *":"*)
|
||||
- pcre_include="`echo $withval |sed -e 's/:.*$//'`"
|
||||
- pcre_ldflags="`echo $withval |sed -e 's/^.*://'`"
|
||||
- AC_MSG_CHECKING(checking for pcre includes in $pcre_include libs in $pcre_ldflags )
|
||||
- ;;
|
||||
- *)
|
||||
- pcre_include="$withval/include"
|
||||
- pcre_ldflags="$withval/lib"
|
||||
- AC_MSG_CHECKING(checking for pcre includes in $withval)
|
||||
- ;;
|
||||
- esac
|
||||
- fi
|
||||
- fi
|
||||
-],
|
||||
-[
|
||||
- AC_CHECK_PROG(PCRE_CONFIG, pcre-config, pcre-config)
|
||||
- if test "x$PCRE_CONFIG" != "x"; then
|
||||
- enable_pcre=yes
|
||||
- pcre_base_dir="`$PCRE_CONFIG --prefix`"
|
||||
- pcre_include="`$PCRE_CONFIG --cflags | sed -es/-I//`"
|
||||
- pcre_ldflags="`$PCRE_CONFIG --libs | sed -es/-lpcre// -es/-L//`"
|
||||
- fi
|
||||
-])
|
||||
-
|
||||
-if test "x$pcre_base_dir" = "x"; then
|
||||
- AC_MSG_CHECKING([for pcre location])
|
||||
- AC_CACHE_VAL(ats_cv_pcre_dir,[
|
||||
- for dir in /usr/local /usr ; do
|
||||
- if test -d $dir && ( test -f $dir/include/pcre.h || test -f $dir/include/pcre/pcre.h ); then
|
||||
- ats_cv_pcre_dir=$dir
|
||||
- break
|
||||
- fi
|
||||
- done
|
||||
- ])
|
||||
- pcre_base_dir=$ats_cv_pcre_dir
|
||||
- if test "x$pcre_base_dir" = "x"; then
|
||||
- enable_pcre=no
|
||||
- AC_MSG_RESULT([not found])
|
||||
- else
|
||||
- enable_pcre=yes
|
||||
- pcre_include="$pcre_base_dir/include"
|
||||
- pcre_ldflags="$pcre_base_dir/lib"
|
||||
- AC_MSG_RESULT([$pcre_base_dir])
|
||||
- fi
|
||||
-else
|
||||
- AC_MSG_CHECKING(for pcre headers in $pcre_include)
|
||||
- if test -d $pcre_include && test -d $pcre_ldflags && ( test -f $pcre_include/pcre.h || test -f $pcre_include/pcre/pcre.h ); then
|
||||
- AC_MSG_RESULT([ok])
|
||||
- else
|
||||
- AC_MSG_RESULT([not found])
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
-pcreh=0
|
||||
-pcre_pcreh=0
|
||||
-if test "$enable_pcre" != "no"; then
|
||||
- saved_ldflags=$LDFLAGS
|
||||
- saved_cppflags=$CFLAGS
|
||||
- pcre_have_headers=0
|
||||
- pcre_have_libs=0
|
||||
- if test "$pcre_base_dir" != "/usr"; then
|
||||
- TS_ADDTO(CFLAGS, [-I${pcre_include}])
|
||||
- TS_ADDTO(CFLAGS, [-DPCRE_STATIC])
|
||||
- TS_ADDTO(LDFLAGS, [-L${pcre_ldflags}])
|
||||
- TS_ADDTO_RPATH(${pcre_ldflags})
|
||||
- fi
|
||||
- AC_SEARCH_LIBS([pcre_exec], [pcre], [pcre_have_libs=1])
|
||||
- if test "$pcre_have_libs" != "0"; then
|
||||
- AC_CHECK_HEADERS(pcre.h, [pcre_have_headers=1])
|
||||
- AC_CHECK_HEADERS(pcre/pcre.h, [pcre_have_headers=1])
|
||||
- fi
|
||||
- if test "$pcre_have_headers" != "0"; then
|
||||
- AC_DEFINE(HAVE_LIBPCRE,1,[Compiling with pcre support])
|
||||
- AC_SUBST(LIBPCRE, [-lpcre])
|
||||
- else
|
||||
- enable_pcre=no
|
||||
- CFLAGS=$saved_cppflags
|
||||
- LDFLAGS=$saved_ldflags
|
||||
- fi
|
||||
-fi
|
||||
-AC_SUBST(pcreh)
|
||||
-AC_SUBST(pcre_pcreh)
|
||||
-])
|
||||
--- /dev/null
|
||||
+++ b/m4/pcre2.m4
|
||||
@@ -0,0 +1,181 @@
|
||||
+dnl -------------------------------------------------------- -*- autoconf -*-
|
||||
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
+dnl contributor license agreements. See the NOTICE file distributed with
|
||||
+dnl this work for additional information regarding copyright ownership.
|
||||
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
+dnl (the "License"); you may not use this file except in compliance with
|
||||
+dnl the License. You may obtain a copy of the License at
|
||||
+dnl
|
||||
+dnl http://www.apache.org/licenses/LICENSE-2.0
|
||||
+dnl
|
||||
+dnl Unless required by applicable law or agreed to in writing, software
|
||||
+dnl distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+dnl See the License for the specific language governing permissions and
|
||||
+dnl limitations under the License.
|
||||
+
|
||||
+dnl Modified by Syrone Wong <wong.syrone@gmail.com> to support pcre2 8bit variant only
|
||||
+
|
||||
+dnl
|
||||
+dnl TS_ADDTO(variable, value)
|
||||
+dnl
|
||||
+dnl Add value to variable
|
||||
+dnl
|
||||
+AC_DEFUN([TS_ADDTO], [
|
||||
+ if test "x$$1" = "x"; then
|
||||
+ test "x$verbose" = "xyes" && echo " setting $1 to \"$2\""
|
||||
+ $1="$2"
|
||||
+ else
|
||||
+ ats_addto_bugger="$2"
|
||||
+ for i in $ats_addto_bugger; do
|
||||
+ ats_addto_duplicate="0"
|
||||
+ for j in $$1; do
|
||||
+ if test "x$i" = "x$j"; then
|
||||
+ ats_addto_duplicate="1"
|
||||
+ break
|
||||
+ fi
|
||||
+ done
|
||||
+ if test $ats_addto_duplicate = "0"; then
|
||||
+ test "x$verbose" = "xyes" && echo " adding \"$i\" to $1"
|
||||
+ $1="$$1 $i"
|
||||
+ fi
|
||||
+ done
|
||||
+ fi
|
||||
+])dnl
|
||||
+
|
||||
+dnl
|
||||
+dnl TS_ADDTO_RPATH(path)
|
||||
+dnl
|
||||
+dnl Adds path to variable with the '-rpath' directive.
|
||||
+dnl
|
||||
+AC_DEFUN([TS_ADDTO_RPATH], [
|
||||
+ AC_MSG_NOTICE([adding $1 to RPATH])
|
||||
+ TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R$1])
|
||||
+])dnl
|
||||
+
|
||||
+dnl
|
||||
+dnl pcre2.m4: Trafficserver's pcre2 autoconf macros
|
||||
+dnl
|
||||
+
|
||||
+dnl
|
||||
+dnl TS_CHECK_PCRE2: look for pcre2 libraries and headers
|
||||
+dnl
|
||||
+AC_DEFUN([TS_CHECK_PCRE2], [
|
||||
+enable_pcre2=no
|
||||
+AC_ARG_WITH(pcre2, [AC_HELP_STRING([--with-pcre2=DIR],[use a specific pcre2 library])],
|
||||
+[
|
||||
+ if test "x$withval" != "xyes" && test "x$withval" != "x"; then
|
||||
+ pcre2_base_dir="$withval"
|
||||
+ if test "$withval" != "no"; then
|
||||
+ enable_pcre2=yes
|
||||
+ case "$withval" in
|
||||
+ *":"*)
|
||||
+ pcre2_include="`echo $withval |sed -e 's/:.*$//'`"
|
||||
+ pcre2_ldflags="`echo $withval |sed -e 's/^.*://'`"
|
||||
+ AC_MSG_CHECKING(checking for pcre2 includes in $pcre2_include libs in $pcre2_ldflags )
|
||||
+ ;;
|
||||
+ *)
|
||||
+ pcre2_include="$withval/include"
|
||||
+ pcre2_ldflags="$withval/lib"
|
||||
+ AC_MSG_CHECKING(checking for pcre2 includes in $withval)
|
||||
+ ;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ fi
|
||||
+],
|
||||
+[
|
||||
+ AC_CHECK_PROG(PCRE2_CONFIG, pcre2-config, pcre2-config)
|
||||
+ if test "x$PCRE2_CONFIG" != "x"; then
|
||||
+ enable_pcre2=yes
|
||||
+ pcre2_base_dir="`$PCRE2_CONFIG --prefix`"
|
||||
+ pcre2_include="`$PCRE2_CONFIG --cflags | sed -es/-I//`"
|
||||
+ pcre2_ldflags="`$PCRE2_CONFIG --libs8 | sed -es/-lpcre2-8// -es/-L//`"
|
||||
+ fi
|
||||
+])
|
||||
+
|
||||
+if test "x$pcre2_base_dir" = "x"; then
|
||||
+ AC_MSG_CHECKING([for pcre2 location])
|
||||
+ AC_CACHE_VAL(ats_cv_pcre2_dir,[
|
||||
+ for dir in /usr/local /usr ; do
|
||||
+ if test -d $dir && ( test -f $dir/include/pcre2.h || test -f $dir/include/pcre2/pcre2.h ); then
|
||||
+ ats_cv_pcre2_dir=$dir
|
||||
+ break
|
||||
+ fi
|
||||
+ done
|
||||
+ ])
|
||||
+ pcre2_base_dir=$ats_cv_pcre2_dir
|
||||
+ if test "x$pcre2_base_dir" = "x"; then
|
||||
+ enable_pcre2=no
|
||||
+ AC_MSG_RESULT([not found])
|
||||
+ else
|
||||
+ enable_pcre2=yes
|
||||
+ pcre2_include="$pcre2_base_dir/include"
|
||||
+ pcre2_ldflags="$pcre2_base_dir/lib"
|
||||
+ AC_MSG_RESULT([$pcre2_base_dir])
|
||||
+ fi
|
||||
+else
|
||||
+ AC_MSG_CHECKING(for pcre2 headers in $pcre2_include)
|
||||
+ if test -d $pcre2_include && test -d $pcre2_ldflags && ( test -f $pcre2_include/pcre2.h || test -f $pcre2_include/pcre2/pcre2.h ); then
|
||||
+ AC_MSG_RESULT([ok])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([not found])
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+pcre2h=0
|
||||
+pcre2_pcre2h=0
|
||||
+if test "$enable_pcre2" != "no"; then
|
||||
+ saved_ldflags=$LDFLAGS
|
||||
+ saved_cppflags=$CFLAGS
|
||||
+ pcre2_have_headers=0
|
||||
+ pcre2_have_libs=0
|
||||
+ if test "$pcre2_base_dir" != "/usr"; then
|
||||
+ TS_ADDTO(CFLAGS, [-I${pcre2_include}])
|
||||
+ TS_ADDTO(CFLAGS, [-DPCRE2_STATIC])
|
||||
+ TS_ADDTO(LDFLAGS, [-L${pcre2_ldflags}])
|
||||
+ TS_ADDTO_RPATH(${pcre2_ldflags})
|
||||
+ fi
|
||||
+ AC_SEARCH_LIBS([pcre2_match_8], [pcre2-8], [pcre2_have_libs=1])
|
||||
+ if test "$pcre2_have_libs" != "0"; then
|
||||
+ AC_MSG_CHECKING([pcre2.h])
|
||||
+ AC_COMPILE_IFELSE(
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+ [[
|
||||
+#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
+#include <pcre2.h>
|
||||
+ ]],
|
||||
+ [[
|
||||
+ ]]
|
||||
+ )],
|
||||
+ [pcre2_have_headers=1
|
||||
+ AC_MSG_RESULT([ok])],
|
||||
+ [AC_MSG_RESULT([not found])]
|
||||
+ )
|
||||
+
|
||||
+ AC_MSG_CHECKING([pcre2/pcre2.h])
|
||||
+ AC_COMPILE_IFELSE(
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+ [[
|
||||
+#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
+#include <pcre2/pcre2.h>
|
||||
+ ]],
|
||||
+ [[
|
||||
+ ]]
|
||||
+ )],
|
||||
+ [pcre2_have_headers=1
|
||||
+ AC_MSG_RESULT([ok])],
|
||||
+ [AC_MSG_RESULT([not found])]
|
||||
+ )
|
||||
+ fi
|
||||
+ if test "$pcre2_have_headers" != "0"; then
|
||||
+ AC_DEFINE(HAVE_LIBPCRE2,1,[Compiling with pcre2 support])
|
||||
+ AC_SUBST(LIBPCRE2, [-lpcre2-8])
|
||||
+ else
|
||||
+ enable_pcre2=no
|
||||
+ CFLAGS=$saved_cppflags
|
||||
+ LDFLAGS=$saved_ldflags
|
||||
+ fi
|
||||
+fi
|
||||
+AC_SUBST(pcre2h)
|
||||
+AC_SUBST(pcre2_pcre2h)
|
||||
+])
|
||||
--- a/src/rule.c
|
||||
+++ b/src/rule.c
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2011 and 2012, Dustin Lundquist <dustin@null-ptr.net>
|
||||
* Copyright (c) 2011 Manuel Kasper <mk@neon1.net>
|
||||
+ * Copyright (c) 2017 Syrone Wong <wong.syrone@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -74,18 +75,37 @@ add_rule(struct cork_dllist *rules, rule
|
||||
cork_dllist_add(rules, &rule->entries);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * XXX: As pattern and subject are char arguments, they can be straightforwardly
|
||||
+ * cast to PCRE2_SPTR as we are working in 8-bit code units.
|
||||
+ */
|
||||
+
|
||||
int
|
||||
init_rule(rule_t *rule)
|
||||
{
|
||||
if (rule->pattern_re == NULL) {
|
||||
- const char *reerr;
|
||||
- int reerroffset;
|
||||
+ int errornumber;
|
||||
+ PCRE2_SIZE erroroffset;
|
||||
+ rule->pattern_re = pcre2_compile(
|
||||
+ (PCRE2_SPTR)rule->pattern, /* the pattern */
|
||||
+ PCRE2_ZERO_TERMINATED, /* indicates pattern is zero-terminated */
|
||||
+ 0, /* default options */
|
||||
+ &errornumber, /* for error number */
|
||||
+ &erroroffset, /* for error offset */
|
||||
+ NULL); /* use default compile context */
|
||||
|
||||
- rule->pattern_re =
|
||||
- pcre_compile(rule->pattern, 0, &reerr, &reerroffset, NULL);
|
||||
if (rule->pattern_re == NULL) {
|
||||
- LOGE("Regex compilation of \"%s\" failed: %s, offset %d",
|
||||
- rule->pattern, reerr, reerroffset);
|
||||
+ PCRE2_UCHAR errbuffer[512];
|
||||
+ pcre2_get_error_message(errornumber, errbuffer, sizeof(errbuffer));
|
||||
+ LOGE("PCRE2 regex compilation failed at offset %d: %s\n", (int)erroroffset,
|
||||
+ errbuffer);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ rule->pattern_re_match_data = pcre2_match_data_create_from_pattern(rule->pattern_re, NULL);
|
||||
+
|
||||
+ if (rule->pattern_re_match_data == NULL) {
|
||||
+ ERROR("PCRE2: the memory for the block could not be obtained");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -105,8 +125,15 @@ lookup_rule(const struct cork_dllist *ru
|
||||
|
||||
cork_dllist_foreach_void(rules, curr, next) {
|
||||
rule_t *rule = cork_container_of(curr, rule_t, entries);
|
||||
- if (pcre_exec(rule->pattern_re, NULL,
|
||||
- name, name_len, 0, 0, NULL, 0) >= 0)
|
||||
+ if (pcre2_match(
|
||||
+ rule->pattern_re, /* the compiled pattern */
|
||||
+ (PCRE2_SPTR)name, /* the subject string */
|
||||
+ name_len, /* the length of the subject */
|
||||
+ 0, /* start at offset 0 in the subject */
|
||||
+ 0, /* default options */
|
||||
+ rule->pattern_re_match_data, /* block for storing the result */
|
||||
+ NULL /* use default match context */
|
||||
+ ) >= 0)
|
||||
return rule;
|
||||
}
|
||||
|
||||
@@ -127,7 +154,13 @@ free_rule(rule_t *rule)
|
||||
return;
|
||||
|
||||
ss_free(rule->pattern);
|
||||
- if (rule->pattern_re != NULL)
|
||||
- pcre_free(rule->pattern_re);
|
||||
+ if (rule->pattern_re != NULL) {
|
||||
+ pcre2_code_free(rule->pattern_re); /* data and the compiled pattern. */
|
||||
+ rule->pattern_re = NULL;
|
||||
+ }
|
||||
+ if (rule->pattern_re_match_data != NULL) {
|
||||
+ pcre2_match_data_free(rule->pattern_re_match_data); /* Release memory used for the match */
|
||||
+ rule->pattern_re_match_data = NULL;
|
||||
+ }
|
||||
ss_free(rule);
|
||||
}
|
||||
--- a/src/rule.h
|
||||
+++ b/src/rule.h
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2011 and 2012, Dustin Lundquist <dustin@null-ptr.net>
|
||||
* Copyright (c) 2011 Manuel Kasper <mk@neon1.net>
|
||||
+ * Copyright (c) 2017 Syrone Wong <wong.syrone@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -33,17 +34,27 @@
|
||||
|
||||
#include <libcork/ds.h>
|
||||
|
||||
-#ifdef HAVE_PCRE_H
|
||||
-#include <pcre.h>
|
||||
-#elif HAVE_PCRE_PCRE_H
|
||||
-#include <pcre/pcre.h>
|
||||
-#endif
|
||||
+/*
|
||||
+ * The PCRE2_CODE_UNIT_WIDTH macro must be defined before including pcre2.h.
|
||||
+ * For a program that uses only one code unit width, setting it to 8, 16, or 32
|
||||
+ * makes it possible to use generic function names such as pcre2_compile(). Note
|
||||
+ * that just changing 8 to 16 (for example) is not sufficient to convert this
|
||||
+ * program to process 16-bit characters. Even in a fully 16-bit environment, where
|
||||
+ * string-handling functions such as strcmp() and printf() work with 16-bit
|
||||
+ * characters, the code for handling the table of named substrings will still need
|
||||
+ * to be modified.
|
||||
+ */
|
||||
+/* we only need to support ASCII chartable, thus set it to 8 */
|
||||
+#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
+
|
||||
+#include <pcre2.h>
|
||||
|
||||
typedef struct rule {
|
||||
char *pattern;
|
||||
|
||||
/* Runtime fields */
|
||||
- pcre *pattern_re;
|
||||
+ pcre2_code *pattern_re;
|
||||
+ pcre2_match_data *pattern_re_match_data;
|
||||
|
||||
struct cork_dllist_item entries;
|
||||
} rule_t;
|
|
@ -1,12 +1,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sing-box
|
||||
PKG_VERSION:=1.5.2
|
||||
PKG_VERSION:=1.5.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=ad344a5fe0a515e3e5d0ab8102482b4a3d38932cf754756e1d48db17d36a5609
|
||||
PKG_HASH:=3238492e21246b56ef80e99f321c26ffaf9ac8877c916dce85273b61031c58b7
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=snowflake
|
||||
PKG_VERSION:=2.6.1
|
||||
PKG_VERSION:=2.7.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=c6a7ef515bae874c42220ab52dd597c08df4569e7d97f700e5c80c8946e205bd
|
||||
PKG_MIRROR_HASH:=3156dbeffaea82761372c7e64322cf9c24a05894c54ccb0d80eaed61b54e08c6
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
@ -41,11 +41,6 @@ $(call Package/snowflake/Default)
|
|||
TITLE+= Client
|
||||
endef
|
||||
|
||||
define Package/snowflake-distinctcounter
|
||||
$(call Package/snowflake/Default)
|
||||
TITLE+= Distinct Counter
|
||||
endef
|
||||
|
||||
define Package/snowflake-probetest
|
||||
$(call Package/snowflake/Default)
|
||||
TITLE+= Probe test
|
||||
|
@ -81,12 +76,6 @@ $(call Package/snowflake/description/Default)
|
|||
This package contains the Snowflake client which provides the bridge to TOR.
|
||||
endef
|
||||
|
||||
define Package/snowflake-distinctcounter/description
|
||||
$(call Package/snowflake/description/Default)
|
||||
|
||||
This package provides the Snowflake distinct counter service.
|
||||
endef
|
||||
|
||||
define Package/snowflake-probetest/description
|
||||
$(call Package/snowflake/description/Default)
|
||||
|
||||
|
@ -115,11 +104,6 @@ define Package/snowflake-client/install
|
|||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/client $(1)/usr/bin/snowflake-client
|
||||
endef
|
||||
|
||||
define Package/snowflake-distinctcounter/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/distinctcounter $(1)/usr/bin/snowflake-distinctcounter
|
||||
endef
|
||||
|
||||
define Package/snowflake-probetest/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/probetest $(1)/usr/bin/snowflake-probetest
|
||||
|
@ -138,7 +122,6 @@ endef
|
|||
|
||||
$(eval $(call BuildPackage,snowflake-broker))
|
||||
$(eval $(call BuildPackage,snowflake-client))
|
||||
$(eval $(call BuildPackage,snowflake-distinctcounter))
|
||||
$(eval $(call BuildPackage,snowflake-probetest))
|
||||
$(eval $(call BuildPackage,snowflake-proxy))
|
||||
$(eval $(call BuildPackage,snowflake-server))
|
||||
|
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=tor
|
||||
PKG_VERSION:=0.4.8.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://dist.torproject.org/ \
|
||||
|
|
|
@ -32,7 +32,7 @@ generate_conf() {
|
|||
}
|
||||
|
||||
reload_service() {
|
||||
procd_send_signal /usr/sbin/tor
|
||||
procd_send_signal tor
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=transmission
|
||||
PKG_VERSION:=4.0.3
|
||||
PKG_RELEASE:=5
|
||||
PKG_VERSION:=4.0.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/transmission/transmission/releases/download/$(PKG_VERSION)/
|
||||
PKG_HASH:=b6b01fd58e42bb14f7aba0253db932ced050fcd2bba5d9f8469d77ddd8ad545a
|
||||
PKG_HASH:=15f7b4318fdfbffb19aa8d9a6b0fd89348e6ef1e86baa21a0806ffd1893bd5a6
|
||||
|
||||
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=travelmate
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
|
|
@ -32,7 +32,7 @@ To avoid these kind of deadlocks, travelmate will set all station interfaces to
|
|||
* status & debug logging to syslog
|
||||
|
||||
## Prerequisites
|
||||
* [OpenWrt](https://openwrt.org), only compatible with the forthcoming stable 20.x or the latest OpenWrt snapshot
|
||||
* [OpenWrt](https://openwrt.org), tested/compatible with current stable 23.x and latest OpenWrt snapshot
|
||||
* 'dnsmasq' as dns backend
|
||||
* 'iwinfo' for wlan scanning
|
||||
* 'curl' for connection checking and all kinds of captive portal magic, e.g. cp detection and auto-logins
|
||||
|
@ -83,6 +83,9 @@ To avoid these kind of deadlocks, travelmate will set all station interfaces to
|
|||
| trm_mailsender | no-reply@travelmate | e-mail sender address for travelmate notifications |
|
||||
| trm_mailtopic | travelmate connection to '<sta>' | topic for travelmate notification E-Mails |
|
||||
| trm_mailprofile | trm_notify | profile used by 'msmtp' for travelmate notification E-Mails |
|
||||
| trm_stdvpnservice | -, not set | standard vpn service which will be automatically added to new STA profiles |
|
||||
| trm_stdvpniface | -, not set | standard vpn interface which will be automatically added to new STA profiles |
|
||||
|
||||
|
||||
* per uplink exist an additional 'uplink' section in the travelmate config, with the following options:
|
||||
|
||||
|
@ -110,6 +113,7 @@ Please follow one of the following guides to get a working vpn client setup on y
|
|||
* [Wireguard client setup guide](https://openwrt.org/docs/guide-user/services/vpn/wireguard/client)
|
||||
* [OpenVPN client setup guide](https://openwrt.org/docs/guide-user/services/vpn/openvpn/client)
|
||||
|
||||
**Please note:** Make sure to uncheck the "Bring up on boot" option during vpn interface setup, so that netifd doesn't interfere with travelmate.
|
||||
Once your vpn client connection is running, you can reference to that setup in travelmate to handle VPN (re-) connections automatically.
|
||||
|
||||
## E-Mail setup
|
||||
|
@ -161,18 +165,18 @@ Hopefully more scripts for different captive portals will be provided by the com
|
|||
|
||||
**receive travelmate runtime information:**
|
||||
<pre><code>
|
||||
root@2go_ar750s:~# /etc/init.d/travelmate status
|
||||
root@2go:~# /etc/init.d/travelmate status
|
||||
::: travelmate runtime information
|
||||
+ travelmate_status : connected (net ok/100)
|
||||
+ travelmate_version : 2.0.0
|
||||
+ station_id : radio1/WIFIonICE/-
|
||||
+ station_mac : B2:9D:F5:96:86:A4
|
||||
+ station_interface : trm_wwan
|
||||
+ travelmate_status : connected (net ok/51)
|
||||
+ travelmate_version : 2.1.1
|
||||
+ station_id : radio0/403 Forbidden/00:0C:46:24:50:00
|
||||
+ station_mac : 94:83:C4:24:0E:4F
|
||||
+ station_interfaces : trm_wwan, wg0
|
||||
+ wpa_flags : sae: ✔, owe: ✔, eap: ✔, suiteb192: ✔
|
||||
+ run_flags : captive: ✔, proactive: ✔, netcheck: ✘, autoadd: ✘, randomize: ✔
|
||||
+ ext_hooks : ntp: ✔, vpn: ✘, mail: ✘
|
||||
+ last_run : 2020.09.10-15:21:19
|
||||
+ system : GL.iNet GL-AR750S (NOR/NAND), OpenWrt SNAPSHOT r14430-2dda301d40
|
||||
+ ext_hooks : ntp: ✔, vpn: ✔, mail: ✘
|
||||
+ last_run : 2023.10.21-14:29:14
|
||||
+ system : GL.iNet GL-A1300, OpenWrt SNAPSHOT r24187-bb8fd41f9a
|
||||
</code></pre>
|
||||
|
||||
To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and check the system log afterwards (_logread -e "trm-"_)
|
||||
|
@ -182,7 +186,7 @@ Please join the travelmate discussion in this [forum thread](https://forum.lede-
|
|||
|
||||
## Removal
|
||||
* stop the travelmate daemon with _/etc/init.d/travelmate stop_
|
||||
* optional: remove the travelmate package (_opkg remove luci-app-travelmate_, _opkg remove travelmate_)
|
||||
* remove the travelmate package (_opkg remove luci-app-travelmate_, _opkg remove travelmate_)
|
||||
|
||||
Have fun!
|
||||
Dirk
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/bin/sh
|
||||
# travelmate, a wlan connection manager for travel router
|
||||
# Copyright (c) 2016-2022 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2016-2023 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
# shellcheck disable=1091,2086,3040,3043,3057,3060
|
||||
# shellcheck disable=all
|
||||
|
||||
export LC_ALL=C
|
||||
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
trm_ver="2.1.0"
|
||||
trm_ver="2.1.1"
|
||||
trm_enabled="0"
|
||||
trm_debug="0"
|
||||
trm_iface=""
|
||||
|
@ -34,6 +34,8 @@ trm_wpaflags=""
|
|||
trm_ovpninfolist=""
|
||||
trm_vpnifacelist=""
|
||||
trm_vpninfolist=""
|
||||
trm_stdvpnservice=""
|
||||
trm_stdvpniface=""
|
||||
trm_rtfile="/tmp/trm_runtime.json"
|
||||
trm_wifi="$(command -v wifi)"
|
||||
trm_fetch="$(command -v curl)"
|
||||
|
@ -41,7 +43,7 @@ trm_iwinfo="$(command -v iwinfo)"
|
|||
trm_logger="$(command -v logger)"
|
||||
trm_wpa="$(command -v wpa_supplicant)"
|
||||
trm_captiveurl="http://detectportal.firefox.com"
|
||||
trm_useragent="Mozilla/5.0 (Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
|
||||
trm_useragent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0"
|
||||
trm_ntpfile="/var/state/travelmate.ntp"
|
||||
trm_vpnfile="/var/state/travelmate.vpn"
|
||||
trm_mailfile="/var/state/travelmate.mail"
|
||||
|
@ -58,7 +60,7 @@ f_env() {
|
|||
return
|
||||
fi
|
||||
|
||||
unset trm_stalist trm_radiolist trm_uplinklist trm_uplinkcfg trm_activesta trm_opensta
|
||||
unset trm_stalist trm_radiolist trm_uplinklist trm_vpnifacelist trm_uplinkcfg trm_activesta trm_opensta
|
||||
|
||||
trm_sysver="$(ubus -S call system board 2>/dev/null | jsonfilter -q -e '@.model' -e '@.release.description' |
|
||||
awk 'BEGIN{RS="";FS="\n"}{printf "%s, %s",$1,$2}')"
|
||||
|
@ -213,9 +215,6 @@ f_vpn() {
|
|||
f_log "info" "take down vpn interface '${iface}/${vpn_instance:-"-"}' (initial)"
|
||||
fi
|
||||
done
|
||||
if [ -f "/etc/init.d/sysntpd" ]; then
|
||||
/etc/init.d/sysntpd restart >/dev/null 2>&1
|
||||
fi
|
||||
rm -f "${trm_vpnfile}"
|
||||
elif [ "${vpn}" = "1" ] && [ -n "${vpn_iface}" ] && [ "${vpn_action}" = "enable_keep" ]; then
|
||||
for info in ${trm_vpninfolist}; do
|
||||
|
@ -235,7 +234,7 @@ f_vpn() {
|
|||
fi
|
||||
if [ -x "${trm_vpnpgm}" ] && [ -n "${vpn_service}" ] && [ -n "${vpn_iface}" ]; then
|
||||
if { [ "${vpn_action}" = "disable" ] && [ -f "${trm_vpnfile}" ]; } ||
|
||||
{ [ -f "${trm_ntpfile}" ] && { [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ] && [ ! -f "${trm_vpnfile}" ]; } ||
|
||||
{ [ -s "${trm_ntpfile}" ] && { [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ] && [ ! -f "${trm_vpnfile}" ]; } ||
|
||||
{ [ "${vpn}" != "1" ] && [ "${vpn_action%_*}" = "enable" ] && [ -f "${trm_vpnfile}" ]; }; }; then
|
||||
result="$(f_net)"
|
||||
if [ "${result}" = "net ok" ] || [ "${vpn_action}" = "disable" ]; then
|
||||
|
@ -298,22 +297,22 @@ f_ctrack() {
|
|||
"start")
|
||||
uci_remove "travelmate" "${trm_uplinkcfg}" "con_start" 2>/dev/null
|
||||
uci_remove "travelmate" "${trm_uplinkcfg}" "con_end" 2>/dev/null
|
||||
if [ -f "${trm_ntpfile}" ]; then
|
||||
if [ -s "${trm_ntpfile}" ]; then
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "con_start" "$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
fi
|
||||
;;
|
||||
"refresh")
|
||||
if [ -f "${trm_ntpfile}" ] && [ -z "$(uci_get "travelmate" "${trm_uplinkcfg}" "con_start")" ]; then
|
||||
if [ -s "${trm_ntpfile}" ] && [ -z "$(uci_get "travelmate" "${trm_uplinkcfg}" "con_start")" ]; then
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "con_start" "$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
fi
|
||||
;;
|
||||
"end")
|
||||
if [ -f "${trm_ntpfile}" ]; then
|
||||
if [ -s "${trm_ntpfile}" ]; then
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "con_end" "$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
fi
|
||||
;;
|
||||
"start_expiry")
|
||||
if [ -f "${trm_ntpfile}" ]; then
|
||||
if [ -s "${trm_ntpfile}" ]; then
|
||||
expiry="$(uci_get "travelmate" "${trm_uplinkcfg}" "con_start_expiry")"
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "enabled" "0"
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "con_end" "$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
|
@ -321,7 +320,7 @@ f_ctrack() {
|
|||
fi
|
||||
;;
|
||||
"end_expiry")
|
||||
if [ -f "${trm_ntpfile}" ]; then
|
||||
if [ -s "${trm_ntpfile}" ]; then
|
||||
expiry="$(uci_get "travelmate" "${trm_uplinkcfg}" "con_end_expiry")"
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "enabled" "1"
|
||||
uci_remove "travelmate" "${trm_uplinkcfg}" "con_start" 2>/dev/null
|
||||
|
@ -331,7 +330,7 @@ f_ctrack() {
|
|||
;;
|
||||
"disabled")
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "enabled" "0"
|
||||
if [ -f "${trm_ntpfile}" ]; then
|
||||
if [ -s "${trm_ntpfile}" ]; then
|
||||
uci_set "travelmate" "${trm_uplinkcfg}" "con_end" "$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
fi
|
||||
;;
|
||||
|
@ -536,7 +535,7 @@ f_setif() {
|
|||
# add open uplinks
|
||||
#
|
||||
f_addsta() {
|
||||
local uci_cfg new_uplink="1" offset="1" radio="${1}" essid="${2}"
|
||||
local wifi_cfg trm_cfg new_uplink="1" offset="1" radio="${1}" essid="${2}"
|
||||
|
||||
if [ "${trm_maxautoadd}" = "0" ] || [ "${trm_opensta:-0}" -lt "${trm_maxautoadd}" ]; then
|
||||
config_cb() {
|
||||
|
@ -557,30 +556,36 @@ f_addsta() {
|
|||
fi
|
||||
|
||||
if [ "${new_uplink}" = "1" ]; then
|
||||
uci_cfg="trm_uplink$((offset + 1))"
|
||||
while [ -n "$(uci_get "wireless.${uci_cfg}")" ]; do
|
||||
wifi_cfg="trm_uplink$((offset + 1))"
|
||||
while [ -n "$(uci_get "wireless.${wifi_cfg}")" ]; do
|
||||
offset="$((offset + 1))"
|
||||
uci_cfg="trm_uplink${offset}"
|
||||
wifi_cfg="trm_uplink${offset}"
|
||||
done
|
||||
uci -q batch <<-EOC
|
||||
set wireless."${uci_cfg}"="wifi-iface"
|
||||
set wireless."${uci_cfg}".mode="sta"
|
||||
set wireless."${uci_cfg}".network="${trm_iface}"
|
||||
set wireless."${uci_cfg}".device="${radio}"
|
||||
set wireless."${uci_cfg}".ssid="${essid}"
|
||||
set wireless."${uci_cfg}".encryption="none"
|
||||
set wireless."${uci_cfg}".disabled="1"
|
||||
set wireless."${wifi_cfg}"="wifi-iface"
|
||||
set wireless."${wifi_cfg}".mode="sta"
|
||||
set wireless."${wifi_cfg}".network="${trm_iface}"
|
||||
set wireless."${wifi_cfg}".device="${radio}"
|
||||
set wireless."${wifi_cfg}".ssid="${essid}"
|
||||
set wireless."${wifi_cfg}".encryption="none"
|
||||
set wireless."${wifi_cfg}".disabled="1"
|
||||
EOC
|
||||
uci_cfg="$(uci -q add travelmate uplink)"
|
||||
trm_cfg="$(uci -q add travelmate uplink)"
|
||||
uci -q batch <<-EOC
|
||||
set travelmate."${uci_cfg}".device="${radio}"
|
||||
set travelmate."${uci_cfg}".ssid="${essid}"
|
||||
set travelmate."${uci_cfg}".opensta="1"
|
||||
set travelmate."${uci_cfg}".con_start_expiry="0"
|
||||
set travelmate."${uci_cfg}".con_end_expiry="0"
|
||||
set travelmate."${uci_cfg}".enabled="1"
|
||||
set travelmate."${trm_cfg}".device="${radio}"
|
||||
set travelmate."${trm_cfg}".ssid="${essid}"
|
||||
set travelmate."${trm_cfg}".opensta="1"
|
||||
set travelmate."${trm_cfg}".con_start_expiry="0"
|
||||
set travelmate."${trm_cfg}".con_end_expiry="0"
|
||||
set travelmate."${trm_cfg}".enabled="1"
|
||||
EOC
|
||||
if [ -n "$(uci -q changes "travelmate")" ] || [ -n "$(uci -q changes "wireless")" ]; then
|
||||
if [ -n "${trm_stdvpnservice}" ] && [ -n "${trm_stdvpniface}" ]; then
|
||||
uci -q batch <<-EOC
|
||||
set travelmate."${trm_cfg}".vpnservice="${trm_stdvpnservice}"
|
||||
set travelmate."${trm_cfg}".vpniface="${trm_stdvpniface}"
|
||||
set travelmate."${trm_cfg}".vpn="1"
|
||||
EOC
|
||||
fi
|
||||
trm_opensta="$((trm_opensta + 1))"
|
||||
uci_commit "travelmate"
|
||||
uci_commit "wireless"
|
||||
|
@ -589,7 +594,7 @@ f_addsta() {
|
|||
printf "%s" "ui_reload" >"${trm_refreshfile}"
|
||||
fi
|
||||
f_log "info" "open uplink '${radio}/${essid}' added to wireless config"
|
||||
fi
|
||||
printf "%s" "${wifi_cfg}-${radio}"
|
||||
fi
|
||||
f_log "debug" "f_addsta ::: radio: ${radio:-"-"}, essid: ${essid}, opensta/maxautoadd: ${trm_opensta:-"-"}/${trm_maxautoadd:-"-"}, new_uplink: ${new_uplink}, offset: ${offset}"
|
||||
}
|
||||
|
@ -643,7 +648,7 @@ f_net() {
|
|||
# check interface status
|
||||
#
|
||||
f_check() {
|
||||
local ifname radio dev_status result login_script login_script_args cp_domain wait_time="1" enabled="1" mode="${1}" status="${2}" sta_radio="${3}" sta_essid="${4}" sta_bssid="${5}"
|
||||
local ifname radio dev_status result login_script login_script_args cp_domain wait_time="0" enabled="1" mode="${1}" status="${2}" sta_radio="${3}" sta_essid="${4}" sta_bssid="${5}"
|
||||
|
||||
if [ "${mode}" = "initial" ] || [ "${mode}" = "dev" ]; then
|
||||
json_get_var station_id "station_id"
|
||||
|
@ -663,6 +668,8 @@ f_check() {
|
|||
f_wifi
|
||||
fi
|
||||
while [ "${wait_time}" -le "${trm_maxwait}" ]; do
|
||||
[ "${wait_time}" -gt "0" ] && sleep 1
|
||||
wait_time="$((wait_time + 1))"
|
||||
dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
|
||||
if [ -n "${dev_status}" ]; then
|
||||
if [ "${mode}" = "dev" ]; then
|
||||
|
@ -681,8 +688,10 @@ f_check() {
|
|||
else
|
||||
ifname="$(printf "%s" "${dev_status}" | jsonfilter -q -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
|
||||
if [ -n "${ifname}" ] && [ "${enabled}" = "1" ]; then
|
||||
trm_ifquality="$(${trm_iwinfo} "${ifname}" info 2>/dev/null | awk -F '[ ]' '/Link Quality:/{split($NF,var0,"/");printf "%i\n",(var0[1]*100/var0[2])}')"
|
||||
if [ "${trm_ifquality}" -ge "${trm_minquality}" ]; then
|
||||
trm_ifquality="$(${trm_iwinfo} "${ifname}" info 2>/dev/null | awk -F '[ ]' '/Link Quality: [0-9]+\/[0-9]+/{split($NF,var0,"/");printf "%i\n",(var0[1]*100/var0[2])}')"
|
||||
if [ -z "${trm_ifquality}" ]; then
|
||||
continue
|
||||
elif [ "${trm_ifquality}" -ge "${trm_minquality}" ]; then
|
||||
trm_ifstatus="$(ubus -S call network.interface dump 2>/dev/null | jsonfilter -q -l1 -e "@.interface[@.device=\"${ifname}\"].up")"
|
||||
if [ "${trm_ifstatus}" = "true" ]; then
|
||||
result="$(f_net)"
|
||||
|
@ -768,8 +777,6 @@ f_check() {
|
|||
f_jsnup
|
||||
break
|
||||
fi
|
||||
wait_time="$((wait_time + 1))"
|
||||
sleep 1
|
||||
done
|
||||
f_log "debug" "f_check ::: mode: ${mode}, name: ${ifname:-"-"}, status: ${trm_ifstatus}, enabled: ${enabled}, connection: ${trm_connection:-"-"}, wait: ${wait_time}, max_wait: ${trm_maxwait}, min_quality: ${trm_minquality}, captive: ${trm_captive}, netcheck: ${trm_netcheck}"
|
||||
}
|
||||
|
@ -777,7 +784,7 @@ f_check() {
|
|||
# update runtime information
|
||||
#
|
||||
f_jsnup() {
|
||||
local vpn vpn_iface section last_date last_station sta_iface sta_radio sta_essid sta_bssid sta_mac dev_status last_status status="${trm_ifstatus}" ntp_done="0" vpn_done="0" mail_done="0"
|
||||
local vpn vpn_iface section last_date sta_iface sta_radio sta_essid sta_bssid sta_mac dev_status status="${trm_ifstatus}" ntp_done="0" vpn_done="0" mail_done="0"
|
||||
|
||||
if [ "${status}" = "true" ]; then
|
||||
status="connected (${trm_connection:-"-"})"
|
||||
|
@ -792,16 +799,7 @@ f_jsnup() {
|
|||
f_getcfg "${sta_radio}" "${sta_essid}" "${sta_bssid}"
|
||||
fi
|
||||
json_get_var last_date "last_run"
|
||||
json_get_var last_station "station_id"
|
||||
json_get_var last_status "travelmate_status"
|
||||
|
||||
if { [ -f "${trm_ntpfile}" ] && [ ! -s "${trm_ntpfile}" ]; } || [ "${last_status}" = "running (not connected)" ] ||
|
||||
{ [ -n "${last_station}" ] && [ "${last_station}" != "${sta_radio:-"-"}/${sta_essid:-"-"}/${sta_bssid:-"-"}" ]; }; then
|
||||
last_date="$(date "+%Y.%m.%d-%H:%M:%S")"
|
||||
if [ -f "${trm_ntpfile}" ] && [ ! -s "${trm_ntpfile}" ]; then
|
||||
printf "%s" "${last_date}" >"${trm_ntpfile}"
|
||||
fi
|
||||
fi
|
||||
vpn="$(f_getval "vpn")"
|
||||
if [ "${trm_vpn}" = "1" ] && [ -n "${trm_vpninfolist}" ] && [ "${vpn}" = "1" ] && [ -f "${trm_vpnfile}" ]; then
|
||||
vpn_iface="$(f_getval "vpniface")"
|
||||
|
@ -942,6 +940,18 @@ f_main() {
|
|||
if [ -n "${scan_quality}" ] && [ -n "${scan_open}" ] && [ -n "${scan_bssid}" ] && [ -n "${scan_essid}" ]; then
|
||||
f_log "debug" "f_main-7 ::: radio(sta/scan): ${sta_radio}/${radio}, essid(sta/scan): \"${sta_essid}\"/${scan_essid}, bssid(sta/scan): ${sta_bssid}/${scan_bssid}, quality(min/scan): ${trm_minquality}/${scan_quality}, open: ${scan_open}"
|
||||
if [ "${scan_quality}" -ge "${trm_minquality}" ]; then
|
||||
if [ "${trm_autoadd}" = "1" ] && [ "${scan_open}" = "+" ] && [ "${scan_essid}" != "unknown" ]; then
|
||||
open_essid="${scan_essid%?}"
|
||||
open_essid="${open_essid:1}"
|
||||
result="$(f_addsta "${radio}" "${open_essid}")"
|
||||
if [ -n "${result}" ]; then
|
||||
section="${result%%-*}"
|
||||
sta_radio="$(uci_get "wireless" "${section}" "device")"
|
||||
sta_essid="$(uci_get "wireless" "${section}" "ssid")"
|
||||
sta_bssid=""
|
||||
sta_mac=""
|
||||
fi
|
||||
fi
|
||||
if { { [ "${scan_essid}" = "\"${sta_essid}\"" ] && { [ -z "${sta_bssid}" ] || [ "${scan_bssid}" = "${sta_bssid}" ]; }; } ||
|
||||
{ [ "${scan_bssid}" = "${sta_bssid}" ] && [ "${scan_essid}" = "unknown" ]; }; } && [ "${radio}" = "${sta_radio}" ]; then
|
||||
if [ -n "${config_radio}" ]; then
|
||||
|
@ -984,10 +994,6 @@ f_main() {
|
|||
retrycnt="$((retrycnt + 1))"
|
||||
sleep "$((trm_maxwait / 6))"
|
||||
done
|
||||
elif [ "${trm_autoadd}" = "1" ] && [ "${scan_open}" = "+" ] && [ "${scan_essid}" != "unknown" ]; then
|
||||
scan_essid="${scan_essid%?}"
|
||||
scan_essid="${scan_essid:1}"
|
||||
f_addsta "${radio}" "${scan_essid}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -1009,6 +1015,13 @@ else
|
|||
f_log "err" "system libraries not found"
|
||||
fi
|
||||
|
||||
# force ntp restart/sync
|
||||
#
|
||||
if [ -f "/etc/init.d/sysntpd" ] && [ ! -s "${trm_ntpfile}" ]; then
|
||||
/etc/init.d/sysntpd restart >/dev/null 2>&1
|
||||
f_log "debug" "ntp time sync requested"
|
||||
fi
|
||||
|
||||
# control travelmate actions
|
||||
#
|
||||
while true; do
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh
|
||||
# vpn handler called by travelmate
|
||||
# Copyright (c) 2020-2022 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2020-2023 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
# shellcheck disable=1091,3040,3043
|
||||
# shellcheck disable=all
|
||||
|
||||
# Please note: you have to setup the package 'wireguard' or 'openvpn' before using this script
|
||||
|
||||
|
@ -20,19 +20,19 @@ vpn_iface="${4}"
|
|||
vpn_instance="${5}"
|
||||
trm_maxwait="$(uci_get travelmate global trm_maxwait "30")"
|
||||
trm_captiveurl="$(uci_get travelmate global trm_captiveurl "http://detectportal.firefox.com")"
|
||||
trm_useragent="$(uci_get travelmate global trm_useragent "Mozilla/5.0 (Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0")"
|
||||
trm_useragent="$(uci_get travelmate global trm_useragent "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0")"
|
||||
trm_logger="$(command -v logger)"
|
||||
trm_fetch="$(command -v curl)"
|
||||
trm_vpnfile="/var/state/travelmate.vpn"
|
||||
|
||||
f_net() {
|
||||
local json_rc result="net nok"
|
||||
local json_rc
|
||||
|
||||
json_rc="$(${trm_fetch} --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{response_code}" --silent --output /dev/null --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
|
||||
if [ "${json_rc}" = "200" ] || [ "${json_rc}" = "204" ]; then
|
||||
result="net ok"
|
||||
json_rc="net ok"
|
||||
fi
|
||||
printf "%s" "${result}"
|
||||
printf "%s" "${json_rc}"
|
||||
}
|
||||
|
||||
if [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ]; then
|
||||
|
@ -40,6 +40,15 @@ if [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ]; then
|
|||
vpn_status="$(ubus -S call network.interface."${vpn_iface}" status 2>/dev/null | jsonfilter -q -l1 -e '@.up')"
|
||||
fi
|
||||
if [ "${vpn_action}" = "enable" ] || [ "${vpn_status}" != "true" ]; then
|
||||
if [ "${vpn_status}" != "true" ]; then
|
||||
ifdown "${vpn_iface}"
|
||||
if [ "${vpn_service}" = "openvpn" ] && [ -n "${vpn_instance}" ] && [ -x "/etc/init.d/openvpn" ] && /etc/init.d/openvpn running "${vpn_instance}"; then
|
||||
/etc/init.d/openvpn stop "${vpn_instance}"
|
||||
elif [ "${vpn_service}" = "wireguard" ]; then
|
||||
ubus -S call network.interface."${vpn_iface}" remove >/dev/null 2>&1
|
||||
fi
|
||||
sleep 1
|
||||
fi
|
||||
if [ "${vpn_service}" = "openvpn" ] && [ -n "${vpn_instance}" ] && [ -x "/etc/init.d/openvpn" ] && ! /etc/init.d/openvpn running "${vpn_instance}"; then
|
||||
/etc/init.d/openvpn start "${vpn_instance}"
|
||||
fi
|
||||
|
@ -59,9 +68,11 @@ if [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ]; then
|
|||
ifdown "${vpn_iface}"
|
||||
if [ "${vpn_service}" = "openvpn" ] && [ -n "${vpn_instance}" ] && [ -x "/etc/init.d/openvpn" ] && /etc/init.d/openvpn running "${vpn_instance}"; then
|
||||
/etc/init.d/openvpn stop "${vpn_instance}"
|
||||
elif [ "${vpn_service}" = "wireguard" ]; then
|
||||
ubus -S call network.interface."${vpn_iface}" remove >/dev/null 2>&1
|
||||
fi
|
||||
rm -f "${trm_vpnfile}"
|
||||
"${trm_logger}" -p "info" -t "trm-vpn [${$}]" "${vpn_service} client connection can't be established '${vpn_iface}/${vpn_instance:-"-"}'" 2>/dev/null
|
||||
"${trm_logger}" -p "info" -t "trm-vpn [${$}]" "${vpn_service} client connection can't be established '${vpn_iface}/${vpn_instance:-"-", rc: ${net_status:-"-"}}'" 2>/dev/null
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
|
@ -72,6 +83,8 @@ elif { [ "${vpn}" != "1" ] && [ "${vpn_action%_*}" = "enable" ]; } || [ "${vpn_a
|
|||
ifdown "${vpn_iface}"
|
||||
if [ "${vpn_service}" = "openvpn" ] && [ -n "${vpn_instance}" ] && [ -x "/etc/init.d/openvpn" ] && /etc/init.d/openvpn running "${vpn_instance}"; then
|
||||
/etc/init.d/openvpn stop "${vpn_instance}"
|
||||
elif [ "${vpn_service}" = "wireguard" ]; then
|
||||
ubus -S call network.interface."${vpn_iface}" remove >/dev/null 2>&1
|
||||
fi
|
||||
rm -f "${trm_vpnfile}"
|
||||
"${trm_logger}" -p "info" -t "trm-vpn [${$}]" "${vpn_service} client connection disabled '${vpn_iface}/${vpn_instance:-"-"}'" 2>/dev/null
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
#!/bin/sh
|
||||
# ntp hotplug script for travelmate
|
||||
# Copyright (c) 2020-2022 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2020-2023 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
# shellcheck disable=3023
|
||||
# shellcheck disable=all
|
||||
|
||||
trm_init="/etc/init.d/travelmate"
|
||||
trm_ntpfile="/var/state/travelmate.ntp"
|
||||
trm_logger="$(command -v logger)"
|
||||
|
||||
if [ "${ACTION}" = "stratum" ] && [ ! -f "${trm_ntpfile}" ] && "${trm_init}" enabled; then
|
||||
{
|
||||
if flock -xn 1001; then
|
||||
"${trm_logger}" -p "info" -t "trm-ntp [${$}]" "get ntp time sync" 2>/dev/null
|
||||
"${trm_init}" restart
|
||||
fi
|
||||
} 1001>"${trm_ntpfile}"
|
||||
if [ "${ACTION}" = "stratum" ] && [ ! -s "${trm_ntpfile}" ] && "${trm_init}" enabled; then
|
||||
printf "%s" "$(date "+%Y.%m.%d-%H:%M:%S")" > "${trm_ntpfile}"
|
||||
"${trm_logger}" -p "info" -t "trm-ntp [${$}]" "get ntp time sync"
|
||||
fi
|
||||
|
|
|
@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-2.0
|
|||
PKG_FORTIFY_SOURCE:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/acpica-unix
|
||||
|
@ -43,6 +44,25 @@ endef
|
|||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/bin
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpibin,acpidump} \
|
||||
$(STAGING_DIR_HOST)/usr/bin/
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpiexamples,acpiexec} \
|
||||
$(STAGING_DIR_HOST)/usr/bin/
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpihelp,acpisrc} \
|
||||
$(STAGING_DIR_HOST)/usr/bin/
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpixtract,iasl} \
|
||||
$(STAGING_DIR_HOST)/usr/bin/
|
||||
endef
|
||||
|
||||
define Host/Clean
|
||||
$(RM) $(STAGING_DIR_HOST)/usr/bin/{acpibin,acpidump}
|
||||
$(RM) $(STAGING_DIR_HOST)/usr/bin/{acpiexamples,acpiexec}
|
||||
$(RM) $(STAGING_DIR_HOST)/usr/bin/{acpihelp,acpisrc}
|
||||
$(RM) $(STAGING_DIR_HOST)/usr/bin/{acpixtract,iasl}
|
||||
endef
|
||||
|
||||
MAKE_VARS += HOST=_LINUX
|
||||
|
||||
MAKE_PATH:=generate/unix
|
||||
|
@ -55,3 +75,4 @@ define Package/acpica-unix/install
|
|||
endef
|
||||
|
||||
$(eval $(call BuildPackage,acpica-unix))
|
||||
$(eval $(call HostBuild))
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nerdctl
|
||||
PKG_VERSION:=1.6.0
|
||||
PKG_VERSION:=1.6.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/containerd/nerdctl/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=a369b1c517d9c3d53d00b29633a6176a05811214a44dd25d339c32cc6a901579
|
||||
PKG_HASH:=fb7660f7e598e4c502d4f0c26cf985290fc7bdc80cce1f7402020afdf83ef988
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=procs
|
||||
PKG_VERSION:=0.14.1
|
||||
PKG_VERSION:=0.14.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/dalance/procs/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=bb4f9d696081807ca105593092f8acd04ca339ae43fff29e0e820c6fc5e3f9ea
|
||||
PKG_HASH:=a3012bba984faddcf8da2a72d21eb9a7e9be8d5d86a387d321987743b0080a8c
|
||||
|
||||
PKG_MAINTAINER:=Facundo Acevedo <facevedo@disroot.org>
|
||||
PKG_LICENSE:=MIT
|
||||
|
|
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=stress-ng
|
||||
PKG_VERSION:=0.17.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ColinIanKing/stress-ng/tar.gz/refs/tags/V$(PKG_VERSION)?
|
||||
|
|
|
@ -0,0 +1,531 @@
|
|||
From cd84c46ce780242879e8aaa7d698b9cd87996dbd Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.i.king@gmail.com>
|
||||
Date: Sun, 15 Oct 2023 15:50:07 +0100
|
||||
Subject: [PATCH] core-*, stress-*: Add musl-gcc detection and
|
||||
HAVE_COMPILER_MUSL
|
||||
|
||||
Detect for musl-gcc and define HAVE_COMPILER_MUSL and also define
|
||||
HAVE_COMPILER_GCC_OR_MUSL for GCC or MUSL compilers. Allows one
|
||||
to differentiate between gcc tool chains with and without glibc/musl
|
||||
libc.
|
||||
|
||||
Fixes https://github.com/ColinIanKing/stress-ng/issues/325
|
||||
|
||||
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||
---
|
||||
core-attribute.h | 56 ++++++++++++++++++++++----------------------
|
||||
core-helper.c | 4 ++--
|
||||
core-pragma.h | 18 +++++++-------
|
||||
core-shim.c | 2 +-
|
||||
core-target-clones.h | 2 +-
|
||||
core-vecmath.h | 4 ++--
|
||||
stress-atomic.c | 4 ++--
|
||||
stress-flushcache.c | 2 +-
|
||||
stress-lockbus.c | 4 ++--
|
||||
stress-malloc.c | 4 ++--
|
||||
stress-memthrash.c | 12 +++++-----
|
||||
stress-ng.h | 32 ++++++++++++++++---------
|
||||
stress-regs.c | 8 +++----
|
||||
stress-rseq.c | 14 +++++------
|
||||
stress-vnni.c | 4 ++++
|
||||
15 files changed, 92 insertions(+), 78 deletions(-)
|
||||
|
||||
--- a/core-attribute.h
|
||||
+++ b/core-attribute.h
|
||||
@@ -20,7 +20,7 @@
|
||||
#define CORE_ATTRIBUTE_H
|
||||
|
||||
/* warn unused attribute */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 2, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 2, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))
|
||||
#define WARN_UNUSED __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#if defined(HAVE_ATTRIBUTE_FAST_MATH) && \
|
||||
!defined(HAVE_COMPILER_ICC) && \
|
||||
- defined(HAVE_COMPILER_GCC) && \
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
NEED_GNUC(10, 0, 0)
|
||||
#define OPTIMIZE_FAST_MATH __attribute__((optimize("fast-math")))
|
||||
#else
|
||||
@@ -44,7 +44,7 @@
|
||||
#endif
|
||||
|
||||
/* no return hint */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(2, 5, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(2, 5, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
@@ -52,7 +52,7 @@
|
||||
#endif
|
||||
|
||||
/* weak attribute */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 0, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 0, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 4, 0))
|
||||
#define WEAK __attribute__((weak))
|
||||
#define HAVE_WEAK_ATTRIBUTE
|
||||
@@ -64,7 +64,7 @@
|
||||
#undef ALWAYS_INLINE
|
||||
#endif
|
||||
/* force inlining hint */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 4, 0) \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 4, 0) \
|
||||
&& ((!defined(__s390__) && !defined(__s390x__)) || NEED_GNUC(6, 0, 1))) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))
|
||||
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||
@@ -73,7 +73,7 @@
|
||||
#endif
|
||||
|
||||
/* force no inlining hint */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 4, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 4, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))
|
||||
#define NOINLINE __attribute__((noinline))
|
||||
#else
|
||||
@@ -81,9 +81,9 @@
|
||||
#endif
|
||||
|
||||
/* -O3 attribute support */
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
NEED_GNUC(4, 6, 0)
|
||||
#define OPTIMIZE3 __attribute__((optimize("-O3")))
|
||||
#else
|
||||
@@ -91,9 +91,9 @@
|
||||
#endif
|
||||
|
||||
/* -O2 attribute support */
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
NEED_GNUC(4, 6, 0)
|
||||
#define OPTIMIZE2 __attribute__((optimize("-O2")))
|
||||
#else
|
||||
@@ -101,9 +101,9 @@
|
||||
#endif
|
||||
|
||||
/* -O1 attribute support */
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
NEED_GNUC(4, 6, 0)
|
||||
#define OPTIMIZE1 __attribute__((optimize("-O1")))
|
||||
#else
|
||||
@@ -111,8 +111,8 @@
|
||||
#endif
|
||||
|
||||
/* -O0 attribute support */
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
NEED_GNUC(4, 6, 0)
|
||||
#define OPTIMIZE0 __attribute__((optimize("-O0")))
|
||||
#elif (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(10, 0, 0))
|
||||
@@ -121,10 +121,10 @@
|
||||
#define OPTIMIZE0
|
||||
#endif
|
||||
|
||||
-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 3, 0)) || \
|
||||
- (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) || \
|
||||
- (defined(HAVE_COMPILER_ICC) && NEED_ICC(2021, 0, 0))) && \
|
||||
- !defined(HAVE_COMPILER_PCC) && \
|
||||
+#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 3, 0)) || \
|
||||
+ (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) || \
|
||||
+ (defined(HAVE_COMPILER_ICC) && NEED_ICC(2021, 0, 0))) && \
|
||||
+ !defined(HAVE_COMPILER_PCC) && \
|
||||
!defined(__minix__)
|
||||
#define ALIGNED(a) __attribute__((aligned(a)))
|
||||
#else
|
||||
@@ -136,7 +136,7 @@
|
||||
#define ALIGN64 ALIGNED(64)
|
||||
|
||||
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))
|
||||
#if (defined(__APPLE__) && defined(__MACH__))
|
||||
#define SECTION(s) __attribute__((__section__(# s "," # s)))
|
||||
@@ -148,7 +148,7 @@
|
||||
#endif
|
||||
|
||||
/* GCC hot attribute */
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0)) || \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 3, 0))
|
||||
#define HOT __attribute__((hot))
|
||||
#else
|
||||
@@ -156,10 +156,10 @@
|
||||
#endif
|
||||
|
||||
/* GCC mlocked data and data section attribute */
|
||||
-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0) || \
|
||||
- (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)))) && \
|
||||
- !defined(__sun__) && \
|
||||
- !defined(__APPLE__) && \
|
||||
+#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0) || \
|
||||
+ (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)))) && \
|
||||
+ !defined(__sun__) && \
|
||||
+ !defined(__APPLE__) && \
|
||||
!defined(BUILD_STATIC)
|
||||
#define MLOCKED_TEXT __attribute__((__section__("mlocked_text")))
|
||||
#define MLOCKED_SECTION (1)
|
||||
@@ -168,7 +168,7 @@
|
||||
#endif
|
||||
|
||||
/* print format attribute */
|
||||
-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 2, 0)) || \
|
||||
+#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 2, 0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)))
|
||||
#define FORMAT(func, a, b) __attribute__((format(func, a, b)))
|
||||
#else
|
||||
--- a/core-helper.c
|
||||
+++ b/core-helper.c
|
||||
@@ -3486,8 +3486,8 @@ void NORETURN MLOCKED_TEXT stress_sig_ha
|
||||
* __stack_chk_fail()
|
||||
* override stack smashing callback
|
||||
*/
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
defined(HAVE_WEAK_ATTRIBUTE)
|
||||
extern void __stack_chk_fail(void);
|
||||
|
||||
--- a/core-pragma.h
|
||||
+++ b/core-pragma.h
|
||||
@@ -22,8 +22,8 @@
|
||||
#define STRESS_PRAGMA_(x) _Pragma (#x)
|
||||
#define STRESS_PRAGMA(x) STRESS_PRAGMA_(x)
|
||||
|
||||
-#if defined(HAVE_PRAGMA_NO_HARD_DFP) && \
|
||||
- defined(HAVE_COMPILER_GCC) && \
|
||||
+#if defined(HAVE_PRAGMA_NO_HARD_DFP) && \
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
defined(HAVE_PRAGMA)
|
||||
#define STRESS_PRAGMA_NO_HARD_DFP _Pragma("GCC target (\"no-hard-dfp\")")
|
||||
#endif
|
||||
@@ -34,8 +34,8 @@
|
||||
#define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push")
|
||||
#define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop")
|
||||
#define STRESS_PRAGMA_WARN_OFF _Pragma("GCC diagnostic ignored \"-Weverything\"")
|
||||
-#elif defined(HAVE_COMPILER_GCC) && \
|
||||
- defined(HAVE_PRAGMA) && \
|
||||
+#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ defined(HAVE_PRAGMA) && \
|
||||
NEED_GNUC(7, 5, 0)
|
||||
#define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push")
|
||||
#define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop")
|
||||
@@ -45,8 +45,8 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wcast-qual\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wnonnull\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wstringop-overflow\"")
|
||||
-#elif defined(HAVE_COMPILER_GCC) && \
|
||||
- defined(HAVE_PRAGMA) && \
|
||||
+#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ defined(HAVE_PRAGMA) && \
|
||||
NEED_GNUC(4, 6, 0)
|
||||
#define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push")
|
||||
#define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop")
|
||||
@@ -65,8 +65,8 @@
|
||||
NEED_CLANG(8, 0, 0) && \
|
||||
defined(HAVE_PRAGMA)
|
||||
#define STRESS_PRAGMA_WARN_CPP_OFF _Pragma("GCC diagnostic ignored \"-Wcpp\"")
|
||||
-#elif defined(HAVE_COMPILER_GCC) && \
|
||||
- defined(HAVE_PRAGMA) && \
|
||||
+#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ defined(HAVE_PRAGMA) && \
|
||||
NEED_GNUC(10, 0, 0)
|
||||
#define STRESS_PRAGMA_WARN_CPP_OFF _Pragma("GCC diagnostic ignored \"-Wcpp\"")
|
||||
#else
|
||||
@@ -80,7 +80,7 @@
|
||||
NEED_CLANG(9, 0, 0)
|
||||
#define PRAGMA_UNROLL_N(n) STRESS_PRAGMA(unroll n)
|
||||
#define PRAGMA_UNROLL STRESS_PRAGMA(unroll)
|
||||
-#elif defined(HAVE_COMPILER_GCC) && \
|
||||
+#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
NEED_GNUC(10, 0, 0)
|
||||
#define PRAGMA_UNROLL_N(n) STRESS_PRAGMA(GCC unroll n)
|
||||
#define PRAGMA_UNROLL STRESS_PRAGMA(GCC unroll 8)
|
||||
--- a/core-shim.c
|
||||
+++ b/core-shim.c
|
||||
@@ -494,7 +494,7 @@ int shim_getrandom(void *buff, size_t bu
|
||||
*/
|
||||
void shim_flush_icache(void *begin, void *end)
|
||||
{
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
defined(STRESS_ARCH_ARM)
|
||||
__clear_cache(begin, end);
|
||||
#elif defined(STRESS_ARCH_RISCV) && \
|
||||
--- a/core-target-clones.h
|
||||
+++ b/core-target-clones.h
|
||||
@@ -138,7 +138,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TARGET_CLONES_GRANITERAPIDS) && \
|
||||
- defined(HAVE_COMPILER_GCC)
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL)
|
||||
#define TARGET_CLONE_GRANITERAPIDS "arch=graniterapids",
|
||||
#define TARGET_CLONE_USE
|
||||
#else
|
||||
--- a/core-vecmath.h
|
||||
+++ b/core-vecmath.h
|
||||
@@ -38,8 +38,8 @@
|
||||
* PPC64 for some reason with some flavours of the toolchain
|
||||
* so disable this test for now
|
||||
*/
|
||||
-#if defined(STRESS_ARCH_PPC64) && \
|
||||
- defined(HAVE_COMPILER_GCC) && \
|
||||
+#if defined(STRESS_ARCH_PPC64) && \
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
__GNUC__ < 6
|
||||
#undef HAVE_VECMATH
|
||||
#endif
|
||||
--- a/stress-atomic.c
|
||||
+++ b/stress-atomic.c
|
||||
@@ -71,7 +71,7 @@ typedef int (*atomic_func_t)(const stres
|
||||
|
||||
#if defined(HAVE_ATOMIC_FETCH_NAND)
|
||||
#define HAVE_ATOMIC_OPS
|
||||
-#if defined(HAVE_COMPILER_GCC) && __GNUC__ != 11
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && __GNUC__ != 11
|
||||
#define SHIM_ATOMIC_FETCH_NAND(ptr, val, memorder) \
|
||||
do { __atomic_fetch_nand(ptr, val, memorder); } while (0)
|
||||
#else
|
||||
@@ -121,7 +121,7 @@ typedef int (*atomic_func_t)(const stres
|
||||
|
||||
#if defined(HAVE_ATOMIC_NAND_FETCH)
|
||||
#define HAVE_ATOMIC_OPS
|
||||
-#if defined(HAVE_COMPILER_GCC) && __GNUC__ != 11
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && __GNUC__ != 11
|
||||
#define SHIM_ATOMIC_NAND_FETCH(ptr, val, memorder) \
|
||||
do { __atomic_nand_fetch(ptr, val, memorder); } while (0)
|
||||
#else
|
||||
--- a/stress-flushcache.c
|
||||
+++ b/stress-flushcache.c
|
||||
@@ -37,7 +37,7 @@ static const stress_help_t help[] = {
|
||||
defined(STRESS_ARCH_S390) || \
|
||||
defined(STRESS_ARCH_PPC64)) && \
|
||||
defined(HAVE_MPROTECT) && \
|
||||
- ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(4,6,0)) || \
|
||||
+ ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4,6,0)) || \
|
||||
(defined(HAVE_COMPILER_CLANG) && NEED_CLANG(9,0,0)) || \
|
||||
(defined(HAVE_COMPILER_ICX) && NEED_ICX(2023,2,0)) || \
|
||||
(defined(HAVE_COMPILER_ICC) && NEED_ICC(2021,0,0)))
|
||||
--- a/stress-lockbus.c
|
||||
+++ b/stress-lockbus.c
|
||||
@@ -37,14 +37,14 @@ static const stress_opt_set_func_t opt_s
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
-#if (((defined(HAVE_COMPILER_GCC) || \
|
||||
+#if (((defined(HAVE_COMPILER_GCC_OR_MUSL) || \
|
||||
defined(HAVE_COMPILER_CLANG) || \
|
||||
defined(HAVE_COMPILER_ICC) || \
|
||||
defined(HAVE_COMPILER_ICX) || \
|
||||
defined(HAVE_COMPILER_TCC) || \
|
||||
defined(HAVE_COMPILER_PCC)) && \
|
||||
defined(STRESS_ARCH_X86)) || \
|
||||
- (defined(HAVE_COMPILER_GCC) && \
|
||||
+ (defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
(defined(HAVE_ATOMIC_ADD_FETCH) || \
|
||||
defined(HAVE_ATOMIC_FETCH_ADD)) && \
|
||||
defined(__ATOMIC_SEQ_CST) && \
|
||||
--- a/stress-malloc.c
|
||||
+++ b/stress-malloc.c
|
||||
@@ -453,8 +453,8 @@ static int stress_malloc(const stress_ar
|
||||
malloc_max = MIN_MALLOC_MAX;
|
||||
}
|
||||
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
- defined(HAVE_MALLOPT) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ defined(HAVE_MALLOPT) && \
|
||||
defined(M_MMAP_THRESHOLD)
|
||||
{
|
||||
size_t malloc_threshold = DEFAULT_MALLOC_THRESHOLD;
|
||||
--- a/stress-memthrash.c
|
||||
+++ b/stress-memthrash.c
|
||||
@@ -94,12 +94,12 @@ static sigset_t set;
|
||||
|
||||
static stress_memthrash_primes_t stress_memthrash_primes[MEM_SIZE_PRIMES];
|
||||
|
||||
-#if (((defined(HAVE_COMPILER_GCC) || defined(HAVE_COMPILER_CLANG)) && \
|
||||
- defined(STRESS_ARCH_X86)) || \
|
||||
- (defined(HAVE_COMPILER_GCC) && \
|
||||
- defined(HAVE_ATOMIC_ADD_FETCH) && \
|
||||
- defined(__ATOMIC_SEQ_CST) && \
|
||||
- NEED_GNUC(4,7,0) && \
|
||||
+#if (((defined(HAVE_COMPILER_GCC_OR_MUSL) || defined(HAVE_COMPILER_CLANG)) && \
|
||||
+ defined(STRESS_ARCH_X86)) || \
|
||||
+ (defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ defined(HAVE_ATOMIC_ADD_FETCH) && \
|
||||
+ defined(__ATOMIC_SEQ_CST) && \
|
||||
+ NEED_GNUC(4,7,0) && \
|
||||
defined(STRESS_ARCH_ARM)))
|
||||
#if defined(HAVE_ATOMIC_ADD_FETCH)
|
||||
#define MEM_LOCK(ptr, inc) __atomic_add_fetch(ptr, inc, __ATOMIC_SEQ_CST)
|
||||
--- a/stress-ng.h
|
||||
+++ b/stress-ng.h
|
||||
@@ -22,6 +22,14 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
+#ifndef _GNU_SOURCE
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
+
|
||||
+#if defined(HAVE_FEATURES_H)
|
||||
+#include <features.h>
|
||||
+#endif
|
||||
+
|
||||
#if defined(__ICC) && \
|
||||
defined(__INTEL_COMPILER)
|
||||
/* Intel ICC compiler */
|
||||
@@ -41,15 +49,20 @@
|
||||
#elif defined(__clang__)
|
||||
/* clang */
|
||||
#define HAVE_COMPILER_CLANG
|
||||
+#elif defined(__GNUC__) && \
|
||||
+ !defined(__USE_GNU)
|
||||
+/* musl gcc */
|
||||
+#define HAVE_COMPILER_MUSL
|
||||
+#define HAVE_COMPILER_GCC_OR_MUSL
|
||||
#elif defined(__GNUC__)
|
||||
/* GNU C compiler */
|
||||
#define HAVE_COMPILER_GCC
|
||||
+#define HAVE_COMPILER_GCC_OR_MUSL
|
||||
#endif
|
||||
|
||||
-#ifndef _GNU_SOURCE
|
||||
-#define _GNU_SOURCE
|
||||
-#endif
|
||||
+#ifndef _ATFILE_SOURCE
|
||||
#define _ATFILE_SOURCE
|
||||
+#endif
|
||||
#ifndef _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE_SOURCE
|
||||
#endif
|
||||
@@ -101,9 +114,6 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
-#if defined(HAVE_FEATURES_H)
|
||||
-#include <features.h>
|
||||
-#endif
|
||||
#if defined(HAVE_LIB_PTHREAD)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
@@ -144,7 +154,7 @@
|
||||
#endif
|
||||
#if defined(HAVE_SYS_SYSINFO_H)
|
||||
#include <sys/sysinfo.h>
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
!defined(__GLIBC__)
|
||||
/* Suppress kernel sysinfo to avoid collision with musl */
|
||||
#define _LINUX_SYSINFO_H
|
||||
@@ -237,7 +247,7 @@ typedef struct stress_stressor_info {
|
||||
|
||||
#if defined(CHECK_UNEXPECTED) && \
|
||||
defined(HAVE_PRAGMA) && \
|
||||
- defined(HAVE_COMPILER_GCC)
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL)
|
||||
#define UNEXPECTED_PRAGMA(x) _Pragma (#x)
|
||||
#define UNEXPECTED_XSTR(x) UNEXPECTED_STR(x)
|
||||
#define UNEXPECTED_STR(x) # x
|
||||
@@ -427,7 +437,7 @@ typedef struct stressor_info {
|
||||
} stressor_info_t;
|
||||
|
||||
/* gcc 4.7 and later support vector ops */
|
||||
-#if defined(HAVE_COMPILER_GCC) && \
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
NEED_GNUC(4, 7, 0)
|
||||
#define STRESS_VECTOR (1)
|
||||
#endif
|
||||
@@ -508,7 +518,7 @@ extern const char stress_config[];
|
||||
#define PAGE_MAPPED (0x01)
|
||||
#define PAGE_MAPPED_FAIL (0x02)
|
||||
|
||||
-#if defined(HAVE_COMPILER_GCC) || defined(HAVE_COMPILER_CLANG)
|
||||
+#if defined(HAVE_COMPILER_GCC_OR_MUSL) || defined(HAVE_COMPILER_CLANG)
|
||||
#define TYPEOF_CAST(a) (typeof(a))
|
||||
#else
|
||||
#define TYPEOF_CAST(a)
|
||||
@@ -839,7 +849,7 @@ extern void stress_metrics_set_const_che
|
||||
|
||||
#if !defined(STRESS_CORE_SHIM) && \
|
||||
!defined(HAVE_PEDANTIC) && \
|
||||
- (defined(HAVE_COMPILER_GCC) && defined(HAVE_COMPILER_CLANG))
|
||||
+ (defined(HAVE_COMPILER_GCC_OR_MUSL) && defined(HAVE_COMPILER_CLANG))
|
||||
int unlink(const char *pathname) __attribute__((deprecated("use shim_unlink")));
|
||||
int unlinkat(int dirfd, const char *pathname, int flags) __attribute__((deprecated("use shim_unlinkat")));
|
||||
int rmdir(const char *pathname) __attribute__((deprecated("use shim_rmdir")));
|
||||
--- a/stress-regs.c
|
||||
+++ b/stress-regs.c
|
||||
@@ -33,10 +33,10 @@ static const stress_help_t help[] = {
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(8, 0, 0)) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
- !defined(HAVE_COMPILER_PCC) && \
|
||||
+#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(8, 0, 0)) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
+ !defined(HAVE_COMPILER_PCC) && \
|
||||
!defined(HAVE_COMPILER_TCC)
|
||||
|
||||
static volatile uint32_t stash32;
|
||||
--- a/stress-rseq.c
|
||||
+++ b/stress-rseq.c
|
||||
@@ -32,13 +32,13 @@ static const stress_help_t help[] = {
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
-#if defined(HAVE_LINUX_RSEQ_H) && \
|
||||
- defined(HAVE_ASM_NOP) && \
|
||||
- defined(__NR_rseq) && \
|
||||
- defined(HAVE_SYSCALL) && \
|
||||
- defined(HAVE_COMPILER_GCC) && \
|
||||
- !defined(HAVE_COMPILER_CLANG) && \
|
||||
- !defined(HAVE_COMPILER_ICC) && \
|
||||
+#if defined(HAVE_LINUX_RSEQ_H) && \
|
||||
+ defined(HAVE_ASM_NOP) && \
|
||||
+ defined(__NR_rseq) && \
|
||||
+ defined(HAVE_SYSCALL) && \
|
||||
+ defined(HAVE_COMPILER_GCC_OR_MUSL) && \
|
||||
+ !defined(HAVE_COMPILER_CLANG) && \
|
||||
+ !defined(HAVE_COMPILER_ICC) && \
|
||||
!defined(HAVE_COMPILER_ICX)
|
||||
|
||||
#define STRESS_ACCESS_ONCE(x) (*(__volatile__ __typeof__(x) *)&(x))
|
||||
--- a/stress-vnni.c
|
||||
+++ b/stress-vnni.c
|
||||
@@ -25,6 +25,10 @@
|
||||
#include "core-pragma.h"
|
||||
#include "core-target-clones.h"
|
||||
|
||||
+#if defined(HAVE_COMPILER_MUSL)
|
||||
+#undef HAVE_IMMINTRIN_H
|
||||
+#endif
|
||||
+
|
||||
#if defined(HAVE_IMMINTRIN_H)
|
||||
#include <immintrin.h>
|
||||
#endif
|
3
utils/stress-ng/test.sh
Normal file
3
utils/stress-ng/test.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
stress-ng --version | grep "$2"
|
Loading…
Reference in a new issue