PKG_NAME:=perl
PKG_VERSION:=$(PERL_VERSION)
-PKG_RELEASE:=9
+PKG_RELEASE:=10
PKG_SOURCE_URL:=\
https://cpan.metacpan.org/src/5.0 \
--- /dev/null
+owrt:arch=riscv
+owrt:bits=64
+owrt:endian=little
+
+ccsymbols=''
+cppccsymbols=''
+cppsymbols='_FILE_OFFSET_BITS=64 _FORTIFY_SOURCE=2 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _STDC_PREDEF_H=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __ATOMIC_ACQUIRE=2 __ATOMIC_ACQ_REL=4 __ATOMIC_CONSUME=1 __ATOMIC_RELAXED=0 __ATOMIC_RELEASE=3 __ATOMIC_SEQ_CST=5 __BIGGEST_ALIGNMENT__=16 __BYTE_ORDER__=1234 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __CHAR_UNSIGNED__=1 __DBL_DECIMAL_DIG__=17 __DBL_DENORM_MIN__=((double)4.94065645841246544176568792868221372e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308084726333618164062e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570814527423731704357e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309023271733240406e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_DIG__=36 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLOAT_WORD_ORDER__=1234 __FLT128_DECIMAL_DIG__=36 __FLT128_DENORM_MIN__=6.47517511943802511092443895822764655e-4966F128 __FLT128_DIG__=33 __FLT128_EPSILON__=1.92592994438723585305597794258492732e-34F128 __FLT128_HAS_DENORM__=1 __FLT128_HAS_INFINITY__=1 __FLT128_HAS_QUIET_NAN__=1 __FLT128_MANT_DIG__=113 __FLT128_MAX_10_EXP__=4932 __FLT128_MAX_EXP__=16384 __FLT128_MAX__=1.18973149535723176508575932662800702e+4932F128 __FLT128_MIN_10_EXP__=(-4931) __FLT128_MIN_EXP__=(-16381) __FLT128_MIN__=3.36210314311209350626267781732175260e-4932F128 __FLT32X_DECIMAL_DIG__=17 __FLT32X_DENORM_MIN__=4.94065645841246544176568792868221372e-324F32x __FLT32X_DIG__=15 __FLT32X_EPSILON__=2.22044604925031308084726333618164062e-16F32x __FLT32X_HAS_DENORM__=1 __FLT32X_HAS_INFINITY__=1 __FLT32X_HAS_QUIET_NAN__=1 __FLT32X_MANT_DIG__=53 __FLT32X_MAX_10_EXP__=308 __FLT32X_MAX_EXP__=1024 __FLT32X_MAX__=1.79769313486231570814527423731704357e+308F32x __FLT32X_MIN_10_EXP__=(-307) __FLT32X_MIN_EXP__=(-1021) __FLT32X_MIN__=2.22507385850720138309023271733240406e-308F32x __FLT32_DECIMAL_DIG__=9 __FLT32_DENORM_MIN__=1.40129846432481707092372958328991613e-45F32 __FLT32_DIG__=6 __FLT32_EPSILON__=1.19209289550781250000000000000000000e-7F32 __FLT32_HAS_DENORM__=1 __FLT32_HAS_INFINITY__=1 __FLT32_HAS_QUIET_NAN__=1 __FLT32_MANT_DIG__=24 __FLT32_MAX_10_EXP__=38 __FLT32_MAX_EXP__=128 __FLT32_MAX__=3.40282346638528859811704183484516925e+38F32 __FLT32_MIN_10_EXP__=(-37) __FLT32_MIN_EXP__=(-125) __FLT32_MIN__=1.17549435082228750796873653722224568e-38F32 __FLT64X_DECIMAL_DIG__=36 __FLT64X_DENORM_MIN__=6.47517511943802511092443895822764655e-4966F64x __FLT64X_DIG__=33 __FLT64X_EPSILON__=1.92592994438723585305597794258492732e-34F64x __FLT64X_HAS_DENORM__=1 __FLT64X_HAS_INFINITY__=1 __FLT64X_HAS_QUIET_NAN__=1 __FLT64X_MANT_DIG__=113 __FLT64X_MAX_10_EXP__=4932 __FLT64X_MAX_EXP__=16384 __FLT64X_MAX__=1.18973149535723176508575932662800702e+4932F64x __FLT64X_MIN_10_EXP__=(-4931) __FLT64X_MIN_EXP__=(-16381) __FLT64X_MIN__=3.36210314311209350626267781732175260e-4932F64x __FLT64_DECIMAL_DIG__=17 __FLT64_DENORM_MIN__=4.94065645841246544176568792868221372e-324F64 __FLT64_DIG__=15 __FLT64_EPSILON__=2.22044604925031308084726333618164062e-16F64 __FLT64_HAS_DENORM__=1 __FLT64_HAS_INFINITY__=1 __FLT64_HAS_QUIET_NAN__=1 __FLT64_MANT_DIG__=53 __FLT64_MAX_10_EXP__=308 __FLT64_MAX_EXP__=1024 __FLT64_MAX__=1.79769313486231570814527423731704357e+308F64 __FLT64_MIN_10_EXP__=(-307) __FLT64_MIN_EXP__=(-1021) __FLT64_MIN__=2.22507385850720138309023271733240406e-308F64 __FLT_DECIMAL_DIG__=9 __FLT_DENORM_MIN__=1.40129846432481707092372958328991613e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000000000000000000e-7F __FLT_EVAL_METHOD_TS_18661_3__=0 __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859811704183484516925e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750796873653722224568e-38F __FLT_RADIX__=2 __FP_FAST_FMA=1 __FP_FAST_FMAF32=1 __FP_FAST_FMAF32x=1 __FP_FAST_FMAF64=1 __FP_FAST_FMAF=1 __GCC_ATOMIC_BOOL_LOCK_FREE=1 __GCC_ATOMIC_CHAR16_T_LOCK_FREE=1 __GCC_ATOMIC_CHAR32_T_LOCK_FREE=2 __GCC_ATOMIC_CHAR_LOCK_FREE=1 __GCC_ATOMIC_INT_LOCK_FREE=2 __GCC_ATOMIC_LLONG_LOCK_FREE=2 __GCC_ATOMIC_LONG_LOCK_FREE=2 __GCC_ATOMIC_POINTER_LOCK_FREE=2 __GCC_ATOMIC_SHORT_LOCK_FREE=1 __GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1 __GCC_ATOMIC_WCHAR_T_LOCK_FREE=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GCC_IEC_559=2 __GCC_IEC_559_COMPLEX=2 __GLIBC_MINOR__=27 __GLIBC__=2 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=0 __GNUC_STDC_INLINE__=1 __GNUC__=8 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1013 __INT16_C=__INT16_C __INT16_MAX__=0x7fff __INT16_TYPE__=short\ int __INT32_C=__INT32_C __INT32_MAX__=0x7fffffff __INT32_TYPE__=int __INT64_C=__INT64_C __INT64_MAX__=0x7fffffffffffffffL __INT64_TYPE__=long\ int __INT8_C=__INT8_C __INT8_MAX__=0x7f __INT8_TYPE__=signed\ char __INTMAX_C=__INTMAX_C __INTMAX_MAX__=0x7fffffffffffffffL __INTMAX_TYPE__=long\ int __INTMAX_WIDTH__=64 __INTPTR_MAX__=0x7fffffffffffffffL __INTPTR_TYPE__=long\ int __INTPTR_WIDTH__=64 __INT_FAST16_MAX__=0x7fffffffffffffffL __INT_FAST16_TYPE__=long\ int __INT_FAST16_WIDTH__=64 __INT_FAST32_MAX__=0x7fffffffffffffffL __INT_FAST32_TYPE__=long\ int __INT_FAST32_WIDTH__=64 __INT_FAST64_MAX__=0x7fffffffffffffffL __INT_FAST64_TYPE__=long\ int __INT_FAST64_WIDTH__=64 __INT_FAST8_MAX__=0x7f __INT_FAST8_TYPE__=signed\ char __INT_FAST8_WIDTH__=8 __INT_LEAST16_MAX__=0x7fff __INT_LEAST16_TYPE__=short\ int __INT_LEAST16_WIDTH__=16 __INT_LEAST32_MAX__=0x7fffffff __INT_LEAST32_TYPE__=int __INT_LEAST32_WIDTH__=32 __INT_LEAST64_MAX__=0x7fffffffffffffffL __INT_LEAST64_TYPE__=long\ int __INT_LEAST64_WIDTH__=64 __INT_LEAST8_MAX__=0x7f __INT_LEAST8_TYPE__=signed\ char __INT_LEAST8_WIDTH__=8 __INT_MAX__=0x7fffffff __INT_WIDTH__=32 __LDBL_DECIMAL_DIG__=36 __LDBL_DENORM_MIN__=6.47517511943802511092443895822764655e-4966L __LDBL_DIG__=33 __LDBL_EPSILON__=1.92592994438723585305597794258492732e-34L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=113 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176508575932662800702e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626267781732175260e-4932L __LONG_LONG_MAX__=0x7fffffffffffffffLL __LONG_LONG_WIDTH__=64 __LONG_MAX__=0x7fffffffffffffffL __LONG_WIDTH__=64 __LP64__=1 __ORDER_BIG_ENDIAN__=4321 __ORDER_LITTLE_ENDIAN__=1234 __ORDER_PDP_ENDIAN__=3412 __PIC__=2 __PIE__=2 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=0x7fffffffffffffffL __PTRDIFF_TYPE__=long\ int __PTRDIFF_WIDTH__=64 __REGISTER_PREFIX__= __SCHAR_MAX__=0x7f __SCHAR_WIDTH__=8 __SHRT_MAX__=0x7fff __SHRT_WIDTH__=16 __SIG_ATOMIC_MAX__=0x7fffffff __SIG_ATOMIC_MIN__=(-0x7fffffff\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIG_ATOMIC_WIDTH__=32 __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT128__=16 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=0xffffffffffffffffUL __SIZE_TYPE__=long\ unsigned\ int __SIZE_WIDTH__=64 __STDC_HOSTED__=1 __STDC_IEC_559_COMPLEX__=1 __STDC_IEC_559__=1 __STDC_ISO_10646__=201706L __STDC_NO_THREADS__=1 __STDC_UTF_16__=1 __STDC_UTF_32__=1 __STDC_VERSION__=201710L __STDC__=1 __UINT16_C=__UINT16_C __UINT16_MAX__=0xffff __UINT16_TYPE__=short\ unsigned\ int __UINT32_C=__UINT32_C __UINT32_MAX__=0xffffffffU __UINT32_TYPE__=unsigned\ int __UINT64_C=__UINT64_C __UINT64_MAX__=0xffffffffffffffffUL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C=__UINT8_C __UINT8_MAX__=0xff __UINT8_TYPE__=unsigned\ char __UINTMAX_C=__UINTMAX_C __UINTMAX_MAX__=0xffffffffffffffffUL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=0xffffffffffffffffUL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=0xffffffffffffffffUL __UINT_FAST16_TYPE__=long\unsigned\ int __UINT_FAST32_MAX__=0xffffffffffffffffUL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=0xffffffffffffffffUL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=0xff __UINT_FAST8_TYPE__=unsigned\ char__UINT_LEAST16_MAX__=0xffff __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=0xffffffffU __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=0xffffffffffffffffUL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=0xff __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="8.2.0" __WCHAR_MAX__=0x7fffffff __WCHAR_MIN__=(-0x7fffffff\ -\ 1) __WCHAR_TYPE__=int __WCHAR_WIDTH__=32 __WINT_MAX__=0xffffffffU __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __WINT_WIDTH__=32 __gnu_linux__=1 __has_include=__has_include __has_include_next=__has_include_next __linux=1 __linux__=1 __pic__=2 __pie__=2 __riscv=1 __riscv_atomic=1 __riscv_cmodel_pic=1 __riscv_compressed=1 __riscv_div=1 __riscv_fdiv=1 __riscv_flen=64 __riscv_float_abi_double=1 __riscv_fsqrt=1 __riscv_mul=1 __riscv_muldiv=1 __riscv_xlen=64 __unix=1 __unix__=1 linux=1 unix=1'
+
+d_casti32='define'
+d_double_style_ieee='define'
+d_modflproto='define'
+doublekind='3'
+fpossize='16'
+longdblkind='1'
+need_va_copy='undef'
+quadkind='2'
+
+owrt:sig_count='64'
+owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS'
+owrt:sig_name_extra='IOT CLD POLL UNUSED'
+owrt:sig_num_extra='6 17 29 31'
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
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
--- /dev/null
+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)
+
+
include $(TOPDIR)/rules.mk
PKG_NAME:=pillow
-PKG_VERSION:=10.0.0
+PKG_VERSION:=10.1.0
PKG_RELEASE:=1
PYPI_NAME:=Pillow
-PKG_HASH:=9c82b5b3e043c7af0d95792d0d20ccf68f61a1fec6b3530e718b688422727396
+PKG_HASH:=e6bf8de6c36ed96c86ea3b6e1d5273c53f46ef518a062464cd7ef5dd2cf92e38
PKG_BUILD_DEPENDS:=python-setuptools-scm/host
requires = [
- "setuptools>=67.8",
+ "setuptools",
- "wheel",
]
backend-path = [
+ "_custom_build",
--- /dev/null
+#!/bin/sh
+
+[ "$1" = "python3-pillow" ] || exit 0
+
+python3 - << EOF
+import sys
+from PIL import Image, ImageDraw
+
+if (Image.__version__ != "$2"):
+ print("Wrong version: " + Image.__version__)
+ sys.exit(1)
+
+from PIL import Image, ImageDraw
+img = Image.new('RGB', (100, 30), color = (73, 109, 137))
+d = ImageDraw.Draw(img)
+d.text((10,10), "Hello World", fill=(255,255,0))
+
+# Getting here means we did not get exceptions
+sys.exit(0)
+EOF
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
#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)
/*************************************************
* 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);
}
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> \
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> \
--- 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')
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> \
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> \
--- 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')
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> \
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> \
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
# 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'
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
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})"
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
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})"
'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' \
include $(TOPDIR)/rules.mk
PKG_NAME:=conntrack-tools
-PKG_VERSION:=1.4.7
+PKG_VERSION:=1.4.8
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.netfilter.org/projects/conntrack-tools/files
-PKG_HASH:=099debcf57e81690ced57f516b493588a73518f48c14d656f823b29b4fc24b5d
+PKG_HASH:=067677f4c5f6564819e78ed3a9d4a8980935ea9273f3abb22a420ea30ab5ded6
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0-or-later
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
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/
+++ /dev/null
-#!/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'
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; }
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'
}
}
service_triggers() {
- procd_add_raw_trigger "interface.*.up" 3000 "/etc/init.d/${packageName}" restart 'on_interface_up'
+ 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 "$*"; }
PKG_NAME:=net-snmp
PKG_VERSION:=5.9.1
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/net-snmp
--- /dev/null
+From e5aadf1e78c624a8e4147d4b70a7795497a50e73 Mon Sep 17 00:00:00 2001
+From: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon, 22 May 2023 18:44:36 +0200
+Subject: [PATCH] if-mib/data_access/interface.c: plug a leak with pcre2
+
+---
+ agent/mibgroup/if-mib/data_access/interface.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/agent/mibgroup/if-mib/data_access/interface.c
++++ b/agent/mibgroup/if-mib/data_access/interface.c
+@@ -845,7 +845,7 @@ int netsnmp_access_interface_include(con
+ {
+ netsnmp_include_if_list *if_ptr;
+ #if defined(HAVE_PCRE2_H)
+- pcre2_match_data *ndx_match = pcre2_match_data_create(3, NULL);
++ pcre2_match_data *ndx_match;
+ #elif defined(HAVE_PCRE_H)
+ int found_ndx[3];
+ #endif
+@@ -860,6 +860,9 @@ int netsnmp_access_interface_include(con
+ */
+ return TRUE;
+
++#if defined(HAVE_PCRE2_H)
++ ndx_match = pcre2_match_data_create(3, NULL);
++#endif
+
+ for (if_ptr = include_list; if_ptr; if_ptr = if_ptr->next) {
+ #if defined(HAVE_PCRE2_H)
prompt "Enable HTTP sub module"
default n
+config NGINX_STREAM_REAL_IP
+ bool
+ prompt "Enable STREAM real ip module"
+ default n
+
endmenu
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/
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))
$(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)))
+++ /dev/null
-#
-# 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))
+++ /dev/null
-#!/bin/sh
-
-ooniprobe version | grep "$2"
include $(TOPDIR)/rules.mk
PKG_NAME:=pdns
-PKG_VERSION:=4.8.2
+PKG_VERSION:=4.8.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
-PKG_HASH:=3b173fda4c51bb07b5a51d8c599eedd7962a02056b410e3c9d9d69ed97be35b9
+PKG_HASH:=77b91199bdf71874334501c67e26469c2667a373d8423803fe657417295c77ba
PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
PKG_LICENCE:=GPL-2.0-only
#
# default-api-rectify=yes
+#################################
+# default-catalog-zone Catalog zone to assign newly created primary zones (via the API) to
+#
+# default-catalog-zone=
+
#################################
# default-ksk-algorithm Default KSK algorithm
#
#
# secondary=no
+#################################
+# secondary-check-signature-freshness Check signatures in SOA freshness check. Sets DO flag on SOA queries. Outside some very problematic scenarios, say yes here.
+#
+# secondary-check-signature-freshness=yes
+
#################################
# secondary-do-renotify If this secondary should send out notifications after receiving zone transfers from a primary
#
# slave-renotify=no
#################################
-# socket-dir Where the controlsocket will live, /var/run/pdns when unset and not chrooted. Set to the RUNTIME_DIRECTORY environment variable when that variable has a value (e.g. under systemd).
+# socket-dir Where the controlsocket will live, /var/run/pdns when unset and not chrooted
#
# socket-dir=
#
# webserver-print-arguments=no
+#################################
+# workaround-11804 Workaround for issue 11804: send single RR per AXFR chunk
+#
+# workaround-11804=no
+
#################################
# write-pid Write a PID file
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rclone
-PKG_VERSION:=1.64.0
+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:=3297838fdcf611a5ad605835f41c0e51031ce9f220c77a4ad0af6283b7805329
+PKG_HASH:=85feffc2d60554bcc3c59140750dc4ccf008e109b52c451956a1f52387af1bd6
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
#
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)
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
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
--- /dev/null
+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;
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
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
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
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)
$(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
$(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))
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/ \
}
reload_service() {
- procd_send_signal /usr/sbin/tor
+ procd_send_signal tor
}
start_service() {
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
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>
* 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
* happy traveling ...
## Travelmate config options
-* usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
+* usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
| Option | Default | Description/Valid Values |
| :----------------- | :--------------------------------- | :---------------------------------------------------------------------------------------------------- |
| 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:
+
+* per uplink exist an additional 'uplink' section in the travelmate config, with the following options:
| Option | Default | Description/Valid Values |
| :----------------- | :--------------------------------- | :---------------------------------------------------------------------------------------------------- |
| vpn | 0, disabled | automatically handle VPN (re-) connections |
| vpnservice | -, not set | reference the already configured 'wireguard' or 'openvpn' client instance as vpn provider |
| vpniface | -, not set | the logical vpn interface, e.g. 'wg0' or 'tun0' |
-
+
## VPN client setup
Please follow one of the following guides to get a working vpn client setup on your travel router:
* [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
**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: â\9c\94, vpn: â\9c\98, mail: ✘
- + last_run : 2020.09.10-15:21:19
- + system : GL.iNet GL-AR750S (NOR/NAND), OpenWrt SNAPSHOT r14430-2dda301d40
+ + ext_hooks : ntp: â\9c\94, vpn: â\9c\94, 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-"_)
## 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
#!/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=""
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)"
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"
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}')"
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
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
"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")"
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
;;
"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
;;
# 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() {
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
- trm_opensta="$((trm_opensta + 1))"
- uci_commit "travelmate"
- uci_commit "wireless"
- f_wifi
- if [ ! -f "${trm_refreshfile}" ]; then
- printf "%s" "ui_reload" >"${trm_refreshfile}"
- fi
- f_log "info" "open uplink '${radio}/${essid}' added to wireless config"
+ 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"
+ f_wifi
+ if [ ! -f "${trm_refreshfile}" ]; then
+ printf "%s" "ui_reload" >"${trm_refreshfile}"
+ fi
+ f_log "info" "open uplink '${radio}/${essid}' added to wireless config"
+ 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}"
}
# 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"
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
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)"
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}"
}
# 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:-"-"})"
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")"
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
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
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
#!/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
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
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
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
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
#!/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
PKG_FORTIFY_SOURCE:=0
PKG_BUILD_PARALLEL:=1
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/acpica-unix
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
endef
$(eval $(call BuildPackage,acpica-unix))
+$(eval $(call HostBuild))
include $(TOPDIR)/rules.mk
PKG_NAME:=compose
-PKG_VERSION:=2.22.0
+PKG_VERSION:=2.23.0
PKG_RELEASE:=1
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/docker/compose/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=82bd4622729cff061b3489bad96b54849a7f4b462345aade1bd374c879db9019
+PKG_HASH:=805ff38df265d05c7b0c9d5df1b77e9391f7995ac5ec66bde0325b03563e7b23
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nerdctl
+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:=fb7660f7e598e4c502d4f0c26cf985290fc7bdc80cce1f7402020afdf83ef988
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Luca Barbato <lu_zero@gentoo.org>
+
+PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=no-mips16
+
+GO_PKG:=github.com/containerd/nerdctl
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/nerdctl
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=contaiNERD CTL - Docker-compatible CLI for containerd
+ URL:=https://containerd.io
+ DEPENDS:=$(GO_ARCH_DEPENDS)
+endef
+
+define Package/nerdctl/description
+ Docker-compatible CLI for containerd, with support for Compose, Rootless,
+ eStargz, OCIcrypt, IPFS, ...
+endef
+
+$(eval $(call GoBinPackage,nerdctl))
+$(eval $(call BuildPackage,nerdctl))
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
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0-only
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=quectel-timesync
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/freifunk-darmstadt/quectel-timesync.git
+PKG_SOURCE_DATE:=2023-10-08
+PKG_SOURCE_VERSION:=4333888cb8025b92511597a95859943fae0a0bc8
+PKG_MIRROR_HASH:=696b878891f884318847069b0590cbdbab2ff48461864ecb418e4575935a29e3
+
+PKG_MAINTAINER:=David Bauer <mail@david-bauer.net>
+PKG_LICENSE:=GPL-2.0-only
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/quectel-timesync
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Tool for configuring system clock using Quectel cellular modems
+ DEPENDS:=+kmod-usb-serial-option
+endef
+
+define Package/quectel-timesync/description
+This tool allows for acquiring the current time from
+the cellular network for configuring the local clock.
+Compared to NTP, this has the advantage of nut using up
+mobile traffic.
+
+It takes advantage of the AT+QLTS command found on Quectel
+modems. This functionality depends on support of the mobile
+network.
+endef
+
+define Package/quectel-timesync/conffiles
+/etc/config/quectel-timesync
+endef
+
+define Package/quectel-timesync/install
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
+
+ $(CP) $(PKG_BUILD_DIR)/openwrt/quectel-timesync/files/quectel-timesync.config $(1)/etc/config/quectel-timesync
+
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/quectel-timesync/files/quectel-timesync.init $(1)/etc/init.d/quectel-timesync
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/quectel-timesync $(1)/usr/sbin/quectel-timesync
+endef
+
+$(eval $(call BuildPackage,quectel-timesync))
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)?
--- /dev/null
+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
--- /dev/null
+#!/bin/sh -e
+
+stress-ng --version | grep "$2"