kiddin9 3 年之前
父節點
當前提交
3548b008e8
共有 28 個文件被更改,包括 37 次插入1436 次删除
  1. 28 17
      .github/workflows/Openwrt-AutoBuild.yml
  2. 2 0
      Dockerfile
  3. 0 2
      devices/common/.config
  4. 5 14
      devices/common/diy.sh
  5. 0 45
      devices/common/diy/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/19_cpu.js
  6. 0 11
      devices/common/diy/package/base-files/files/etc/banner
  7. 0 401
      devices/common/diy/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch
  8. 0 8
      devices/common/diy/package/system/opkg/patches/ignore_error.patch
  9. 0 8
      devices/common/diy/package/system/opkg/patches/user_agent.patch
  10. 0 59
      devices/common/diy/package/system/opkg/patches/zh-cn.patch
  11. 0 1
      devices/common/files/lib/upgrade/keep.d/php7
  12. 0 65
      devices/common/patches/ARMV8CE_AES.patch
  13. 0 11
      devices/common/patches/add_Fullcone-NAT_option.patch
  14. 0 10
      devices/common/patches/colored_shell.patch
  15. 0 9
      devices/common/patches/disable_network_rollback.patch
  16. 0 43
      devices/common/patches/dispatcher.patch
  17. 0 13
      devices/common/patches/dns_redirect.patch
  18. 0 29
      devices/common/patches/hijack-domain.patch
  19. 0 26
      devices/common/patches/luci-add-filter-aaaa-option.patch
  20. 0 16
      devices/common/patches/min-ttl.patch
  21. 0 57
      devices/common/patches/nginx_luci.patch
  22. 0 222
      devices/common/patches/opkginstall.patch
  23. 0 38
      devices/common/patches/package.patch
  24. 0 11
      devices/common/patches/profile.patch
  25. 0 165
      devices/common/patches/status.patch
  26. 0 60
      devices/common/patches/turboacc.patch
  27. 0 93
      devices/common/patches/wireless.patch
  28. 2 2
      devices/nanopi-r2s/diy.sh

+ 28 - 17
.github/workflows/Openwrt-AutoBuild.yml

@@ -202,32 +202,30 @@ jobs:
         mv -f .config ${{matrix.target}}.config
         if [ "${{matrix.target}}" == "nanopi-r2s" ]; then
             echo "开始编译R2C"
+            cp -f devices/common/$CONFIG_FILE .config
+            echo >> .config
             cat devices/nanopi-r2c/$CONFIG_FILE >> .config
             make defconfig
-            make -j$(($(nproc)+1)) || make -j1 V=s || (echo "R2C编译失败" && exit 0;)
+            make -j$(($(nproc)+1)) || make -j1 V=s || {
+            echo "R2C编译失败";
+            exit 1;
+            }
             mv -f .config nanopi-r2c.config
             echo "开始编译R4S"
+            cp -f devices/common/$CONFIG_FILE .config
+            echo >> .config
             cat devices/nanopi-r4s/$CONFIG_FILE >> .config
             make defconfig
-            make -j$(($(nproc)+1)) || make -j1 V=s || (echo "R4S编译失败" && exit 0;)
+            make -j$(($(nproc)+1)) || make -j1 V=s || {
+            echo "R4S编译失败";
+            exit 1;
+            }
             mv -f .config nanopi-r4s.config
         fi
-        rm -rf bin/targets/*/*/packages/
    
     - name: Check space usage
       run: df -hT
 
-    - name: Deploy imagebuilder to server
-      uses: easingthemes/ssh-deploy@main
-      if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
-      with:
-        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
-        ARGS: "-avzr"
-        SOURCE: openwrt/bin/targets
-        REMOTE_HOST: op.supes.top
-        REMOTE_USER: root
-        TARGET: "/www/wwwroot/op.supes.top/releases/${{ env.REPO_BRANCH }}/"
-
     - name: Organize files
       id: organize
       run: |
@@ -238,6 +236,7 @@ jobs:
         cp openwrt/build_dir/target-*/linux-*/linux-*/.config ./firmware/${{matrix.target}}/${{matrix.target}}_kernel.config
         kernel_v="$(cat openwrt/include/kernel-5.10 | grep LINUX_KERNEL_HASH-5.10* | cut -f 2 -d - | cut -f 1 -d ' ')"
         cp -rf openwrt/bin/targets/*/*/packages ./kmods/$kernel_v
+        rm -rf openwrt/bin/targets/*/*/packages/*.ipk
         cp -rf openwrt/bin/targets/*/*/*r4s*sysupgrade* ./firmware/nanopi-r4s/ || true
         cp -rf openwrt/bin/targets/*/*/*r2c*sysupgrade* ./firmware/nanopi-r2c/ || true
         cp -rf openwrt/bin/targets/*/*/*{combined,sysupgrade}* ./firmware/${{matrix.target}}/ || true
@@ -249,7 +248,6 @@ jobs:
           echo $md5 >> $i/version.txt
           echo v$REPO_BRANCH >> $i/version.txt
         done
-        [ "${{matrix.target}}" == "nanopi-r2s" ] && rm -rf openwrt/bin/targets/*/*/*{r2c,r4s}*
         Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
         echo "EMOJI=${Emoji[$[$RANDOM % ${#Emoji[@]}]]}" >> $GITHUB_ENV
         if [ ${{matrix.target}} == "x86_64" ]; then
@@ -279,13 +277,26 @@ jobs:
         REMOTE_USER: root
         TARGET: "/www/wwwroot/op.supes.top/packages/${{ env.MTARGET }}/kmods/"
 
+    - name: Deploy imagebuilder to server
+      uses: easingthemes/ssh-deploy@main
+      if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
+      with:
+        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
+        ARGS: "-avzr"
+        SOURCE: openwrt/bin/targets
+        REMOTE_HOST: op.supes.top
+        REMOTE_USER: root
+        TARGET: "/www/wwwroot/op.supes.top/releases/${{ env.REPO_BRANCH }}/"
+
     - name: Upload firmware for artifact
       uses: actions/upload-artifact@main
       continue-on-error: true
       if: env.UPLOAD_FIRMWARE_FOR_ARTIFACT == 'true'
       with:
         name: ${{ env.VERSION }} ${{matrix.target}}
-        path: ./firmware/
+        path: |
+          ./firmware/
+          openwrt/bin/targets/*/
 
     - name: Upload firmware to cowtransfer
       if: env.UPLOAD_FIRMWARE_TO_COWTRANSFER == 'true'
@@ -340,7 +351,7 @@ jobs:
       with:
         username: ${{ secrets.DOCKER_ID }}
         password: ${{ secrets.DOCKER_PASSWD }}
-        
+
     - name: Build and push docker image
       uses: docker/build-push-action@master
       continue-on-error: true

+ 2 - 0
Dockerfile

@@ -3,3 +3,5 @@ FROM scratch
 MAINTAINER Kiddin9 "https://github.com/kiddin9/OpenWrt_x86-r2s-r4s"
 
 ADD openwrt/bin/targets/*/*/*rootfs*.tar.gz /
