From d7567389d53782eecd9f06f7ffdf833356b4d22e Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Sun, 14 Mar 2021 12:42:29 +0100 Subject: [PATCH 01/20] selinux-policy: update to version v0.8 Signed-off-by: Dominick Grift --- package/system/selinux-policy/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index 759a8eff93..4980ed6f21 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.7 -PKG_MIRROR_HASH:=f9c555dfa2bb16e6bfd86f1481aad26fce72e5aa45e297e1b39636b6dd0ce021 +PKG_VERSION:=0.8 +PKG_MIRROR_HASH:=3b58f751a21394e3aef47fd6c9fe9430fadde6427deb5c79f08478904837ec91 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host From 29b028f40c4a10a795eaad35b8ac6d33eef3b3aa Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 6 Mar 2021 14:16:55 -0800 Subject: [PATCH 02/20] gettext-full: disable nameless locale define It seems some packages like transmission and json-glib fail with it enabled. Signed-off-by: Rosen Penev --- package/libs/gettext-full/Makefile | 2 +- package/libs/gettext-full/patches/010-m4.patch | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index eaedd4ed40..8111a36f5f 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gettext-full PKG_VERSION:=0.21 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gettext diff --git a/package/libs/gettext-full/patches/010-m4.patch b/package/libs/gettext-full/patches/010-m4.patch index d910ab7a21..6d08835e37 100644 --- a/package/libs/gettext-full/patches/010-m4.patch +++ b/package/libs/gettext-full/patches/010-m4.patch @@ -84,7 +84,7 @@ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ - -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \ -+ -e 's,@''HAVE_NAMELESS_LOCALES''@,1,g' \ ++ -e 's,@''HAVE_NAMELESS_LOCALES''@,0,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ < $(srcdir)/libgnuintl.in.h \ | if test '@WOE32DLL@' = yes; then \ @@ -93,7 +93,7 @@ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ - -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \ -+ -e 's,@''HAVE_NAMELESS_LOCALES''@,1,g' \ ++ -e 's,@''HAVE_NAMELESS_LOCALES''@,0,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ < $(srcdir)/libgnuintl.in.h > libintl.h MOSTLYCLEANFILES += libintl.h @@ -278,7 +278,7 @@ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ - -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \ -+ -e 's,@''HAVE_NAMELESS_LOCALES''@,1,g' \ ++ -e 's,@''HAVE_NAMELESS_LOCALES''@,0,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ < $(srcdir)/libgnuintl.in.h \ | if test '@WOE32DLL@' = yes; then \ @@ -287,7 +287,7 @@ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ - -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \ -+ -e 's,@''HAVE_NAMELESS_LOCALES''@,1,g' \ ++ -e 's,@''HAVE_NAMELESS_LOCALES''@,0,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ < $(srcdir)/libgnuintl.in.h > libintl.h MOSTLYCLEANFILES += libintl.h From df8b658cb518178e6c1248c5682685d5036f9ceb Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 4 Feb 2021 13:34:30 -1000 Subject: [PATCH 03/20] scripts,ipkg-build: apply shellcheck This commit cleans the `ipkg-build` script via changes suggested by shellcheck. These are mostly word splitting issues. Remove the definition of GZIP, this adds three "lookups" of the `gzip` binary but the rest of the build system doesn't seem to use such improvements neither. Signed-off-by: Paul Spooren --- scripts/ipkg-build | 81 +++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/scripts/ipkg-build b/scripts/ipkg-build index 343aab6caf..8533c97fcc 100755 --- a/scripts/ipkg-build +++ b/scripts/ipkg-build @@ -13,7 +13,6 @@ version=1.0 FIND="$(command -v find)" FIND="${FIND:-$(command -v gfind)}" TAR="${TAR:-$(command -v tar)}" -GZIP="$(command -v gzip)" # try to use fixed source epoch if [ -n "$PKG_SOURCE_DATE_EPOCH" ]; then @@ -31,40 +30,40 @@ ipkg_extract_value() { required_field() { field=$1 - grep "^$field:" < $CONTROL/control | ipkg_extract_value + grep "^$field:" < "$CONTROL/control" | ipkg_extract_value } pkg_appears_sane() { - local pkg_dir=$1 + local pkg_dir="$1" - local owd=$PWD - cd $pkg_dir + local owd="$PWD" + cd "$pkg_dir" PKG_ERROR=0 - pkg=`required_field Package` - version=`required_field Version | sed 's/Version://; s/^.://g;'` - arch=`required_field Architecture` + pkg="$(required_field Package)" + version="$(required_field Version | sed 's/Version://; s/^.://g;')" + arch="$(required_field Architecture)" - if echo $pkg | grep '[^a-zA-Z0-9_.+-]'; then + if echo "$pkg" | grep '[^a-zA-Z0-9_.+-]'; then echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2 PKG_ERROR=1; fi - if [ -f $CONTROL/conffiles ]; then - rm -f $CONTROL/conffiles.resolved + if [ -f "$CONTROL/conffiles" ]; then + rm -f "$CONTROL/conffiles.resolved" - for cf in `$FIND $(sed -e "s!^/!$pkg_dir/!" $CONTROL/conffiles) -type f`; do - echo "${cf#$pkg_dir}" >> $CONTROL/conffiles.resolved + for cf in $($FIND $(sed -e "s!^/!$pkg_dir/!" "$CONTROL/conffiles") -type f); do + echo "${cf#$pkg_dir}" >> "$CONTROL/conffiles.resolved" done - rm $CONTROL/conffiles - if [ -f $CONTROL/conffiles.resolved ]; then - mv $CONTROL/conffiles.resolved $CONTROL/conffiles - chmod 0644 $CONTROL/conffiles + rm "$CONTROL"/conffiles + if [ -f "$CONTROL"/conffiles.resolved ]; then + mv "$CONTROL"/conffiles.resolved "$CONTROL"/conffiles + chmod 0644 "$CONTROL"/conffiles fi fi - cd $owd + cd "$owd" return $PKG_ERROR } @@ -95,17 +94,17 @@ file_modes="" usage="Usage: $0 [-v] [-h] [-m] []" while getopts "hvm:" opt; do case $opt in - v ) echo $version + v ) echo "$version" exit 0 ;; - h ) echo $usage >&2 ;; + h ) echo "$usage" >&2 ;; m ) file_modes=$OPTARG ;; - \? ) echo $usage >&2 + \? ) echo "$usage" >&2 esac done -shift $(($OPTIND - 1)) +shift $((OPTIND - 1)) # continue on to process additional arguments @@ -115,42 +114,42 @@ case $# in ;; 2) dest_dir=$2 - if [ "$dest_dir" = "." -o "$dest_dir" = "./" ] ; then + if [ "$dest_dir" = "." ] || [ "$dest_dir" = "./" ] ; then dest_dir=$PWD fi ;; *) - echo $usage >&2 + echo "$usage" >&2 exit 1 ;; esac -pkg_dir=$1 +pkg_dir="$1" -if [ ! -d $pkg_dir ]; then +if [ ! -d "$pkg_dir" ]; then echo "*** Error: Directory $pkg_dir does not exist" >&2 exit 1 fi # CONTROL is second so that it takes precedence CONTROL= -[ -d $pkg_dir/CONTROL ] && CONTROL=CONTROL +[ -d "$pkg_dir"/CONTROL ] && CONTROL=CONTROL if [ -z "$CONTROL" ]; then echo "*** Error: Directory $pkg_dir has no CONTROL subdirectory." >&2 exit 1 fi -if ! pkg_appears_sane $pkg_dir; then +if ! pkg_appears_sane "$pkg_dir"; then echo >&2 echo "ipkg-build: Please fix the above errors and try again." >&2 exit 1 fi tmp_dir=$dest_dir/IPKG_BUILD.$$ -mkdir $tmp_dir +mkdir "$tmp_dir" -echo $CONTROL > $tmp_dir/tarX -cd $pkg_dir +echo $CONTROL > "$tmp_dir"/tarX +cd "$pkg_dir" for file_mode in $file_modes; do case $file_mode in /*:*:*:*) @@ -179,22 +178,22 @@ for file_mode in $file_modes; do chown "$uid:$gid" "$pkg_dir/$path" chmod "$mode" "$pkg_dir/$path" done -$TAR -X $tmp_dir/tarX --format=gnu --sort=name -cpf - --mtime="$TIMESTAMP" . | $GZIP -n - > $tmp_dir/data.tar.gz +$TAR -X "$tmp_dir"/tarX --format=gnu --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz -installed_size=`stat -c "%s" $tmp_dir/data.tar.gz` +installed_size=$(stat -c "%s" "$tmp_dir"/data.tar.gz) sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \ - $pkg_dir/$CONTROL/control + "$pkg_dir"/$CONTROL/control -( cd $pkg_dir/$CONTROL && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" . | $GZIP -n - > $tmp_dir/control.tar.gz ) -rm $tmp_dir/tarX +( cd "$pkg_dir"/$CONTROL && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/control.tar.gz ) +rm "$tmp_dir"/tarX -echo "2.0" > $tmp_dir/debian-binary +echo "2.0" > "$tmp_dir"/debian-binary pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk -rm -f $pkg_file -( cd $tmp_dir && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | $GZIP -n - > $pkg_file ) +rm -f "$pkg_file" +( cd "$tmp_dir" && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | gzip -n - > "$pkg_file" ) -rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz -rmdir $tmp_dir +rm "$tmp_dir"/debian-binary "$tmp_dir"/data.tar.gz "$tmp_dir"/control.tar.gz +rmdir "$tmp_dir" echo "Packaged contents of $pkg_dir into $pkg_file" From c405955a4160829df9785b69da003739255cc924 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 4 Feb 2021 13:49:02 -1000 Subject: [PATCH 04/20] scripts,ipkg-build: use realpath for pkg_dir This allows manual execution of the ipkg-build script even with releative path. Signed-off-by: Paul Spooren --- scripts/ipkg-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ipkg-build b/scripts/ipkg-build index 8533c97fcc..c112270a2b 100755 --- a/scripts/ipkg-build +++ b/scripts/ipkg-build @@ -124,7 +124,7 @@ case $# in ;; esac -pkg_dir="$1" +pkg_dir="$(realpath "$1")" if [ ! -d "$pkg_dir" ]; then echo "*** Error: Directory $pkg_dir does not exist" >&2 From ebfa1abc2a050c54688c2c387c96b0f6c21d103b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 30 Dec 2020 18:24:51 +0100 Subject: [PATCH 05/20] tools: otrx: allow own magic This allows to specify an own magic instead of using the default magic value TRX_MAGIC. If no own magic is specified the default one will be used. Signed-off-by: INAGAKI Hiroshi Signed-off-by: Hauke Mehrtens --- tools/firmware-utils/src/otrx.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/otrx.c b/tools/firmware-utils/src/otrx.c index 223e032f2b..3bbbac39e3 100644 --- a/tools/firmware-utils/src/otrx.c +++ b/tools/firmware-utils/src/otrx.c @@ -287,7 +287,6 @@ static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { uint8_t buf[1024]; uint32_t crc32; - hdr->magic = cpu_to_le32(TRX_MAGIC); hdr->version = 1; fseek(trx, 0, SEEK_SET); @@ -324,9 +323,13 @@ static int otrx_create(int argc, char **argv) { ssize_t sbytes; size_t curr_idx = 0; size_t curr_offset = sizeof(hdr); + char *e; + uint32_t magic; int c; int err = 0; + hdr.magic = cpu_to_le32(TRX_MAGIC); + if (argc < 3) { fprintf(stderr, "No TRX file passed\n"); err = -EINVAL; @@ -343,7 +346,7 @@ static int otrx_create(int argc, char **argv) { fseek(trx, curr_offset, SEEK_SET); optind = 3; - while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { + while ((c = getopt(argc, argv, "f:A:a:b:M:")) != -1) { switch (c) { case 'f': if (curr_idx >= TRX_MAX_PARTS) { @@ -400,6 +403,14 @@ static int otrx_create(int argc, char **argv) { curr_offset += sbytes; } break; + case 'M': + errno = 0; + magic = strtoul(optarg, &e, 0); + if (errno || (e == optarg) || *e) + fprintf(stderr, "illegal magic string %s\n", optarg); + else + hdr.magic = cpu_to_le32(magic); + break; } if (err) break; From 3354895999f71a717013d18c5c87743c1fc9a117 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sun, 7 Mar 2021 16:47:17 +0100 Subject: [PATCH 06/20] mtd: add option for TRX magic to fixtrx Buffalo uses the TRX header with a different magic and even changes this magic with different devices. This change allows to specify the header to use as a command line argument. This is needed for the Buffalo WSR-2533DHP2 based on mt7622. Co-Developed-by: Hauke Mehrtens Signed-off-by: INAGAKI Hiroshi Signed-off-by: Hauke Mehrtens --- package/system/mtd/src/mtd.c | 14 ++++++++++++-- package/system/mtd/src/mtd.h | 1 + package/system/mtd/src/trx.c | 8 ++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c index 9baed3fd5e..fc7071d940 100644 --- a/package/system/mtd/src/mtd.c +++ b/package/system/mtd/src/mtd.c @@ -94,6 +94,7 @@ int mtdsize = 0; int erasesize = 0; int jffs2_skip_bytes=0; int mtdtype = 0; +uint32_t opt_trxmagic = TRX_MAGIC; int mtd_open(const char *mtd, bool block) { @@ -205,7 +206,7 @@ image_check(int imagefd, const char *mtd) magic = ((uint32_t *)buf)[0]; - if (be32_to_cpu(magic) == TRX_MAGIC) + if (be32_to_cpu(magic) == opt_trxmagic) imageformat = MTD_IMAGE_FORMAT_TRX; else if (be32_to_cpu(magic) == SEAMA_MAGIC) imageformat = MTD_IMAGE_FORMAT_SEAMA; @@ -810,6 +811,7 @@ static void usage(void) " -l the length of data that we want to dump\n"); if (mtd_fixtrx) { fprintf(stderr, + " -M magic number of the image header in the partition (for fixtrx)\n" " -o offset offset of the image header in the partition(for fixtrx)\n"); } if (mtd_fixtrx || mtd_fixseama || mtd_fixwrg || mtd_fixwrgg) { @@ -877,7 +879,7 @@ int main (int argc, char **argv) #ifdef FIS_SUPPORT "F:" #endif - "frnqe:d:s:j:p:o:c:t:l:")) != -1) + "frnqe:d:s:j:p:o:c:t:l:M:")) != -1) switch (ch) { case 'f': force = 1; @@ -929,6 +931,14 @@ int main (int argc, char **argv) usage(); } break; + case 'M': + errno = 0; + opt_trxmagic = strtoul(optarg, 0, 0); + if (errno) { + fprintf(stderr, "-M: illegal numeric string\n"); + usage(); + } + break; case 'o': errno = 0; offset = strtoul(optarg, 0, 0); diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h index 3eda6159c6..f2e44c7f5f 100644 --- a/package/system/mtd/src/mtd.h +++ b/package/system/mtd/src/mtd.h @@ -12,6 +12,7 @@ extern int quiet; extern int mtdsize; extern int erasesize; +extern uint32_t opt_trxmagic; extern int mtd_open(const char *mtd, bool block); extern int mtd_check_open(const char *mtd); diff --git a/package/system/mtd/src/trx.c b/package/system/mtd/src/trx.c index aaca232b6f..ab33acc400 100644 --- a/package/system/mtd/src/trx.c +++ b/package/system/mtd/src/trx.c @@ -35,7 +35,6 @@ #include "mtd.h" #include "crc32.h" -#define TRX_MAGIC 0x30524448 /* "HDR0" */ #define TRX_CRC32_DATA_OFFSET 12 /* First 12 bytes are not covered by CRC32 */ #define TRX_CRC32_DATA_SIZE 16 struct trx_header { @@ -92,7 +91,7 @@ trx_fixup(int fd, const char *name) } trx = ptr; - if (trx->magic != TRX_MAGIC) { + if (ntohl(trx->magic) != opt_trxmagic) { fprintf(stderr, "TRX header not found\n"); goto err; } @@ -128,7 +127,8 @@ trx_check(int imagefd, const char *mtd, char *buf, int *len) } } - if (trx->magic != TRX_MAGIC || trx->len < sizeof(struct trx_header)) { + if (ntohl(trx->magic) != opt_trxmagic || + trx->len < sizeof(struct trx_header)) { if (quiet < 2) { fprintf(stderr, "Bad trx header\n"); fprintf(stderr, "This is not the correct file format; refusing to flash.\n" @@ -202,7 +202,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size) } trx = (struct trx_header *)(first_block + offset); - if (trx->magic != STORE32_LE(0x30524448)) { + if (ntohl(trx->magic) != opt_trxmagic) { fprintf(stderr, "No trx magic found\n"); exit(1); } From 733c6a079ed4432e608ea6edc579c716f34d0535 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 16 Mar 2021 19:51:29 +0800 Subject: [PATCH 07/20] v2ray: update to 4.36.1 --- package/lean/v2ray/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index 4fb2c0cdd3..f5d5cffd80 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray -PKG_VERSION:=4.36.0 +PKG_VERSION:=4.36.1 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GHCODELOAD/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=2515c1addb961756b2d8c0e1a4d392882f51766335e4851121f58a7cb785eb2c +PKG_HASH:=edaa6dbc18096deb737ae656ddc952ead218aea3a2747477c210817e54a3847f PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From a91e7d85bb8daf3bdcc010ccb577110097faa48f Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 16 Mar 2021 23:55:44 +0800 Subject: [PATCH 08/20] v2ray: update to 4.36.2 Signed-off-by: Tianling Shen --- package/lean/v2ray/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index f5d5cffd80..5971c39262 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray -PKG_VERSION:=4.36.1 +PKG_VERSION:=4.36.2 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GHCODELOAD/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=edaa6dbc18096deb737ae656ddc952ead218aea3a2747477c210817e54a3847f +PKG_HASH:=e7f7ceefd4cd9d2e57d18cecf55228a5a126c6ed5ee53767660601c35e70535c PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From b05945c5d27520248e23c88ecb8181603da61acd Mon Sep 17 00:00:00 2001 From: Magnus Kroken Date: Sun, 14 Mar 2021 19:42:33 +0100 Subject: [PATCH 09/20] mbedtls: update to 2.16.10 This release of Mbed TLS provides bug fixes and minor enhancements. This release includes fixes for security issues. Security fixes: * Fix a buffer overflow in mbedtls_mpi_sub_abs() * Fix an errorneous estimation for an internal buffer in mbedtls_pk_write_key_pem() * Fix a stack buffer overflow with mbedtls_net_poll() and mbedtls_net_recv_timeout() * Guard against strong local side channel attack against base64 tables by making access aceess to them use constant flow code Full release announcement: https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.10 Signed-off-by: Magnus Kroken --- package/libs/mbedtls/Makefile | 4 ++-- package/libs/mbedtls/patches/200-config.patch | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 069e697817..1f806939ac 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.16.9 +PKG_VERSION:=2.16.10 PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=fc17ff7d8c11d08f23ae2800a18269408ad2c24ea6bb8b9363e41a01c2425697 +PKG_HASH:=96257bb03b30300b2f35f861ffe204ed957e9fd0329d80646fe57fc49f589b29 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0-or-later diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index 4cdeed921d..1e3d41f0eb 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -144,7 +144,7 @@ /** * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -1779,7 +1779,7 @@ +@@ -1796,7 +1796,7 @@ * * Comment this to disable run-time checking and save ROM space */ @@ -153,7 +153,7 @@ /** * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -2109,7 +2109,7 @@ +@@ -2126,7 +2126,7 @@ * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 */ @@ -162,7 +162,7 @@ /** * \def MBEDTLS_ARIA_C -@@ -2175,7 +2175,7 @@ +@@ -2192,7 +2192,7 @@ * This module enables the AES-CCM ciphersuites, if other requisites are * enabled as well. */ @@ -171,7 +171,7 @@ /** * \def MBEDTLS_CERTS_C -@@ -2187,7 +2187,7 @@ +@@ -2204,7 +2204,7 @@ * * This module is used for testing (ssl_client/server). */ @@ -180,7 +180,7 @@ /** * \def MBEDTLS_CHACHA20_C -@@ -2295,7 +2295,7 @@ +@@ -2312,7 +2312,7 @@ * \warning DES is considered a weak cipher and its use constitutes a * security risk. We recommend considering stronger ciphers instead. */ @@ -189,7 +189,7 @@ /** * \def MBEDTLS_DHM_C -@@ -2458,7 +2458,7 @@ +@@ -2475,7 +2475,7 @@ * This module adds support for the Hashed Message Authentication Code * (HMAC)-based key derivation function (HKDF). */ @@ -198,7 +198,7 @@ /** * \def MBEDTLS_HMAC_DRBG_C -@@ -2768,7 +2768,7 @@ +@@ -2785,7 +2785,7 @@ * * This module enables abstraction of common (libc) functions. */ @@ -207,7 +207,7 @@ /** * \def MBEDTLS_POLY1305_C -@@ -2789,7 +2789,7 @@ +@@ -2806,7 +2806,7 @@ * Caller: library/md.c * */ @@ -216,7 +216,7 @@ /** * \def MBEDTLS_RSA_C -@@ -2896,7 +2896,7 @@ +@@ -2913,7 +2913,7 @@ * * Requires: MBEDTLS_CIPHER_C */ @@ -225,7 +225,7 @@ /** * \def MBEDTLS_SSL_CLI_C -@@ -2996,7 +2996,7 @@ +@@ -3013,7 +3013,7 @@ * * This module provides run-time version information. */ @@ -234,7 +234,7 @@ /** * \def MBEDTLS_X509_USE_C -@@ -3106,7 +3106,7 @@ +@@ -3123,7 +3123,7 @@ * Module: library/xtea.c * Caller: */ From 7e7ed4c080027d741084a6e2d7bd48feb575ab02 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 15 Mar 2021 15:59:26 -1000 Subject: [PATCH 10/20] build,ib: add STRIP_ABI option for manifest The ImageBuilder `make manifest` prints all installed packages. This function can be used to create a list of package and corresponding package versions before attempting image creation. When called with `--strip-abi` OPKG can automatically strip attached ABIVersions from package names. Make this function accessible for the ImageBuilder by adding a `STRIP_ABI` variable. Signed-off-by: Paul Spooren --- target/imagebuilder/files/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 03bb98b4fc..a16de90ebb 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -53,6 +53,7 @@ Print manifest: make manifest PROFILE="" # override the default target profile make manifest PACKAGES=" [ [ ...]]" # include extra packages + make manifest STRIP_ABI=1 # remove ABI version from printed package names endef $(eval $(call shexport,Helptext)) @@ -125,7 +126,7 @@ _call_manifest: FORCE mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR) $(MAKE) package_reload >/dev/null $(MAKE) package_install >/dev/null - $(OPKG) list-installed + $(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi) package_index: FORCE @echo >&2 From 1805a389a7801cfff65341f13ca3da07cf872423 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Sun, 14 Mar 2021 02:01:21 +0800 Subject: [PATCH 11/20] luci-app-passwall: sync with upstream source Co-authored-by: badgv <45598380+badgv@users.noreply.github.com> Signed-off-by: Tianling Shen --- .../model/cbi/passwall/api/gen_xray.lua | 135 ++++++++++-------- .../root/etc/uci-defaults/luci-app-passwall | 6 +- .../root/usr/share/passwall/app.sh | 1 + 3 files changed, 76 insertions(+), 66 deletions(-) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua index 746a13f78e..5498c5c562 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua @@ -40,7 +40,7 @@ local function get_new_port() return new_port end -function gen_outbound(node, tag, is_proxy) +function gen_outbound(node, tag, is_proxy, proxy_tag) local result = nil if node and node ~= "nil" then local node_id = node[".name"] @@ -48,20 +48,15 @@ function gen_outbound(node, tag, is_proxy) tag = node_id end - if is_proxy and is_proxy == "1" then - new_port = get_new_port() - table.insert(inbounds, { - tag = "proxy_" .. tag, - listen = "127.0.0.1", - port = new_port, - protocol = "dokodemo-door", - settings = {network = "tcp,udp", address = node.address, port = tonumber(node.port)} - }) - if node.tls_serverName == nil then - node.tls_serverName = node.address - end - node.address = "127.0.0.1" - node.port = new_port + if proxy_tag then + node.proxySettings = { + tag = proxy_tag, + transportLayer = true + } + end + + if node.type == "Xray" or node.type == "V2ray" then + is_proxy = nil end if node.type ~= "Xray" and node.type ~= "V2ray" then @@ -102,6 +97,7 @@ function gen_outbound(node, tag, is_proxy) _flag_tag = node_id, _flag_is_proxy = (is_proxy and is_proxy == "1") and "1" or "0", tag = tag, + proxySettings = node.proxySettings or nil, protocol = node.protocol, mux = (node.stream_security ~= "xtls") and { enabled = (node.mux == "1") and true or false, @@ -265,35 +261,41 @@ if node_section then else local default_node = ucursor:get_all(appname, default_node_id) local main_node_id = node.main_node or "nil" + local is_proxy = "0" + local proxy_tag if main_node_id ~= "nil" then - if main_node_id == default_node_id then - else - new_port = get_new_port() - table.insert(inbounds, { - tag = "proxy_default", - listen = "127.0.0.1", - port = new_port, - protocol = "dokodemo-door", - settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)} - }) - if default_node.tls_serverName == nil then - default_node.tls_serverName = default_node.address - end - default_node.address = "127.0.0.1" - default_node.port = new_port - local node = ucursor:get_all(appname, main_node_id) - local outbound = gen_outbound(node, "main") - if outbound then - table.insert(outbounds, outbound) - table.insert(rules, 1, { - type = "field", - inboundTag = {"proxy_default"}, - outboundTag = "main" - }) + if main_node_id ~= default_node_id then + local main_node = ucursor:get_all(appname, main_node_id) + local main_node_outbound = gen_outbound(main_node, "main") + if main_node_outbound then + table.insert(outbounds, main_node_outbound) + is_proxy = "1" + proxy_tag = "main" + if default_node.type ~= "Xray" and default_node.type ~= "V2ray" then + proxy_tag = nil + new_port = get_new_port() + table.insert(inbounds, { + tag = "proxy_default", + listen = "127.0.0.1", + port = new_port, + protocol = "dokodemo-door", + settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)} + }) + if default_node.tls_serverName == nil then + default_node.tls_serverName = default_node.address + end + default_node.address = "127.0.0.1" + default_node.port = new_port + table.insert(rules, 1, { + type = "field", + inboundTag = {"proxy_default"}, + outboundTag = "main" + }) + end end end end - local default_outbound = gen_outbound(default_node, "default") + local default_outbound = gen_outbound(default_node, "default", is_proxy, proxy_tag) if default_outbound then table.insert(outbounds, default_outbound) default_outboundTag = "default" @@ -326,15 +328,30 @@ if node_section then outboundTag = name else local _node = ucursor:get_all(appname, _node_id) - local _outbound = gen_outbound(_node, name, is_proxy) - if _outbound then + if node.type ~= "Xray" and node.type ~= "V2ray" then if is_proxy == "1" then + new_port = get_new_port() + table.insert(inbounds, { + tag = "proxy_" .. name, + listen = "127.0.0.1", + port = new_port, + protocol = "dokodemo-door", + settings = {network = "tcp,udp", address = _node.address, port = tonumber(_node.port)} + }) + if _node.tls_serverName == nil then + _node.tls_serverName = _node.address + end + _node.address = "127.0.0.1" + _node.port = new_port table.insert(rules, 1, { type = "field", inboundTag = {"proxy_" .. name}, outboundTag = "default" }) end + end + local _outbound = gen_outbound(_node, name, is_proxy, (is_proxy == "1" and "default" or nil)) + if _outbound then table.insert(outbounds, _outbound) outboundTag = name end @@ -451,10 +468,6 @@ if dns_server then network = "udp" } }) - table.insert(outbounds, { - protocol = "dns", - tag = "dns-out" - }) end table.insert(rules, { @@ -465,8 +478,9 @@ if dns_server then outboundTag = "dns-out" }) + local outboundTag = "direct" if doh_socks_address and doh_socks_port then - table.insert(outbounds, { + table.insert(outbounds, 1, { tag = "out", protocol = "socks", streamSettings = { @@ -482,22 +496,15 @@ if dns_server then } } }) - table.insert(rules, { - type = "field", - inboundTag = { - "dns-in1" - }, - outboundTag = "out" - }) - else - table.insert(rules, { - type = "field", - inboundTag = { - "dns-in1" - }, - outboundTag = "direct" - }) + outboundTag = "out" end + table.insert(rules, { + type = "field", + inboundTag = { + "dns-in1" + }, + outboundTag = outboundTag + }) routing = { domainStrategy = "IPOnDemand", @@ -522,6 +529,10 @@ if inbounds or outbounds then protocol = "blackhole", tag = "blackhole" }) + table.insert(outbounds, { + protocol = "dns", + tag = "dns-out" + }) local xray = { log = { diff --git a/package/lienol/luci-app-passwall/root/etc/uci-defaults/luci-app-passwall b/package/lienol/luci-app-passwall/root/etc/uci-defaults/luci-app-passwall index d46cafd109..efae9989d5 100755 --- a/package/lienol/luci-app-passwall/root/etc/uci-defaults/luci-app-passwall +++ b/package/lienol/luci-app-passwall/root/etc/uci-defaults/luci-app-passwall @@ -1,6 +1,8 @@ #!/bin/sh uci -q batch <<-EOF >/dev/null + set dhcp.@dnsmasq[0].localuse=1 + commit dhcp delete ucitrack.@passwall[-1] add ucitrack passwall set ucitrack.@passwall[-1].init=passwall @@ -25,9 +27,5 @@ uci -q batch <<-EOF >/dev/null commit uhttpd EOF -tmp=$(uci -q get passwall.@global_app[0].xray_file) -[ -z "$tmp" ] && uci set passwall.@global_app[0].xray_file="/usr/bin/xray" -uci commit passwall - rm -rf /tmp/luci-*cache exit 0 diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh index f30f5ff485..eec560dcdd 100755 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh @@ -1112,6 +1112,7 @@ gen_pdnsd_config() { purge_cache = off; proxy_only = on; caching = $_cache; + reject=::/0; } EOF echolog " | - [$?]上游DNS:${2}:${3}" From dae84e580fd7d3db0c12ed33ff432e06f8649245 Mon Sep 17 00:00:00 2001 From: maple's sky Date: Sun, 14 Mar 2021 22:23:44 +0800 Subject: [PATCH 12/20] luci-app-jd-dailybonus: sync with upstream source Co-authored-by: Mattraks <16359027+Mattraks@users.noreply.github.com> Co-authored-by: jerrykuku Signed-off-by: Tianling Shen --- .../ctcgfw/luci-app-jd-dailybonus/Makefile | 4 +- .../luasrc/model/cbi/jd-dailybonus/client.lua | 15 +- .../view/jd-dailybonus/cookie_tools.htm | 37 +- .../root/etc/config/jd-dailybonus | 4 +- .../usr/share/jd-dailybonus/JD_DailyBonus.js | 337 +++++++----------- .../usr/share/jd-dailybonus/gen_cookieset.lua | 13 +- 6 files changed, 163 insertions(+), 247 deletions(-) diff --git a/package/ctcgfw/luci-app-jd-dailybonus/Makefile b/package/ctcgfw/luci-app-jd-dailybonus/Makefile index eff98275f7..ec8b9a3f1c 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/Makefile +++ b/package/ctcgfw/luci-app-jd-dailybonus/Makefile @@ -12,8 +12,8 @@ LUCI_DEPENDS:=+libuci-lua +lua +node +node-request +wget-ssl LUCI_PKGARCH:=all PKG_NAME:=luci-app-jd-dailybonus -PKG_VERSION:=1.0.3 -PKG_RELEASE:=20210125 +PKG_VERSION:=1.0.5 +PKG_RELEASE:=20210316 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/model/cbi/jd-dailybonus/client.lua b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/model/cbi/jd-dailybonus/client.lua index d1cf607662..8caa7e1a44 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/model/cbi/jd-dailybonus/client.lua +++ b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/model/cbi/jd-dailybonus/client.lua @@ -8,16 +8,14 @@ m = Map(jd) s = m:section(TypedSection, 'global', translate('基本设置')) s.anonymous = true +o = s:option(DynamicList, "Cookies", translate("账号 Cookie 列表")) +o.rmempty = false +o.description = translate('双击输入框即可调出二维码,扫描后自动填入。') + o = s:option(DummyValue, '', '') o.rawhtml = true o.template = 'jd-dailybonus/cookie_tools' -o = s:option(Value, 'cookie', translate('第一账号Cookie')) -o.rmempty = false - -o = s:option(Value, 'cookie2', translate('第二账号Cookie')) -o.rmempty = true - o = s:option(Value, 'stop', translate('延迟签到')) o.rmempty = false o.default = 0 @@ -87,8 +85,9 @@ o:depends('auto_update', '1') o = s:option(Value, 'remote_url', translate('更新源地址')) o:value('https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub')) -o:value('https://cdn.jsdelivr.net/gh/NobyDa/Script/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN')) -o:value('https://gitee.com/jerrykuku/staff/raw/master/JD_DailyBonus.js', translate('Gitee')) +o:value('https://raw.sevencdn.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN 01')) +o:value('https://cdn.jsdelivr.net/gh/NobyDa/Script/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN 02')) +o:value('https://ghproxy.com/https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('韩国首尔')) o.default = 'nil' o.rmempty = false o.description = translate('当GitHub源无法更新时,可以选择使用国内Gitee源,GitHub CDN可能比原地址更晚更新,但速度快') diff --git a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/view/jd-dailybonus/cookie_tools.htm b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/view/jd-dailybonus/cookie_tools.htm index 705dde9270..d2edd25cb1 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/view/jd-dailybonus/cookie_tools.htm +++ b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/view/jd-dailybonus/cookie_tools.htm @@ -65,17 +65,6 @@ padding: 1rem 0 0 0; } - - -
- - -
-
- 帮助 - <%= translate("点击上面按钮使用京东手机app扫码获取Cookie")%> -
-