+
+RUN if [[ -f /*r2s* && -f /*r4s* ]] ; then rm -rf /*{r2c,r4s}* ; fi

+ 0 - 2
devices/common/.config

@@ -30,7 +30,6 @@ CONFIG_PACKAGE_luci-app-upnp=y
 CONFIG_PACKAGE_luci-app-autoreboot=y
 CONFIG_PACKAGE_luci-app-wizard=y
 CONFIG_PACKAGE_luci-app-ksmbd=y
-CONFIG_PACKAGE_luci-app-nginx-manager=y
 CONFIG_PACKAGE_luci-app-attendedsysupgrade=y
 
 # Themes
@@ -59,7 +58,6 @@ CONFIG_PACKAGE_coremark=y
 CONFIG_DEVEL=y
 CONFIG_CCACHE=y
 CONFIG_TOOLCHAINOPTS=y
-CONFIG_GCC_USE_VERSION_10=y
 CONFIG_COREMARK_OPTIMIZE_O3=y
 CONFIG_COREMARK_ENABLE_MULTITHREADING=y
 CONFIG_COREMARK_NUMBER_OF_THREADS=16

+ 5 - 14
devices/common/diy.sh

@@ -29,19 +29,18 @@ sed -i '/	refresh_config();/d' scripts/feeds
 sed -i '$a src-git kiddin9 https://github.com/kiddin9/openwrt-packages.git;master' feeds.conf.default
 }
 
+rm -rf package{base-files,network/config/firewall,network/services/dnsmasq,network/services/ppp,system/opkg,libs/mbedtls}
+
 ./scripts/feeds update -a
 ./scripts/feeds install -a -p kiddin9
 ./scripts/feeds install -a
 cd feeds/kiddin9; git pull; cd -
 
 (
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/ppp package/network/services/ppp
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/dnsmasq package/network/services/dnsmasq
 svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
 svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
 svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.10 target/linux/generic/hack-5.10
 rm -rf target/linux/generic/hack-5.10/{220-gc_sections*,781-dsa-register*}
-curl -sfL https://git.io/J0klM --create-dirs -o package/network/config/firewall/patches/fullconenat.patch
 ) &
 
 sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
@@ -52,25 +51,17 @@ sed -i 's/install $(BUILD_PACKAGES)/install --force-overwrite --force-checksum -
 sed -i "/mediaurlbase/d" package/feeds/*/luci-theme*/root/etc/uci-defaults/*
 sed -i '/root:/c\root:$1$tTPCBw1t$ldzfp37h5lSpO9VXk4uUE\/:18336:0:99999:7:::' package/base-files/files/etc/shadow
 sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf
-sed -i -e '$a /etc/bench.log' \
-       -e '/\/etc\/profile/d' \
-       -e '/\/etc\/shinit/d' \
-       package/base-files/files/lib/upgrade/keep.d/base-files-essential
-sed -i -e '/^\/etc\/profile/d' \
-       -e '/^\/etc\/shinit/d' \
-       package/base-files/Makefile
+
 # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
 sed -i '$a CONFIG_ACPI=y\nCONFIG_X86_ACPI_CPUFREQ=y\nCONFIG_NR_CPUS=128\nCONFIG_FAT_DEFAULT_IOCHARSET="utf8"\nCONFIG_CRYPTO_CHACHA20_NEON=y\n \
 CONFIG_CRYPTO_CHACHA20POLY1305=y\nCONFIG_BINFMT_MISC=y' `find target/linux -path "target/linux/*/config-*"`
 sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
 #rm -rf ./feeds/packages/lang/{golang,node}
-sed -i 's?admin/status/channel_analysis??' package/feeds/luci/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
+
 sed -i "s/tty1::askfirst/tty1::respawn/g" target/linux/*/base-files/etc/inittab
 date=`date +%m.%d.%Y`
 sed -i -e "/# REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk
-sed -i "/DISTRIB_DESCRIPTION/c\DISTRIB_DESCRIPTION=\"%D %C by Kiddin'\"" package/base-files/files/etc/openwrt_release
-sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-*.ini
-sed -i '/limit-as/c\limit-as = 5000' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
+
 sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
 sed -i 's/ +kmod-thermal//' package/kernel/mt76/Makefile
 

+ 0 - 45
devices/common/diy/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/19_cpu.js

@@ -1,45 +0,0 @@
-'use strict';
-'require rpc';
-
-var callCPUFreeInfo = rpc.declare({
-	object: 'luci',
-	method: 'getCPUInfo'
-});
-
-function progressbar(value, max) {
-	var vn = parseInt(value) || 0,
-	    mn = parseInt(max) || 100,
-	    pc = Math.floor((100 / mn) * vn);
-
-	return E('div', {
-		'class': 'cbi-progressbar',
-		'title': '%s%% / %s%%'.format(vn, mn, pc)
-	}, E('div', { 'style': 'width:%.2f%%'.format(pc) }));
-}
-
-return L.Class.extend({
-	title: _('CPU'),
-
-	load: function() {
-		return L.resolveDefault(callCPUFreeInfo(), {});
-	},
-
-	render: function(info) {
-		var fields = [
-			_('Used'), (info.cpufree) ? info.cpufree : 0, 100
-		];
-
-		var table = E('div', { 'class': 'table cpu' });
-
-		for (var i = 0; i < fields.length; i += 3) {
-			table.appendChild(E('div', { 'class': 'tr' }, [
-				E('div', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
-				E('div', { 'class': 'td left' }, [
-					(fields[i + 1] != null) ? progressbar(fields[i + 1], fields[i + 2], true) : '?'
-				])
-			]));
-		}
-
-		return table;
-	}
-});

+ 0 - 11
devices/common/diy/package/base-files/files/etc/banner

@@ -1,11 +0,0 @@
-                                                 _____
-      _____________________________      __________  /_
-      _  __ \__  __ \  _ \_  __ \_ | /| / /_  ___/  __/
-      / /_/ /_  /_/ /  __/  / / /_ |/ |/ /_  /   / /_
-      \____/_  .___/\___//_/ /_/____/|__/ /_/    \__/
-            /_/    
-         _________________________________________
-			   
-               %D %C by Kiddin'
-         _________________________________________
-	 

+ 0 - 401
devices/common/diy/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch

@@ -1,401 +0,0 @@
-From dfb6015ca79a9fee28f7fcb0af7e350a83574b83 Mon Sep 17 00:00:00 2001
-From: "Markku-Juhani O. Saarinen" <[email protected]>
-Date: Mon, 20 Nov 2017 14:58:41 +0000
-Subject: Implements AES and GCM with ARMv8 Crypto Extensions
-
-A compact patch that provides AES and GCM implementations that utilize the
-ARMv8 Crypto Extensions. The config flag is MBEDTLS_ARMV8CE_AES_C, which
-is disabled by default as we don't do runtime checking for the feature.
-The new implementation lives in armv8ce_aes.c.
-
-Provides similar functionality to https://github.com/ARMmbed/mbedtls/pull/432
-Thanks to Barry O'Rourke and others for that contribtion.
-
-Tested on a Cortex A53 device and QEMU. On a midrange phone the real AES-GCM
-throughput increases about 4x, while raw AES speed is up to 10x faster.
-
-When cross-compiling, you want to set something like:
-
-  export CC='aarch64-linux-gnu-gcc'
-  export CFLAGS='-Ofast -march=armv8-a+crypto'
-  scripts/config.pl set MBEDTLS_ARMV8CE_AES_C
-
-QEMU seems to also need
-
-  export LDFLAGS='-static'
-
-Then run normal make or cmake etc.
----
-
-diff -ruNa --binary a/ChangeLog.d/armv8_crypto_extensions.txt b/ChangeLog.d/armv8_crypto_extensions.txt
---- a/ChangeLog.d/armv8_crypto_extensions.txt	1970-01-01 08:00:00.000000000 +0800
-+++ b/ChangeLog.d/armv8_crypto_extensions.txt	2021-03-07 15:07:17.781911791 +0800
-@@ -0,0 +1,2 @@
-+Features
-+    * Support ARMv8 Cryptography Extensions for AES and GCM.
-diff -ruNa --binary a/include/mbedtls/armv8ce_aes.h b/include/mbedtls/armv8ce_aes.h
---- a/include/mbedtls/armv8ce_aes.h	1970-01-01 08:00:00.000000000 +0800
-+++ b/include/mbedtls/armv8ce_aes.h	2021-03-07 15:07:17.781911791 +0800
-@@ -0,0 +1,63 @@
-+/**
-+ * \file armv8ce_aes.h
-+ *
-+ * \brief ARMv8 Cryptography Extensions -- Optimized code for AES and GCM
-+ */
-+
-+/*
-+ *
-+ *  Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
-+ *  SPDX-License-Identifier: Apache-2.0
-+ *
-+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
-+ *  not use this file except in compliance with the License.
-+ *  You may obtain a copy of the License at
-+ *
-+ *  http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ *  Unless required by applicable law or agreed to in writing, software
-+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ *  See the License for the specific language governing permissions and
-+ *  limitations under the License.
-+ *
-+ *  This file is part of mbed TLS (https://tls.mbed.org)
-+ */
-+
-+#ifndef MBEDTLS_ARMV8CE_AES_H
-+#define MBEDTLS_ARMV8CE_AES_H
-+
-+#include "aes.h"
-+
-+/**
-+ * \brief          [ARMv8 Crypto Extensions] AES-ECB block en(de)cryption
-+ *
-+ * \param ctx      AES context
-+ * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
-+ * \param input    16-byte input block
-+ * \param output   16-byte output block
-+ *
-+ * \return         0 on success (cannot fail)
-+ */
-+
-+int mbedtls_armv8ce_aes_crypt_ecb( mbedtls_aes_context *ctx,
-+                                   int mode,
-+                                   const unsigned char input[16],
-+                                   unsigned char output[16] );
-+
-+/**
-+ * \brief          [ARMv8 Crypto Extensions]  Multiply in GF(2^128) for GCM
-+ *
-+ * \param c        Result
-+ * \param a        First operand
-+ * \param b        Second operand
-+ *
-+ * \note           Both operands and result are bit strings interpreted as
-+ *                 elements of GF(2^128) as per the GCM spec.
-+ */
-+
-+void mbedtls_armv8ce_gcm_mult( unsigned char c[16],
-+                               const unsigned char a[16],
-+                               const unsigned char b[16] );
-+
-+#endif /* MBEDTLS_ARMV8CE_AES_H */
-diff -ruNa --binary a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
---- a/include/mbedtls/check_config.h	2020-12-10 20:54:15.000000000 +0800
-+++ b/include/mbedtls/check_config.h	2021-03-07 15:06:45.625543309 +0800
-@@ -95,6 +95,10 @@
- #error "MBEDTLS_AESNI_C defined, but not all prerequisites"
- #endif
- 
-+#if defined(MBEDTLS_ARMV8CE_AES_C) && !defined(MBEDTLS_HAVE_ASM)
-+#error "MBEDTLS_ARMV8CE_AES_C defined, but not all prerequisites"
-+#endif
-+
- #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
- #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
- #endif
-@@ -772,3 +776,4 @@
- typedef int mbedtls_iso_c_forbids_empty_translation_units;
- 
- #endif /* MBEDTLS_CHECK_CONFIG_H */
-+
-diff -ruNa --binary a/include/mbedtls/config.h b/include/mbedtls/config.h
---- a/include/mbedtls/config.h	2020-12-10 20:54:15.000000000 +0800
-+++ b/include/mbedtls/config.h	2021-03-07 15:14:27.957855484 +0800
-@@ -73,6 +73,7 @@
-  * Requires support for asm() in compiler.
-  *
-  * Used in:
-+ *      library/armv8ce_aes.c
-  *      library/aria.c
-  *      library/timing.c
-  *      include/mbedtls/bn_mul.h
-@@ -1888,6 +1889,21 @@
- #define MBEDTLS_AESNI_C
- 
- /**
-+ * \def MBEDTLS_ARMV8CE_AES_C
-+ *
-+ * Enable ARMv8 Crypto Extensions for AES and GCM
-+ *
-+ * Module:  library/armv8ce_aes.c
-+ * Caller:  library/aes.c
-+ *          library/gcm.c
-+ *
-+ * Requires: MBEDTLS_HAVE_ASM
-+ *
-+ * This module adds support for Armv8 Cryptography Extensions for AES and GCM.
-+ */
-+//#define MBEDTLS_ARMV8CE_AES_C
-+
-+/**
-  * \def MBEDTLS_AES_C
-  *
-  * Enable the AES block cipher.
-diff -ruNa --binary a/library/aes.c b/library/aes.c
---- a/library/aes.c	2020-12-10 20:54:15.000000000 +0800
-+++ b/library/aes.c	2021-03-07 15:06:45.625543309 +0800
-@@ -69,7 +69,9 @@
- #if defined(MBEDTLS_AESNI_C)
- #include "mbedtls/aesni.h"
- #endif
--
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+#include "mbedtls/armv8ce_aes.h"
-+#endif
- #if defined(MBEDTLS_SELF_TEST)
- #if defined(MBEDTLS_PLATFORM_C)
- #include "mbedtls/platform.h"
-@@ -1052,6 +1054,11 @@
-         return( mbedtls_aesni_crypt_ecb( ctx, mode, input, output ) );
- #endif
- 
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+	// We don't do runtime checking for ARMv8 Crypto Extensions
-+	return mbedtls_armv8ce_aes_crypt_ecb( ctx, mode, input, output );
-+#endif
-+
- #if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
-     if( aes_padlock_ace )
-     {
-diff -ruNa --binary a/library/armv8ce_aes.c b/library/armv8ce_aes.c
---- a/library/armv8ce_aes.c	1970-01-01 08:00:00.000000000 +0800
-+++ b/library/armv8ce_aes.c	2021-03-07 15:07:17.781911791 +0800
-@@ -0,0 +1,142 @@
-+/*
-+ *  ARMv8 Cryptography Extensions -- Optimized code for AES and GCM
-+ *
-+ *  Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
-+ *  SPDX-License-Identifier: Apache-2.0
-+ *
-+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
-+ *  not use this file except in compliance with the License.
-+ *  You may obtain a copy of the License at
-+ *
-+ *  http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ *  Unless required by applicable law or agreed to in writing, software
-+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ *  See the License for the specific language governing permissions and
-+ *  limitations under the License.
-+ *
-+ *  This file is part of mbed TLS (https://tls.mbed.org)
-+ */
-+
-+#if !defined(MBEDTLS_CONFIG_FILE)
-+#include "mbedtls/config.h"
-+#else
-+#include MBEDTLS_CONFIG_FILE
-+#endif
-+
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+
-+#include <arm_neon.h>
-+#include "mbedtls/armv8ce_aes.h"
-+
-+#ifndef asm
-+#define asm __asm
-+#endif
-+
-+/*
-+ *  [Armv8 Cryptography Extensions]  AES-ECB block en(de)cryption
-+ */
-+
-+#if defined(MBEDTLS_AES_C)
-+
-+int mbedtls_armv8ce_aes_crypt_ecb( mbedtls_aes_context *ctx,
-+                                   int mode,
-+                                   const unsigned char input[16],
-+                                   unsigned char output[16] )
-+{
-+    unsigned int i;
-+    const uint8_t *rk;
-+    uint8x16_t x, k;
-+
-+    x = vld1q_u8( input );                          /* input block */
-+    rk = (const uint8_t *) ctx->rk;                 /* round keys  */
-+
-+    if( mode == MBEDTLS_AES_ENCRYPT )
-+    {
-+        for( i = ctx->nr - 1; i != 0; i-- )         /* encryption loop */
-+        {
-+            k = vld1q_u8( rk );
-+            rk += 16;
-+            x = vaeseq_u8( x, k );
-+            x = vaesmcq_u8( x );
-+        }
-+        k = vld1q_u8( rk );
-+        rk += 16;
-+        x = vaeseq_u8( x, k );
-+    }
-+    else
-+    {
-+        for( i = ctx->nr - 1; i != 0 ; i-- )         /* decryption loop */
-+        {
-+            k = vld1q_u8( rk );
-+            rk += 16;
-+            x = vaesdq_u8( x, k );
-+            x = vaesimcq_u8( x );
-+        }
-+        k = vld1q_u8( rk );
-+        rk += 16;
-+        x = vaesdq_u8( x, k );
-+    }
-+
-+    k = vld1q_u8( rk );                             /* final key just XORed */
-+    x = veorq_u8( x, k );
-+    vst1q_u8( output, x );                          /* write out */
-+
-+    return ( 0 );
-+}
-+
-+#endif /* MBEDTLS_AES_C */
-+
-+
-+/*
-+ *  [Armv8 Cryptography Extensions]  Multiply in GF(2^128) for GCM
-+ */
-+
-+#if defined(MBEDTLS_GCM_C)
-+
-+void mbedtls_armv8ce_gcm_mult( unsigned char c[16],
-+                               const unsigned char a[16],
-+                               const unsigned char b[16] )
-+{
-+    /* GCM's GF(2^128) polynomial basis is x^128 + x^7 + x^2 + x + 1 */
-+    const uint64x2_t base = { 0, 0x86 };            /* note missing LS bit */
-+
-+    register uint8x16_t vc asm( "v0" );             /* named registers */
-+    register uint8x16_t va asm( "v1" );             /* (to avoid conflict) */
-+    register uint8x16_t vb asm( "v2" );
-+    register uint64x2_t vp asm( "v3" );
-+
-+    va = vld1q_u8( a );                             /* load inputs */
-+    vb = vld1q_u8( b );
-+    vp = base;
-+
-+    asm (
-+        "rbit    %1.16b, %1.16b             \n\t"   /* reverse bit order */
-+        "rbit    %2.16b, %2.16b             \n\t"
-+        "pmull2  %0.1q,  %1.2d,  %2.2d      \n\t"   /* v0 = a.hi * b.hi */
-+        "pmull2  v4.1q,  %0.2d,  %3.2d      \n\t"   /* mul v0 by x^64, reduce */
-+        "ext     %0.16b, %0.16b, %0.16b, #8 \n\t"
-+        "eor     %0.16b, %0.16b, v4.16b     \n\t"
-+        "ext     v5.16b, %2.16b, %2.16b, #8 \n\t"   /* (swap hi and lo in b) */
-+        "pmull   v4.1q,  %1.1d,  v5.1d      \n\t"   /* v0 ^= a.lo * b.hi */
-+        "eor     %0.16b, %0.16b, v4.16b     \n\t"
-+        "pmull2  v4.1q,  %1.2d,  v5.2d      \n\t"   /* v0 ^= a.hi * b.lo */
-+        "eor     %0.16b, %0.16b, v4.16b     \n\t"
-+        "pmull2  v4.1q,  %0.2d,  %3.2d      \n\t"   /* mul v0 by x^64, reduce */
-+        "ext     %0.16b, %0.16b, %0.16b, #8 \n\t"
-+        "eor     %0.16b, %0.16b, v4.16b     \n\t"
-+        "pmull   v4.1q,  %1.1d,  %2.1d      \n\t"   /* v0 ^= a.lo * b.lo */
-+        "eor     %0.16b, %0.16b, v4.16b     \n\t"
-+        "rbit    %0.16b, %0.16b             \n\t"   /* reverse bits for output */
-+        : "=w" (vc)                                 /* q0:      output */
-+        : "w" (va), "w" (vb), "w" (vp)              /* q1, q2:  input */
-+        : "v4", "v5"                                /* q4, q5:  clobbered */
-+    );
-+
-+    vst1q_u8( c, vc );                              /* write out */
-+}
-+
-+#endif /* MBEDTLS_GCM_C */
-+
-+#endif /* MBEDTLS_ARMV8CE_AES_C */
-diff -ruNa --binary a/library/CMakeLists.txt b/library/CMakeLists.txt
---- a/library/CMakeLists.txt	2020-12-10 20:54:15.000000000 +0800
-+++ b/library/CMakeLists.txt	2021-03-07 15:06:45.625543309 +0800
-@@ -7,6 +7,7 @@
-     aesni.c
-     arc4.c
-     aria.c
-+    armv8ce_aes.c
-     asn1parse.c
-     asn1write.c
-     base64.c
-diff -ruNa --binary a/library/gcm.c b/library/gcm.c
---- a/library/gcm.c	2020-12-10 20:54:15.000000000 +0800
-+++ b/library/gcm.c	2021-03-07 15:06:45.625543309 +0800
-@@ -71,6 +71,10 @@
- #include "mbedtls/aesni.h"
- #endif
- 
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+#include "mbedtls/armv8ce_aes.h"
-+#endif
-+
- #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
- #include "mbedtls/aes.h"
- #include "mbedtls/platform.h"
-@@ -140,6 +144,12 @@
-     if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, h, 16, h, &olen ) ) != 0 )
-         return( ret );
- 
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+	// we don't do feature testing with ARMv8 cryptography extensions
-+    memcpy( ctx ->HL, h, 16 );          // put H at the beginning of buffer
-+    return( 0 );                        // that's all we need
-+#endif
-+
-     /* pack h as two 64-bits ints, big-endian */
-     GET_UINT32_BE( hi, h,  0  );
-     GET_UINT32_BE( lo, h,  4  );
-@@ -248,6 +258,11 @@
-     unsigned char lo, hi, rem;
-     uint64_t zh, zl;
- 
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+	mbedtls_armv8ce_gcm_mult( output, x, (const unsigned char *) ctx->HL );
-+	return;
-+#endif
-+
- #if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
-     if( mbedtls_aesni_has_support( MBEDTLS_AESNI_CLMUL ) ) {
-         unsigned char h[16];
-diff -ruNa --binary a/library/Makefile b/library/Makefile
---- a/library/Makefile	2020-12-10 20:54:15.000000000 +0800
-+++ b/library/Makefile	2021-03-07 15:12:49.277078224 +0800
-@@ -65,6 +65,7 @@
- 
- OBJS_CRYPTO=	aes.o		aesni.o		arc4.o		\
- 		aria.o		asn1parse.o	asn1write.o	\
-+		armv8ce_aes.o					\
- 		base64.o	bignum.o	blowfish.o	\
- 		camellia.o	ccm.o		chacha20.o	\
- 		chachapoly.o	cipher.o	cipher_wrap.o	\
-diff -ruNa --binary a/library/version_features.c b/library/version_features.c
---- a/library/version_features.c	2020-12-10 20:54:15.000000000 +0800
-+++ b/library/version_features.c	2021-03-07 15:06:45.625543309 +0800
-@@ -583,6 +583,9 @@
- #if defined(MBEDTLS_AESNI_C)
-     "MBEDTLS_AESNI_C",
- #endif /* MBEDTLS_AESNI_C */
-+#if defined(MBEDTLS_ARMV8CE_AES_C)
-+    "MBEDTLS_ARMV8CE_AES_C",
-+#endif /* MBEDTLS_ARMV8CE_AES_C */
- #if defined(MBEDTLS_AES_C)
-     "MBEDTLS_AES_C",
- #endif /* MBEDTLS_AES_C */
-

+ 0 - 8
devices/common/diy/package/system/opkg/patches/ignore_error.patch

@@ -1,8 +0,0 @@
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -1422,5 +1422,4 @@
- 			 "package \"%s\" %s script returned status %d.\n",
- 			 pkg->name, script, err);
--		return err;
- 	}
- 

+ 0 - 8
devices/common/diy/package/system/opkg/patches/user_agent.patch

@@ -1,8 +0,0 @@
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -154,4 +154,5 @@
- 		argv[i++] = "wget";
- 		argv[i++] = "-q";
-+		argv[i++] = "--user-agent=Kiddin\'";
- 		if (conf->no_check_certificate) {
- 			argv[i++] = "--no-check-certificate";

+ 0 - 59
devices/common/diy/package/system/opkg/patches/zh-cn.patch

@@ -1,59 +0,0 @@
----  a/libopkg/opkg_download.c
-+++  b/libopkg/opkg_download.c
-@@ -174,9 +174,9 @@
- 		if (res) {
- 			opkg_msg(ERROR,
--				 "Failed to download %s, wget returned %d.\n",
-+				 "下载失败 %s, wget returned %d.\n",
- 				 src, res);
- 			if (res == 4)
- 				opkg_msg(ERROR,
--					 "Check your network settings and connectivity.\n\n");
-+					 "请检查网络设置, 确保本设备网络可用.\n\n");
- 			free(tmp_file_location);
- 			return -1;
-
----  a/libopkg/opkg.c
-+++  b/libopkg/opkg.c
-@@ -225,5 +225,5 @@
- 	new = pkg_hash_fetch_best_installation_candidate_by_name(package_name);
- 	if (!new) {
--		opkg_msg(ERROR, "Couldn't find package %s\n", package_name);
-+		opkg_msg(ERROR, "找不到软件包 %s\n", package_name);
- 		return -1;
- 	}
-@@ -242,5 +242,5 @@
- 	if (unresolved) {
- 		char **tmp = unresolved;
--		opkg_msg(ERROR, "Couldn't satisfy the following dependencies"
-+		opkg_msg(ERROR, "无法满足以下依赖"
- 			 " for %s:\n", package_name);
- 		while (*tmp) {
-@@ -271,5 +271,5 @@
- 
- 		if (pkg->src == NULL) {
--			opkg_msg(ERROR, "Package %s not available from any "
-+			opkg_msg(ERROR, "在以下仓库未找到可用的 %s 软件包"
- 				 "configured src\n", package_name);
- 			return -1;
-
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -222,6 +222,6 @@
- 
- 	if (pkg_size_kbs >= kbs_available) {
--		opkg_msg(ERROR, "Only have %ldkb available on filesystem %s, "
--			 "pkg %s needs %ld\n",
-+		opkg_msg(ERROR, "剩余可用容量不足, 文件系统 %s 当前剩余 %ldkb 可用,"
-+			 "软件包 %s 需要 %ld\n",
- 			 kbs_available, root_dir, pkg->name, pkg_size_kbs);
- 		return -1;
-@@ -1319,6 +1319,6 @@
- 		}
- 		if (err) {
--			opkg_msg(ERROR, "Failed to download %s. "
--				 "Perhaps you need to run 'opkg update'?\n",
-+			opkg_msg(ERROR, "下载 %s 失败. "
-+				 "请更新列表后重试\n",
- 				 pkg->name);
- 			return -1;

+ 0 - 1
devices/common/files/lib/upgrade/keep.d/php7

@@ -1 +0,0 @@
-/etc/php7/custom.ini

+ 0 - 65
devices/common/patches/ARMV8CE_AES.patch

@@ -1,65 +0,0 @@
---- a/package/libs/mbedtls/Makefile
-+++ b/package/libs/mbedtls/Makefile
-@@ -23,6 +23,8 @@ PKG_CPE_ID:=cpe:/a:arm:mbed_tls
- 
- PKG_CONFIG_DEPENDS := \
- 	CONFIG_LIBMBEDTLS_DEBUG_C \
-+	CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES \
-+	CONFIG_LIBMBEDTLS_HAVE_SSE2 \
- 	CONFIG_LIBMBEDTLS_HKDF_C
- 
- include $(INCLUDE_DIR)/package.mk
-@@ -60,6 +62,34 @@ config LIBMBEDTLS_DEBUG_C
- 
- 	 Usually, you don't need this, so don't select this if you're unsure.
- 
-+config LIBMBEDTLS_HAVE_ARMV8CE_AES
-+	depends on PACKAGE_libmbedtls
-+	bool
-+	default y
-+	prompt "Enable use of the ARMv8 Crypto Extensions"
-+	depends on aarch64 && !TARGET_bcm27xx && !TARGET_bcm4908
-+	help
-+	 Use of the ARMv8 Crypto Extensions greatly increase performance
-+	 (up to 4x faster on AES-GCM while 10x faster on raw AES).
-+
-+	 Related instructions should be included in all modern Aarch64
-+	 devices, except some wastes like Broadcom.
-+	 If you don't sure, say Y here.
-+
-+config LIBMBEDTLS_HAVE_SSE2
-+	depends on PACKAGE_libmbedtls
-+	bool
-+	default y if !TARGET_x86_legacy && !TARGET_x86_geode
-+	prompt "Enable use of x86 SSE2 instructions"
-+	depends on x86_64 || i386
-+	help
-+	 Use of SSE2 instructions greatly increase performance (up to
-+	 3x faster) with a minimum (~0.2%, or 23KB) increase in package
-+	 size, but it will bring no benefit if your hardware does not
-+	 support them, such as Geode GX and LX.  In this case you may
-+	 save 23KB by saying yes here.  AMD Geode NX, and Intel
-+	 Pentium 4 and above support SSE2.
-+
- config LIBMBEDTLS_HKDF_C
- 	depends on PACKAGE_libmbedtls
- 	bool "Enable the HKDF algorithm (RFC 5869)"
-@@ -92,6 +122,9 @@ PKG_INSTALL:=1
- 
- TARGET_CFLAGS += -ffunction-sections -fdata-sections
- TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
-+ifneq ($(CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES),)
-+  TARGET_CFLAGS := $(filter-out -march=%,$(TARGET_CFLAGS)) -march=armv8-a+crypto
-+endif
- 
- CMAKE_OPTIONS += \
- 	-DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
-@@ -103,6 +136,8 @@ define Build/Configure
- 
- 	awk 'BEGIN { rc = 1 } \
- 	     /#define MBEDTLS_DEBUG_C/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_DEBUG_C),,// )#define MBEDTLS_DEBUG_C"; rc = 0 } \
-+	     /#define MBEDTLS_ARMV8CE_AES_C/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES),,// )#define MBEDTLS_ARMV8CE_AES_C"; rc = 0 } \
-+	     /#define MBEDTLS_HAVE_SSE2/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_HAVE_SSE2),,// )#define MBEDTLS_HAVE_SSE2"; rc = 0 } \
- 	     { print } \
- 	     END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \
- 	     >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \

+ 0 - 11
devices/common/patches/add_Fullcone-NAT_option.patch

@@ -1,11 +0,0 @@
---- a/package/feeds/luci/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
-+++ b/package/feeds/luci/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
-@@ -69,6 +69,8 @@ return view.extend({
- 			p[i].value('ACCEPT', _('accept'));
- 		}
- 
-+		o = s.option(form.Flag, 'fullcone', _('FullCone NAT'), _('Using FullCone NAT can improve gaming performance effectively'));
-+		
- 		/* Netfilter flow offload support */
- 
- 		if (L.hasSystemFeature('offloading')) {

+ 0 - 10
devices/common/patches/colored_shell.patch

@@ -1,10 +0,0 @@
---- a/package/base-files/files/etc/shinit
-+++ b/package/base-files/files/etc/shinit
-@@ -2,6 +2,8 @@
- [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
- 
- alias ll='ls -alF --color=auto'
-+alias reboot='(/bin/busybox reboot &);sleep 3;/bin/busybox reboot -f'
-+PS1='\[\033[35;1m\]\u\[\033[0m\]@\[\033[31;1m\]\h \[\e[36m\]\@\[\e[m\] \[\033[32;1m\]\W\[\033[0m\]\[\033[31m\]\$\[\033[0m\] '
- 
- [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc

+ 0 - 9
devices/common/patches/disable_network_rollback.patch

@@ -1,9 +0,0 @@
---- a/package/feeds/luci/luci-base/htdocs/luci-static/resources/network.js
-+++ b/package/feeds/luci/luci-base/htdocs/luci-static/resources/network.js
-@@ -4376,4 +4376,6 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
- 	}
- });
- 
-+setTimeout("document.getElementsByClassName('cbi-button-apply')[0].children[3].children[0].value='1'",1000)
-+
- return Network;

+ 0 - 43
devices/common/patches/dispatcher.patch

@@ -1,43 +0,0 @@
---- a/package/feeds/luci/luci-base/luasrc/dispatcher.lua
-+++ b/package/feeds/luci/luci-base/luasrc/dispatcher.lua
-@@ -461,5 +461,10 @@
- 	context.request = r
- 
--	local pathinfo = http.urldecode(request:getenv("PATH_INFO") or "", true)
-+	local pathinfo = ""
-+	if sys.call("test -s /tmp/resolv.conf.d/resolv.conf.auto") == 0 then
-+		pathinfo = http.urldecode(request:getenv("PATH_INFO") or "", true)	
-+	else
-+		pathinfo = http.urldecode(request:getenv("PATH_INFO") or "admin/system/initsetup", true)
-+	end
- 
- 	if prefix then
-@@ -894,6 +899,11 @@
- 			end
- 
--			http.header("Set-Cookie", 'sysauth=%s; path=%s; SameSite=Strict; HttpOnly%s' %{
--				sid, build_url(), http.getenv("HTTPS") == "on" and "; secure" or ""
-+			local cookie_p = uci:get("wizard", "default", "cookie_p")
-+			local timeout = 'Thu, 01 Jan 3000 01:00:00 GMT'
-+			if cookie_p == '0' then
-+				timeout = ''
-+			end
-+			http.header("Set-Cookie", 'sysauth=%s; expires=%s; path=%s; SameSite=Strict; HttpOnly%s' %{
-+				sid, timeout, build_url(), http.getenv("HTTPS") == "on" and "; secure" or ""
- 			})
- 
-@@ -917,6 +927,12 @@
- 		local perm = check_acl_depends(required_path_acls, ctx.authacl and ctx.authacl["access-group"])
- 		if perm == nil then
--			http.status(403, "Forbidden")
--			return
-+			local sid = context.authsession
-+			if sid then
-+				util.ubus("session", "destroy", { ubus_rpc_session = sid })
-+				luci.http.header("Set-Cookie", "sysauth=%s; expires=%s; path=%s" %{
-+					'', 'Thu, 01 Jan 1970 01:00:00 GMT', build_url()
-+				})
-+			end
-+			luci.http.redirect(build_url())
- 		end
- 

+ 0 - 13
devices/common/patches/dns_redirect.patch

@@ -1,13 +0,0 @@
---- a/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-+++ b/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-@@ -164,6 +164,10 @@ return view.extend({
- 		s.tab('advanced', _('Advanced Settings'));
- 		s.tab('leases', _('Static Leases'));
- 
-+		s.taboption('general', form.Flag, 'dns_redirect',
-+			_('DNS Redirect'),
-+			_('Redirect client DNS to dnsmasq'));
-+
- 		s.taboption('general', form.Flag, 'domainneeded',
- 			_('Domain required'),
- 			_('Don\'t forward <abbr title="Domain Name System">DNS</abbr>-Requests without <abbr title="Domain Name System">DNS</abbr>-Name'));

+ 0 - 29
devices/common/patches/hijack-domain.patch

@@ -1,29 +0,0 @@
---- a/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-+++ b/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-@@ -163,6 +163,26 @@ return view.extend({
- 		s.tab('tftp', _('TFTP Settings'));
- 		s.tab('advanced', _('Advanced Settings'));
- 		s.tab('leases', _('Static Leases'));
-+		s.tab('custom_domain', _('Custom Redirect Domain'));
-+
-+		o = s.taboption('custom_domain', form.SectionValue, 'domain', form.GridSection, 'domain', null,
-+			_('Define a custom domain name and the corresponding PTR record'));
-+
-+		ss = o.subsection;
-+
-+		ss.addremove = true;
-+		ss.anonymous = true;
-+
-+		so = ss.option(form.Value, 'name', _('Domain Name'));
-+		so.datatype = 'hostname';
-+		so.rmempty  = true;
-+
-+		so = ss.option(form.Value, 'ip', _('<abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Address'));
-+		so.datatype = 'or(ip4addr,"ignore")';
-+		so.rmempty  = true;
-+
-+		so = ss.option(form.Value, 'comments', _('Comments'));
-+		so.rmempty  = true;
- 
- 		s.taboption('general', form.Flag, 'domainneeded',
- 			_('Domain required'),

+ 0 - 26
devices/common/patches/luci-add-filter-aaaa-option.patch

@@ -1,26 +0,0 @@
-From d5714003b9ba288b45e6866472315a99230292f5 Mon Sep 17 00:00:00 2001
-From: Chuck <[email protected]>
-Date: Wed, 3 Jun 2020 16:37:41 +0800
-Subject: [PATCH] dnsmasq: add filter-aaaa option
-
-Signed-off-by: Chuck <[email protected]>
----
- .../feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js        | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-index 6693dc0eac..1c8f943758 100644
---- a/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-+++ b/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-@@ -199,6 +199,11 @@ return view.extend({
- 		s.taboption('files', form.DynamicList, 'addnhosts',
- 			_('Additional Hosts files')).optional = true;
- 
-+		o = s.taboption('advanced', form.Flag, 'filter_aaaa',
-+			_('Disable IPv6 DNS forwards'),
-+			_('Filter IPv6(AAAA) DNS Query Name Resolve'));
-+		o.optional = true;
-+
- 		o = s.taboption('advanced', form.Flag, 'quietdhcp',
- 			_('Suppress logging'),
- 			_('Suppress logging of the routine operation of these protocols'));

+ 0 - 16
devices/common/patches/min-ttl.patch

@@ -1,16 +0,0 @@
---- a/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-+++ b/feeds/luci/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
-@@ -364,6 +364,13 @@ return view.extend({
- 		o.datatype = 'range(0,10000)';
- 		o.placeholder = 150;
- 
-+		o = s.taboption('advanced', form.Value, 'mini_ttl',
-+			_('Minimum TTL to send to clients'),
-+			_('Modify DNS entries minimum TTL (max is 86400, 0 is no modify)'));
-+		o.optional = true;
-+		o.datatype = 'range(0,86400)';
-+		o.placeholder = 0;
-+
- 		s.taboption('tftp', form.Flag, 'enable_tftp',
- 			_('Enable TFTP server')).optional = true;
- 

+ 0 - 57
devices/common/patches/nginx_luci.patch

@@ -1,57 +0,0 @@
---- a/package/feeds/packages/nginx/files-luci-support/luci.locations
-+++ b/package/feeds/packages/nginx/files-luci-support/luci.locations
-@@ -1,12 +1,14 @@
--location /cgi-bin/luci {
-+location /luci {
- 		index  index.html;
- 		include uwsgi_params;
-+		uwsgi_read_timeout 300s;
- 		uwsgi_param SERVER_ADDR $server_addr;
- 		uwsgi_modifier1 9;
- 		uwsgi_pass unix:////var/run/luci-webui.socket;
- }
--location ~ /cgi-bin/cgi-(backup|download|upload|exec) {
-+location ~ /cgi-(backup|download|upload|exec) {
- 		include uwsgi_params;
-+		uwsgi_read_timeout 300s;
- 		uwsgi_param SERVER_ADDR $server_addr;
- 		uwsgi_modifier1 9;
- 		uwsgi_pass unix:////var/run/luci-cgi_io.socket;
-
---- a/package/network/services/dnsmasq/files/dnsmasq.init
-+++ b/package/network/services/dnsmasq/files/dnsmasq.init
-@@ -403,6 +403,20 @@ dhcp_this_host_add() {
- 	local routerstub routername ifdashname
- 	local lanaddr lanaddr6 lanaddrs6 ulaprefix
- 
-+network_get_ipaddr lanaddr "lan"
-+if [ -n $lanaddr ]; then
-+	echo "
-+$lanaddr op" >/tmp/hosts/shortcuts
-+if [ -f /etc/nginx/conf.d/shortcuts.conf ]; then
-+if [[ "$lanaddr" != "`grep "set \$ip" /etc/nginx/conf.d/shortcuts.conf | head -n1 | cut -f 3 -d " " | sed -e 's/;//'`" ]]; then
-+	sed -i "/set \$ip/c\set \$ip $lanaddr;" /etc/nginx/conf.d/shortcuts.conf
-+	/etc/init.d/nginx reload
-+fi
-+cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*set \$ip [0-9.]*;' | sed -e 's/server_name \(.*\);.*location.*set $ip \(.*\);/\2 \1/' >>/tmp/hosts/shortcuts
-+cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*return 301 \$scheme://op' | sed -e 's/server_name \(.*\?\);.*/\1/' | sed -e "s/^/$lanaddr /">>/tmp/hosts/shortcuts
-+fi
-+fi
-+
- 	if [ "$mode" -gt 0 ] ; then
- 		ifdashname="${ifname//./-}"
- 		routerstub="$( md5sum /etc/os-release )"
-
---- a/package/feeds/packages/nginx/files/nginx.init
-+++ b/package/feeds/packages/nginx/files/nginx.init
-@@ -23,6 +23,10 @@ nginx_init() {
- 	rm -f "$(readlink "${UCI_CONF}")"
- 	${NGINX_UTIL} init_lan
- 
-+	if [ ! -h "${UCI_CONF}" ]
-+	then ln -sf /var/lib/nginx/uci.conf ${UCI_CONF}
-+	fi
-+
- 	if [ -e "${UCI_CONF}" ]
- 	then CONF="${UCI_CONF}"
- 	else CONF="${NGINX_CONF}"

+ 0 - 222
devices/common/patches/opkginstall.patch

@@ -1,222 +0,0 @@
---- a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
-+++ b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
-@@ -232,7 +232,7 @@ function display(pattern)
- 			var avail = packages.available.pkgs[name],
- 			    inst  = packages.installed.pkgs[name];
- 
--			if (!inst || !inst.installed)
-+			if (!inst || !inst.installed || pkg.name.includes('opkg') || pkg.name.includes('kmod-') || pkg.name.includes('luci-lib-fs') || pkg.name.includes('base-files') || pkg.name.includes('luci-base') || pkg.name.includes('busybox') || pkg.name.includes('nginx-') || pkg.name == "nginx" || pkg.name.includes('dnsmasq-full') || pkg.name.includes('firewall') || pkg.name.includes('miniupnpd') || pkg.name.includes('coremark') || pkg.name.includes('luci-mod-network') || pkg.name.includes('luci-mod-status') || pkg.name.includes('luci-mod-system'))
- 				continue;
- 
- 			if (!avail || compareVersion(avail.version, pkg.version) <= 0)
-@@ -245,6 +245,7 @@ function display(pattern)
- 			btn = E('div', {
- 				'class': 'btn cbi-button-positive',
- 				'data-package': name,
-+				'action': 'upgrade',
- 				'click': handleInstall
- 			}, _('Upgrade…'));
- 		}
-@@ -260,6 +261,9 @@ function display(pattern)
- 			}, _('Remove…'));
- 		}
- 		else {
-+			if (pkg.name.includes('luci-i18n'))
-+			   continue;
-+
- 			var inst = packages.installed.pkgs[name];
- 
- 			ver = truncateVersion(pkg.version || '-');
-@@ -268,12 +272,14 @@ function display(pattern)
- 				btn = E('div', {
- 					'class': 'btn cbi-button-action',
- 					'data-package': name,
-+					'action': 'install',
- 					'click': handleInstall
- 				}, _('Install…'));
--			else if (inst.installed && inst.version != pkg.version)
-+			else if (inst.installed && compareVersion(pkg.version, inst.version) > 0)
- 				btn = E('div', {
- 					'class': 'btn cbi-button-positive',
- 					'data-package': name,
-+					'action': 'upgrade',
- 					'click': handleInstall
- 				}, _('Upgrade…'));
- 			else
-@@ -370,6 +376,12 @@ function handleMode(ev)
- 
- 	currentDisplayMode = tab.getAttribute('data-mode');
- 
-+	if (currentDisplayMode == "updates"){
-+	var filterv = document.querySelector('input[name="filter"]')
-+	if ( filterv.value == "luci-app-")
-+		filterv.value = ""
-+	}
-+
- 	display(document.querySelector('input[name="filter"]').value);
- 
- 	ev.target.blur();
-@@ -631,6 +643,7 @@ function handleReset(ev)
- function handleInstall(ev)
- {
- 	var name = ev.target.getAttribute('data-package'),
-+		action = ev.target.getAttribute('action'),
- 	    pkg = packages.available.pkgs[name],
- 	    depcache = {},
- 	    size;
-@@ -687,7 +700,7 @@ function handleInstall(ev)
- 		errs || inst || '',
- 		E('div', { 'class': 'right' }, [
- 			E('label', { 'class': 'cbi-checkbox', 'style': 'float:left' }, [
--				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'disabled': isReadonlyView }), ' ',
-+				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'checked': 'checked', 'disabled': isReadonlyView }), ' ',
- 				E('label', { 'for': 'overwrite-cb' }), ' ',
- 				_('Overwrite files from other package(s)')
- 			]),
-@@ -697,7 +710,7 @@ function handleInstall(ev)
- 			}, _('Cancel')),
- 			' ',
- 			E('div', {
--				'data-command': 'install',
-+				'data-command': action,
- 				'data-package': name,
- 				'class': 'btn cbi-button-action',
- 				'click': handleOpkg,
-@@ -881,6 +894,10 @@ function handleOpkg(ev)
- 		]);
- 
- 		var argv = [ cmd, '--force-removal-of-dependent-packages' ];
-+		
-+		argv.push('--force-checksum');
-+		
-+		argv.push('--force-depends');
- 
- 		if (rem && rem.checked)
- 			argv.push('--autoremove');
-@@ -1027,7 +1044,7 @@ return view.extend({
- 				E('div', {}, [
- 					E('label', {}, _('Filter') + ':'),
- 					E('span', { 'class': 'control-group' }, [
--						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'keyup': handleKeyUp }),
-+						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': 'luci-app-', 'keyup': handleKeyUp }),
- 						E('button', { 'class': 'btn cbi-button', 'click': handleReset }, [ _('Clear') ])
- 					])
- 				]),
-@@ -1056,14 +1073,6 @@ return view.extend({
- 				E('li', { 'data-mode': 'updates', 'class': 'installed cbi-tab-disabled', 'click': handleMode }, E('a', { 'href': '#' }, [ _('Updates') ]))
- 			]),
- 
--			E('div', { 'class': 'controls', 'style': 'display:none' }, [
--				E('div', { 'id': 'pager', 'class': 'center' }, [
--					E('button', { 'class': 'btn cbi-button-neutral prev', 'aria-label': _('Previous page'), 'click': handlePage }, [ '«' ]),
--					E('div', { 'class': 'text' }, [ 'dummy' ]),
--					E('button', { 'class': 'btn cbi-button-neutral next', 'aria-label': _('Next page'), 'click': handlePage }, [ '»' ])
--				])
--			]),
--
- 			E('table', { 'id': 'packages', 'class': 'table' }, [
- 				E('tr', { 'class': 'tr cbi-section-table-titles' }, [
- 					E('th', { 'class': 'th col-2 left' }, [ _('Package name') ]),
-@@ -1072,6 +1081,14 @@ return view.extend({
- 					E('th', { 'class': 'th col-10 left' }, [ _('Description') ]),
- 					E('th', { 'class': 'th right cbi-section-actions' }, [ '\u00a0' ])
- 				])
-+			]),
-+			
-+			E('div', { 'class': 'controls', 'style': 'display:none' }, [
-+				E('div', { 'id': 'pager', 'class': 'center' }, [
-+					E('button', { 'class': 'btn cbi-button-neutral prev', 'aria-label': _('Previous page'), 'click': handlePage }, [ '«' ]),
-+					E('div', { 'class': 'text' }, [ 'dummy' ]),
-+					E('button', { 'class': 'btn cbi-button-neutral next', 'aria-label': _('Next page'), 'click': handlePage }, [ '»' ])
-+				])
- 			])
- 		]);
- 
-
---- a/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
-+++ b/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
-@@ -13,13 +13,13 @@ case "$action" in
- 		lists_dir=$(sed -rne 's#^lists_dir \S+ (\S+)#\1#p' /etc/opkg.conf /etc/opkg/*.conf 2>/dev/null | tail -n 1)
- 		find "${lists_dir:-/usr/lib/opkg/lists}" -type f '!' -name '*.sig' | xargs -r gzip -cd
- 	;;
--	install|update|remove)
-+	install|update|upgrade|remove)
- 		(
- 			opkg="opkg"
- 
- 			while [ -n "$1" ]; do
- 				case "$1" in
--					--autoremove|--force-overwrite|--force-removal-of-dependent-packages)
-+					--autoremove|--force-overwrite|--force-removal-of-dependent-packages|--force-checksum|--force-depends)
- 						opkg="$opkg $1"
- 						shift
- 					;;
-@@ -35,8 +35,32 @@ case "$action" in
- 			if flock -x 200; then
- 				$opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
- 				code=$?
--				stdout=$(cat /tmp/opkg.out)
-+				if [[ $@ == luci-app-* && "$(opkg list | grep luci-i18n-"$(echo $@ | cut -d - -f 3-)"-zh-cn)" ]]; then
-+					$opkg $action luci-i18n-"$(echo $@ | cut -d - -f 3-)"-zh-cn </dev/null >>/tmp/opkg.out 2>/dev/null
-+				fi
-+				case "$action" in
-+					install|upgrade)
-+						[ "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" ] && {
-+							rm -f /tmp/opkg.err
-+						}
-+					;;
-+					remove)
-+						. /etc/profile.d/opkg.sh; opkg save
-+						[ ! "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" ] && {
-+							rm -f /tmp/opkg.err
-+						}
-+					;;
-+				esac
-+				grep -q "wget returned 8" /tmp/opkg.err && {
-+						opkg update </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
-+						$opkg $action "$@" </dev/null >>/tmp/opkg.out 2>>/tmp/opkg.err
-+					}
- 				stderr=$(cat /tmp/opkg.err)
-+				[ -n "$stderr" ] || {
-+					echo "🎉 已完成, 请关闭本窗口~" >>/tmp/opkg.out
-+					code=0
-+				}
-+				stdout=$(cat /tmp/opkg.out)
- 			else
- 				code=255
- 				stderr="Failed to acquire lock"
-
---- a/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
-+++ b/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
-@@ -20,6 +20,7 @@
- 				"/usr/libexec/opkg-call install *": [ "exec" ],
- 				"/usr/libexec/opkg-call remove *": [ "exec" ],
- 				"/usr/libexec/opkg-call update *": [ "exec" ],
-+				"/usr/libexec/opkg-call upgrade *": [ "exec" ],
- 				"/etc/opkg.conf": [ "write" ],
- 				"/etc/opkg/*.conf": [ "write" ],
- 				"/tmp/upload.ipk": [ "write" ]
-
---- a/package/base-files/files/sbin/sysupgrade
-+++ b/package/base-files/files/sbin/sysupgrade
-@@ -232,6 +232,7 @@ do_save_conffiles() {
- 
- 	if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
- 		echo "${INSTALLED_PACKAGES}" >> "$CONFFILES"
-+		. /etc/profile.d/opkg.sh; opkg save
- 		mkdir -p "$ETCBACKUP_DIR"
- 		# Avoid touching filesystem on each backup
- 		RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)"
- 
- 	v "Saving config files..."
-
---- a/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
-+++ b/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
-@@ -261,6 +261,7 @@ return view.extend({
- 					body.push(E('p', {}, E('label', { 'class': 'btn' }, [
- 						opts.backup_pkgs[0], ' ', _('Include in backup a list of current installed packages at /etc/backup/installed_packages.txt')
- 					])));
-+					opts.backup_pkgs[0].checked = true;
- 				};
- 
- 				var cntbtn = E('button', {

+ 0 - 38
devices/common/patches/package.patch

@@ -12,41 +12,3 @@
 +endef
 +endif
 +
-
---- a/package/base-files/files/lib/functions.sh
-+++ b/package/base-files/files/lib/functions.sh
-@@ -283,7 +283,9 @@ default_postinst() {
- 			if [ "$PKG_UPGRADE" != "1" ]; then
- 				"$i" enable
- 			fi
--			"$i" start
-+			if "$i" enabled; then
-+				"$i" start
-+			fi
- 		fi
- 	done
- 
-
---- a/package/feeds/luci/luci-base/root/etc/init.d/ucitrack
-+++ b/package/feeds/luci/luci-base/root/etc/init.d/ucitrack
-@@ -8,7 +8,7 @@ register_init() {
- 	local init="$2"
- 	shift; shift
- 
--	if [ -x "$init" ] && "$init" enabled && ! grep -sqE 'USE_PROCD=.' "$init"; then
-+	if [ -x "$init" ] && ! grep -sqE 'USE_PROCD=.' "$init"; then
- 		logger -t "ucitrack" "Setting up /etc/config/$config reload trigger for non-procd $init"
- 		procd_add_config_trigger "config.change" "$config" "$init" "$@"
- 	fi
-
---- a/package/feeds/luci/luci-base/root/sbin/luci-reload
-+++ b/package/feeds/luci/luci-base/root/sbin/luci-reload
-@@ -26,7 +26,7 @@ reload_exec() {
- }
- 
- reload_init() {
--	[ -x /etc/init.d/$2 ] && /etc/init.d/$2 enabled && {
-+	[ -x /etc/init.d/$2 ] && {
- 		echo "Reloading $1... "
- 		/etc/init.d/$2 reload >/dev/null 2>&1
- 		[ -n "$3" -a "$?" != "$3" ] && echo '!!! Failed to reload' $1 '!!!'

+ 0 - 11
devices/common/patches/profile.patch

@@ -1,11 +0,0 @@
---- a/package/base-files/files/etc/profile
-+++ b/package/base-files/files/etc/profile
-@@ -22,7 +23,7 @@ esac
- 
- [ -n "$FAILSAFE" ] || {
- 	for FILE in /etc/profile.d/*.sh; do
--		[ -e "$FILE" ] && . "$FILE"
-+		[ -e "$FILE" ] && [ "$FILE" == "/etc/profile.d/sysinfo.sh" ] && env -i bash "$FILE" || . "$FILE"
- 	done
- 	unset FILE
- }

+ 0 - 165
devices/common/patches/status.patch

@@ -1,165 +0,0 @@
---- a/package/feeds/luci/luci-base/root/usr/libexec/rpcd/luci
-+++ b/package/feeds/luci/luci-base/root/usr/libexec/rpcd/luci
-@@ -45,2 +45,29 @@
- 
-+    getCPUInfo = {
-+        call = function()
-+            local sys = require "luci.sys"
-+            local rv = {}
-+            rv.cpufreq      = sys.exec("/sbin/cpuinfo")
-+            rv.cpufree      = (sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "2.33") .. "%"
-+            rv.cpumark      = sys.exec("cat /etc/bench.log")
-+            return rv
-+        end
-+    },
-+
-+	getEthInfo = {
-+		call = function()
-+			local sys = require "luci.sys"
-+			local result = sys.exec("ethinfo 2>/dev/null")
-+			return { result = result }
-+		end
-+	},
-+
-+	getUserInfo = {
-+		call = function()
-+			local sys = require "luci.sys"
-+			local result = sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l")
-+			return { result = result }
-+		end
-+	},
-+
- 	setLocaltime = {
-
---- a/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
-+++ b/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
-@@ -3,7 +3,7 @@
- 		"description": "Grant access to system configuration",
- 		"read": {
- 			"ubus": {
--				"luci": [ "getInitList", "getLEDs", "getTimezones", "getUSBDevices" ],
-+				"luci": [ "getInitList", "getLEDs", "getTimezones", "getUSBDevices", "getCPUInfo", "getEthInfo", "getUserInfo" ],
- 				"system": [ "info" ]
- 			},
- 			"uci": [ "luci", "system" ]
-
---- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
-+++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
-@@ -15,17 +15,24 @@
- 
-+var callCPUInfo = rpc.declare({
-+    object: 'luci',
-+    method: 'getCPUInfo'
-+});
-+
- return baseclass.extend({
- 	title: _('System'),
- 
- 	load: function() {
- 		return Promise.all([
- 			L.resolveDefault(callSystemBoard(), {}),
- 			L.resolveDefault(callSystemInfo(), {}),
-+			L.resolveDefault(callCPUInfo(), {}),
- 			fs.lines('/usr/lib/lua/luci/version.lua')
- 		]);
- 	},
- 
- 	render: function(data) {
- 		var boardinfo   = data[0],
- 		    systeminfo  = data[1],
--		    luciversion = data[2];
-+		    cpuinfo     = data[2],
-+		    luciversion = data[3];
- 
-@@ -54,9 +56,10 @@
- 			_('Hostname'),         boardinfo.hostname,
--			_('Model'),            boardinfo.model,
-+			_('Model'),            boardinfo.model + ' ' + cpuinfo.cpumark,
- 			_('Architecture'),     boardinfo.system,
- 			_('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''),
- 			_('Kernel Version'),   boardinfo.kernel,
- 			_('Local Time'),       datestr,
- 			_('Uptime'),           systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null,
--			_('Load Average'),     Array.isArray(systeminfo.load) ? '%.2f, %.2f, %.2f'.format(
-+			_('CPU Info'),         cpuinfo.cpufreq,
-+			_('Load Average'),     Array.isArray(systeminfo.load) ? '%.2f, %.2f, %.2f'.format(
- 				systeminfo.load[0] / 65535.0,
-
---- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js
-+++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js
-@@ -2,6 +2,7 @@
- 'require baseclass';
- 'require fs';
- 'require network';
-+'require rpc';
- 
- function progressbar(value, max, byte) {
- 	var vn = parseInt(value) || 0,
-@@ -59,6 +60,11 @@ function renderbox(ifc, ipv6) {
- 	]);
- }
- 
-+var callUserInfo = rpc.declare({
-+    object: 'luci',
-+    method: 'getUserInfo'
-+});
-+
- return baseclass.extend({
- 	title: _('Network'),
- 
-@@ -67,7 +73,8 @@ return baseclass.extend({
- 			fs.trimmed('/proc/sys/net/netfilter/nf_conntrack_count'),
- 			fs.trimmed('/proc/sys/net/netfilter/nf_conntrack_max'),
- 			network.getWANNetworks(),
--			network.getWAN6Networks()
-+			network.getWAN6Networks(),
-+			L.resolveDefault(callUserInfo(), {})
- 		]);
- 	},
- 
-@@ -75,7 +82,8 @@ return baseclass.extend({
- 		var ct_count  = +data[0],
- 		    ct_max    = +data[1],
- 		    wan_nets  = data[2],
--		    wan6_nets = data[3];
-+		    wan6_nets = data[3],
-+		    userinfo = data[4];
- 
- 		var fields = [
- 			_('Active Connections'), ct_max ? ct_count : null
-@@ -90,6 +98,10 @@ return baseclass.extend({
- 					(fields[i + 1] != null) ? progressbar(fields[i + 1], ct_max) : '?'
- 				])
- 			]));
-+			ctstatus.appendChild(E('div', { 'class': 'tr' }, [
-+				E('div', { 'class': 'td left' }, _('Online Users')),
-+				E('div', { 'class': 'td left' },  userinfo.result)
-+			]));
- 		}
- 
- 		var netstatus = E('div', { 'class': 'network-status-table' });
-
---- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
-+++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
-@@ -32,8 +32,7 @@ return baseclass.extend({
- 		    swap = L.isObject(systeminfo.swap) ? systeminfo.swap : {};
- 
- 		var fields = [
--			_('Total Available'), (mem.available) ? mem.available : (mem.total && mem.free && mem.buffered) ? mem.free + mem.buffered : null, mem.total,
--			_('Used'),            (mem.total && mem.free) ? (mem.total - mem.free) : null, mem.total,
-+			_('Used'),            (mem.total && mem.available) ? (mem.total - mem.available) : null, mem.total,
- 		];
- 
- 		if (mem.buffered)
-@@ -43,9 +42,9 @@ return baseclass.extend({
- 			fields.push(_('Cached'), mem.cached, mem.total);
- 
- 		if (swap.total > 0)
--			fields.push(_('Swap free'), swap.free, swap.total);
-+			fields.push(_('Swap used'), swap.total - swap.free, swap.total);
- 
--		var table = E('table', { 'class': 'table' });
-+		var table = E('table', { 'class': 'table memory' });
- 
- 		for (var i = 0; i < fields.length; i += 3) {
- 			table.appendChild(E('tr', { 'class': 'tr' }, [

+ 0 - 60
devices/common/patches/turboacc.patch

@@ -1,60 +0,0 @@
---- a/package/feeds/kiddin9/luci-app-turboacc/Makefile
-+++ b/package/feeds/kiddin9/luci-app-turboacc/Makefile
-@@ -20,8 +20,7 @@ PKG_CONFIG_DEPENDS:= \
- 	
- LUCI_TITLE:=LuCI support for Flow Offload / Shortcut-FE
- LUCI_PKGARCH:=all
--LUCI_DEPENDS:=+pdnsd-alt \
--	+PACKAGE_$(PKG_NAME)_INCLUDE_BBR_CCA:kmod-tcp-bbr \
-+LUCI_DEPENDS:=+PACKAGE_$(PKG_NAME)_INCLUDE_BBR_CCA:kmod-tcp-bbr \
- 	+PACKAGE_$(PKG_NAME)_INCLUDE_DNSFORWARDER:dnsforwarder \
- 	+PACKAGE_$(PKG_NAME)_INCLUDE_DNSPROXY:dnsproxy \
- 	+PACKAGE_$(PKG_NAME)_INCLUDE_OFFLOADING:kmod-ipt-offload \
-@@ -31,7 +30,6 @@ LUCI_DEPENDS:=+pdnsd-alt \
- define Package/$(PKG_NAME)/config
- config PACKAGE_$(PKG_NAME)_INCLUDE_OFFLOADING
- 	bool "Include Flow Offload"
--	depends on (PACKAGE_$(PKG_NAME)_INCLUDE_SHORTCUT_FE=n && PACKAGE_$(PKG_NAME)_INCLUDE_SHORTCUT_FE_DRV=n)
- 	default y if i386||x86_64||TARGET_ramips
- 
- config PACKAGE_$(PKG_NAME)_INCLUDE_SHORTCUT_FE_DRV
-
---- a/package/feeds/kiddin9/luci-app-turboacc/luasrc/model/cbi/turboacc.lua
-+++ b/package/feeds/kiddin9/luci-app-turboacc/luasrc/model/cbi/turboacc.lua
-@@ -55,25 +55,4 @@ fullcone_nat.default = 0
- fullcone_nat.description = translate("Using FullCone NAT can improve gaming performance effectively")
- end 
- 
--dns_caching = s:option(Flag, "dns_caching", translate("DNS Caching"))
--dns_caching.default = 0
--dns_caching.rmempty = false
--dns_caching.description = translate("Enable DNS Caching and anti ISP DNS pollution")
--
--dns_caching_mode = s:option(ListValue, "dns_caching_mode", translate("Resolve DNS Mode"), translate("DNS Program"))
--dns_caching_mode:value("1", translate("Using PDNSD to query and cache"))
--if nixio.fs.access("/usr/bin/dnsforwarder") then
--dns_caching_mode:value("2", translate("Using DNSForwarder to query and cache"))
--end
--if nixio.fs.access("/usr/bin/dnsproxy") then
--dns_caching_mode:value("3", translate("Using DNSProxy to query and cache"))
--end
--dns_caching_mode.default = 1
--dns_caching_mode:depends("dns_caching", 1)
--
--dns_caching_dns = s:option(Value, "dns_caching_dns", translate("Upsteam DNS Server"))
--dns_caching_dns.default = "114.114.114.114,114.114.115.115,223.5.5.5,223.6.6.6,180.76.76.76,119.29.29.29,119.28.28.28,1.2.4.8,210.2.4.8"
--dns_caching_dns.description = translate("Muitiple DNS server can saperate with ','")
--dns_caching_dns:depends("dns_caching", 1)
--
- return m
-
---- a/package/feeds/kiddin9/luci-app-turboacc/luasrc/view/turboacc/turboacc_status.htm
-+++ b/package/feeds/kiddin9/luci-app-turboacc/luasrc/view/turboacc/turboacc_status.htm
-@@ -4,7 +4,6 @@
- 		<tr><td width="33%"><%:Flow Offloading%></td><td id="_fastpath_state"><em><%:Collecting data...%></em></td></tr>
- 		<tr><td width="33%"><%:FullCone NAT%></td><td id="_fullconenat_state"><em><%:Collecting data...%></em></td></tr>
- 		<tr><td width="33%"><%:BBR CCA%></td><td id="_bbr_state"><em><%:Collecting data...%></em></td></tr>
--		<tr><td width="33%"><%:DNS Caching%></td><td id="_dnscaching_state"><em><%:Collecting data...%></em></td></tr>
- 	</table>
- </fieldset>
- 

+ 0 - 93
devices/common/patches/wireless.patch

@@ -1,93 +0,0 @@
---- a/package/feeds/luci/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
-+++ b/package/feeds/luci/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
-@@ -885,6 +885,10 @@ return view.extend({
- 				if (hwtype == 'mac80211') {
- 					o = ss.taboption('general', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates'), _('Legacy or badly behaving devices may require legacy 802.11b rates to interoperate. Airtime efficiency may be significantly reduced where these are used. It is recommended to not allow 802.11b rates where possible.'));
- 
-+					o = ss.taboption("advanced", form.Flag, 'mu_beamformer', _('MU-MIMO'));
-+					o.rmempty = false;
-+					o.default = '0';
-+
- 					o = ss.taboption('general', CBIWifiTxPowerValue, 'txpower', _('Maximum transmit power'), _('Specifies the maximum transmit power the wireless radio may use. Depending on regulatory requirements and wireless usage, the actual transmit power may be reduced by the driver.'));
- 					o.wifiNetwork = radioNet;
- 
-@@ -916,6 +920,9 @@ return view.extend({
- 					o.datatype = 'range(15,65535)';
- 					o.placeholder = 100;
- 					o.rmempty = true;
-+
-+					o = ss.taboption('advanced', form.Flag, 'vendor_vht', _('Enable 256-QAM'), _('802.11n 2.4Ghz Only'));
-+					o.default = o.disabled;
- 				}
- 
- 
-@@ -1001,6 +1008,68 @@ return view.extend({
- 				};
- 
- 				if (hwtype == 'mac80211') {
-+					// Probe 802.11k support
-+					o = ss.taboption('encryption', form.Flag, 'ieee80211k', _('802.11k'), _('Enables The 802.11k standard provides information to discover the best available access point'));
-+					o.depends({ mode : 'ap', encryption : 'wpa' });
-+					o.depends({ mode : 'ap', encryption : 'wpa2' });
-+					o.depends({ mode : 'ap-wds', encryption : 'wpa' });
-+					o.depends({ mode : 'ap-wds', encryption : 'wpa2' });
-+					o.depends({ mode : 'ap', encryption : 'psk' });
-+					o.depends({ mode : 'ap', encryption : 'psk2' });
-+					o.depends({ mode : 'ap', encryption : 'psk-mixed' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk2' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk-mixed' });
-+					o.rmempty = true;
-+
-+					o = ss.taboption('encryption', form.Flag, 'rrm_neighbor_report', _('Enable neighbor report via radio measurements'));
-+					o.default = o.enabled;
-+					o.depends({ ieee80211k : '1' });
-+					o.rmempty = true;
-+
-+					o = ss.taboption('encryption', form.Flag, 'rrm_beacon_report', _('Enable beacon report via radio measurements'));
-+					o.default = o.enabled;
-+					o.depends({ ieee80211k : '1' });
-+					o.rmempty = true;
-+					// End of 802.11k options
-+
-+					// Probe 802.11v support
-+					o = ss.taboption('encryption', form.Flag, 'ieee80211v', _('802.11v'), _('Enables 802.11v allows client devices to exchange information about the network topology,tating overall improvement of the wireless network.'));
-+					o.depends({ mode : 'ap', encryption : 'wpa' });
-+					o.depends({ mode : 'ap', encryption : 'wpa2' });
-+					o.depends({ mode : 'ap-wds', encryption : 'wpa' });
-+					o.depends({ mode : 'ap-wds', encryption : 'wpa2' });
-+					o.depends({ mode : 'ap', encryption : 'psk' });
-+					o.depends({ mode : 'ap', encryption : 'psk2' });
-+					o.depends({ mode : 'ap', encryption : 'psk-mixed' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk2' });
-+					o.depends({ mode : 'ap-wds', encryption : 'psk-mixed' });
-+					o.rmempty = true;
-+
-+
-+					o = ss.taboption('encryption', form.Flag, 'wnm_sleep_mode', _('extended sleep mode for stations'));
-+					o.default = o.disabled;
-+					o.depends({ ieee80211v : '1' });
-+					o.rmempty = true;
-+
-+					o = ss.taboption('encryption', form.Flag, 'bss_transition', _('BSS Transition Management'));
-+					o.default = o.disabled;
-+					o.depends({ ieee80211v : '1' });
-+					o.rmempty = true;
-+
-+					o = ss.taboption('encryption', form.ListValue, 'time_advertisement', _('Time advertisement'));
-+					o.depends({ ieee80211v : '1' });
-+					o.value('0', _('disabled'));
-+					o.value('2', _('UTC time at which the TSF timer is 0'));
-+					o.rmempty = true;
-+
-+					o = ss.taboption('encryption', form.Value, 'time_zone', _('time zone'), _('Local time zone as specified in 8.3 of IEEE Std 1003.1-2004'));
-+					o.depends({ time_advertisement : '2' });
-+					o.placeholder = 'UTC8';
-+					o.rmempty = true;
-+					// End of 802.11v options
-+
- 					var mode = ss.children[0],
- 					    bssid = ss.children[5],
- 					    encr;
-

+ 2 - 2
devices/nanopi-r2s/diy.sh

@@ -20,8 +20,8 @@ sed -i 's,-mcpu=generic,-march=armv8-a+crypto+crc -mabi=lp64,g' include/target.m
 
 sed -i '/;;/i\ethtool -K eth1 rx off tx off && logger -t disable-offloading "disabed rk3328 ethernet tcp/udp offloading tx/rx"' target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
 
-sed -i 's,kmod-usb-net-rtl8152$,kmod-usb-net-rtl8152-vendor,g' target/linux/rockchip/image/armv8.mk
-sed -i 's,kmod-r8169,kmod-r8168,g' target/linux/rockchip/image/armv8.mk
+sed -i -e 's,kmod-usb-net-rtl8152$,kmod-usb-net-rtl8152-vendor,g' \
+-e 's,kmod-r8169,kmod-r8168,g' target/linux/rockchip/image/armv8.mk
 
 echo '
 CONFIG_ARM64_CRYPTO=y