diff --git a/.github/workflows/IPQ60XX-24.10(NOWIFI).yml b/.github/workflows/IPQ60XX-24.10(NOWIFI).yml new file mode 100644 index 00000000..302e8307 --- /dev/null +++ b/.github/workflows/IPQ60XX-24.10(NOWIFI).yml @@ -0,0 +1,170 @@ +name: IPQ60XX-24.10(NOWIFI) + +on: + workflow_dispatch: + schedule: + - cron: 0 19 * * * + +env: + REPO_URL: https://github.com/LiBwrt-op/openwrt-6.x.git + REPO_BRANCH: openwrt-24.10 + CONFIG_FILE: configs/ipq60xx-nowifi.config + DIY_SCRIPT: diy-script.sh + CLASH_KERNEL: amd64 + CACHE_TOOLCHAIN: true + UPLOAD_BIN_DIR: false + FIRMWARE_RELEASE: true + FIRMWARE_TAG: IPQ60XX-24.10(NOWIFI) + TZ: Asia/Shanghai + +jobs: + Build: + runs-on: ubuntu-22.04 + + steps: + - name: Check Server Performance(检查服务器性能) + run: | + echo "警告⚠" + echo "分配的服务器性能有限,若选择的插件过多,务必注意CPU性能!" + echo -e "已知CPU型号(降序):7763,8370C,8272CL,8171M,E5-2673 \n" + echo "--------------------------CPU信息--------------------------" + echo "CPU物理数量:$(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)" + echo -e "CPU核心信息:$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n" + echo "--------------------------内存信息--------------------------" + echo "已安装内存详细信息:" + echo -e "$(sudo lshw -short -C memory | grep GiB) \n" + echo "--------------------------硬盘信息--------------------------" + echo "硬盘数量:$(ls /dev/sd* | grep -v [1-9] | wc -l)" && df -hT + + - name: Initialization Environment(初始化环境) + env: + DEBIAN_FRONTEND: noninteractive + run: | + docker rmi $(docker images -q) + sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android $AGENT_TOOLSDIRECTORY + sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true + sudo -E apt-get -y update + sudo -E apt-get -y install $(curl -fsSL is.gd/depends_ubuntu_2204) + sudo -E systemctl daemon-reload + sudo -E apt-get -y autoremove --purge + sudo -E apt-get -y clean + sudo timedatectl set-timezone "$TZ" + + - name: Combine Disks(合并磁盘) + uses: easimon/maximize-build-space@master + with: + swap-size-mb: 1024 + temp-reserve-mb: 100 + root-reserve-mb: 1024 + + - name: Checkout + uses: actions/checkout@main + + - name: Clone Source Code(克隆源代码) + run: | + df -hT $GITHUB_WORKSPACE + git clone --depth 1 -b $REPO_BRANCH $REPO_URL openwrt + cd openwrt + echo "OPENWRT_PATH=$PWD" >> $GITHUB_ENV + VERSION_INFO=$(git show -s --date=short --format="作者: %an<br/>时间: %cd<br/>内容: %s<br/>hash: %H") + echo "VERSION_INFO=$VERSION_INFO" >> $GITHUB_ENV + + - name: Generate Variables(生成变量) + run: | + cp $CONFIG_FILE $OPENWRT_PATH/.config + cd $OPENWRT_PATH + make defconfig > /dev/null 2>&1 + SOURCE_REPO="$(echo $REPO_URL | awk -F '/' '{print $(NF)}')" + echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV + DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') + echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV + DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') + echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV + + - name: Cache Toolchain(缓存工具链) + if: env.CACHE_TOOLCHAIN == 'true' + uses: HiGarfield/cachewrtbuild@main + with: + ccache: false + mixkey: ${{ env.SOURCE_REPO }}-${{ env.REPO_BRANCH }}-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} + prefix: ${{ env.OPENWRT_PATH }} + + - name: Install Feeds(安装feeds) + run: | + cd $OPENWRT_PATH + ./scripts/feeds update -a + ./scripts/feeds install -a + + - name: Load Custom Configuration(加载自定义配置) + run: | + [ -e files ] && mv files $OPENWRT_PATH/files + [ -e $CONFIG_FILE ] && mv $CONFIG_FILE $OPENWRT_PATH/.config + + - name: Download DL Package(下载DL软件包) + run: | + cd $OPENWRT_PATH + make defconfig + make download -j8 + find dl -size -1024c -exec ls -l {} \; + find dl -size -1024c -exec rm -f {} \; + + - name: Compile Firmware(开始编译固件) + id: compile + run: | + cd $OPENWRT_PATH + echo -e "$(nproc) thread compile" + make -j$(nproc) || make -j1 || make -j1 V=s + echo "status=success" >> $GITHUB_OUTPUT + echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV + echo "FILE_DATE=$(date +"%Y.%m.%d")" >> $GITHUB_ENV + + - name: Check Space Usage(检查空间使用情况) + if: (!cancelled()) + run: df -hT + + - name: Upload Bin Directory(上传固件) + if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' + uses: actions/upload-artifact@main + with: + name: ${{ env.SOURCE_REPO }}-bin-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }}-${{ env.FILE_DATE }} + path: ${{ env.OPENWRT_PATH }}/bin + + - name: Organize Files(整理文件) + if: steps.compile.outputs.status == 'success' + run: | + cd $OPENWRT_PATH/bin/targets/*/* + cat sha256sums + cp $OPENWRT_PATH/.config build.config + mv -f $OPENWRT_PATH/bin/packages/*/*/*.ipk packages + tar -zcf Packages.tar.gz packages + rm -rf packages feeds.buildinfo version.buildinfo + echo "FIRMWARE_PATH=$PWD" >> $GITHUB_ENV + + - name: Upload Firmware To Artifact(将固件上传到Artifact) + if: steps.compile.outputs.status == 'success' && env.FIRMWARE_RELEASE != 'true' + uses: actions/upload-artifact@main + with: + name: ${{ env.SOURCE_REPO }}-firmware-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }}-${{ env.FILE_DATE }} + path: ${{ env.FIRMWARE_PATH }} + + - name: Upload Firmware To Release(发布固件) + if: steps.compile.outputs.status == 'success' && env.FIRMWARE_RELEASE == 'true' + uses: ncipollo/release-action@v1 + with: + name: R${{ env.DATE }} for ${{ env.FIRMWARE_TAG }} + allowUpdates: true + tag: ${{ env.FIRMWARE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: ${{ env.FIRMWARE_PATH }}/* + body: | + **This is OpenWrt Firmware for ${{ env.FIRMWARE_TAG }}** + ### 📒 版本24.10固件(NOWIFI) + - 这是NOWIFI,带NSS的6.6内核固件 + - 💻 这是 ${{ env.FIRMWARE_TAG }} 平台使用的 OpenWrt 固件 + - ⚽ 固件源码: ${{ env.REPO_URL }} + - 💝 源码分支: ${{ env.REPO_BRANCH }} + - 🌐 默认地址: 192.168.1.1 + - 🔑 默认密码: password + ### 🧊 固件版本 + - 固件编译前最后一次➦[主源码](${{ env.REPO_URL }})更新记录 + - ${{ env.VERSION_INFO }} diff --git a/.github/workflows/IPQ60XX-TEST.yml b/.github/workflows/IPQ60XX-24.10.yml similarity index 97% rename from .github/workflows/IPQ60XX-TEST.yml rename to .github/workflows/IPQ60XX-24.10.yml index fc1bc9c3..39f7befb 100644 --- a/.github/workflows/IPQ60XX-TEST.yml +++ b/.github/workflows/IPQ60XX-24.10.yml @@ -1,4 +1,4 @@ -name: IPQ60XX-TEST +name: IPQ60XX-24.10 on: workflow_dispatch: @@ -8,13 +8,13 @@ on: env: REPO_URL: https://github.com/LiBwrt-op/openwrt-6.x.git REPO_BRANCH: openwrt-24.10 - CONFIG_FILE: configs/ipq60xx-test.config + CONFIG_FILE: configs/ipq60xx.config DIY_SCRIPT: diy-script.sh CLASH_KERNEL: amd64 CACHE_TOOLCHAIN: true UPLOAD_BIN_DIR: false FIRMWARE_RELEASE: true - FIRMWARE_TAG: IPQ60XX-TEST + FIRMWARE_TAG: IPQ60XX-24.10 TZ: Asia/Shanghai jobs: @@ -158,8 +158,8 @@ jobs: artifacts: ${{ env.FIRMWARE_PATH }}/* body: | **This is OpenWrt Firmware for ${{ env.FIRMWARE_TAG }}** - ### 📒 测试固件(带WIFI) - - 这是带WIFI以及NSS的6.6内核固件 + ### 📒 版本24.10固件 + - 这是带WIFI,带NSS的6.6内核固件 - 💻 这是 ${{ env.FIRMWARE_TAG }} 平台使用的 OpenWrt 固件 - ⚽ 固件源码: ${{ env.REPO_URL }} - 💝 源码分支: ${{ env.REPO_BRANCH }} diff --git a/.github/workflows/IPQ60XX-ALL.yml b/.github/workflows/IPQ60XX-ALL.yml index 7d7cd7a8..cf8782ee 100644 --- a/.github/workflows/IPQ60XX-ALL.yml +++ b/.github/workflows/IPQ60XX-ALL.yml @@ -8,7 +8,7 @@ on: env: REPO_URL: https://github.com/LiBwrt-op/openwrt-6.x.git REPO_BRANCH: main - CONFIG_FILE: configs/ipq60xx-all.config + CONFIG_FILE: configs/ipq60xx.config DIY_SCRIPT: diy-script.sh CLASH_KERNEL: amd64 CACHE_TOOLCHAIN: true diff --git a/.github/workflows/IPQ60XX-NOWIFI.yml b/.github/workflows/IPQ60XX-NOWIFI.yml index 2667a3cb..ef85d999 100644 --- a/.github/workflows/IPQ60XX-NOWIFI.yml +++ b/.github/workflows/IPQ60XX-NOWIFI.yml @@ -8,7 +8,7 @@ on: env: REPO_URL: https://github.com/LiBwrt-op/openwrt-6.x.git REPO_BRANCH: main - CONFIG_FILE: configs/ipq60xx.config + CONFIG_FILE: configs/ipq60xx-nowifi.config DIY_SCRIPT: diy-script.sh CLASH_KERNEL: amd64 CACHE_TOOLCHAIN: true diff --git a/.github/workflows/IPQ807X-WIFI.yml b/.github/workflows/IPQ807X-WIFI.yml index 35c8e3bf..9d231bce 100644 --- a/.github/workflows/IPQ807X-WIFI.yml +++ b/.github/workflows/IPQ807X-WIFI.yml @@ -8,7 +8,7 @@ on: env: REPO_URL: https://github.com/breeze303/openwrt.git REPO_BRANCH: main - CONFIG_FILE: configs/ipq807x-wifi.config + CONFIG_FILE: configs/ipq807x.config PATCHES_FILE_1: patches/0001-show-soc-status-on-luci.patch DIY_SCRIPT: diy-script.sh CLASH_KERNEL: amd64 diff --git a/configs/ipq60xx-all.config b/configs/ipq60xx-nowifi.config similarity index 63% rename from configs/ipq60xx-all.config rename to configs/ipq60xx-nowifi.config index f2407df5..048fb271 100644 --- a/configs/ipq60xx-all.config +++ b/configs/ipq60xx-nowifi.config @@ -2,35 +2,26 @@ CONFIG_TARGET_qualcommax=y CONFIG_TARGET_qualcommax_ipq60xx=y CONFIG_TARGET_MULTI_PROFILE=y CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_cmiot_ax18=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_cmiot_ax18="ipq-wifi-cmiot_ax18" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800="ipq-wifi-glinet_gl-ax1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800="ipq-wifi-glinet_gl-axt1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro="ipq-wifi-jdcloud_ax1800-pro" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600="ipq-wifi-jdcloud_ax6600 ath11k-firmware-qcn9074 kmod-ath11k-pci" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_linksys_mr7350=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_linksys_mr7350="ipq-wifi-linksys_mr7350" +CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_re-cs-07=y CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_qihoo_v6=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_qihoo_v6="ipq-wifi-qihoo_v6" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5="ipq-wifi-redmi_ax5" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud="ipq-wifi-redmi_ax5-jdcloud" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800="ipq-wifi-xiaomi_ax1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_zn_m2=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_zn_m2="ipq-wifi-zn_m2" CONFIG_BUSYBOX_CUSTOM=y -CONFIG_TARGET_PER_DEVICE_ROOTFS=y -# CONFIG_ATH11K_MEM_PROFILE_1G is not set -CONFIG_ATH11K_MEM_PROFILE_512M=y +# CONFIG_ATH11K_NSS_SUPPORT is not set +CONFIG_BUSYBOX_CONFIG_DEVMEM=y CONFIG_BUSYBOX_CONFIG_LSUSB=y CONFIG_COREMARK_ENABLE_MULTITHREADING=y CONFIG_COREMARK_NUMBER_OF_THREADS=16 CONFIG_COREMARK_OPTIMIZE_O3=y +# CONFIG_DRIVER_11AC_SUPPORT is not set +# CONFIG_DRIVER_11AX_SUPPORT is not set +CONFIG_KERNEL_DEVMEM=y CONFIG_LIBCURL_COOKIES=y CONFIG_LIBCURL_CRYPTO_AUTH=y CONFIG_LIBCURL_FILE=y @@ -43,12 +34,13 @@ CONFIG_LIBCURL_TFTP=y CONFIG_LIBCURL_THREADED_RESOLVER=y CONFIG_LIBCURL_TLS_SRP=y CONFIG_LIBCURL_UNIX_SOCKETS=y -CONFIG_NSS_DRV_WIFI_MESH_ENABLE=y -CONFIG_PACKAGE_block-mount=y +# CONFIG_NSS_DRV_WIFI_EXT_VDEV_ENABLE is not set +# CONFIG_PACKAGE_ath11k-firmware-ipq6018 is not set +# CONFIG_PACKAGE_ath11k-firmware-qcn9074 is not set CONFIG_PACKAGE_boost=m CONFIG_PACKAGE_boost-program_options=m CONFIG_PACKAGE_boost-system=m -CONFIG_PACKAGE_chinadns-ng=m +CONFIG_PACKAGE_chinadns-ng=y CONFIG_PACKAGE_coremark=y CONFIG_PACKAGE_coreutils=m CONFIG_PACKAGE_coreutils-base64=m @@ -58,26 +50,49 @@ CONFIG_PACKAGE_ddns-scripts=y CONFIG_PACKAGE_ddns-scripts-services=y CONFIG_PACKAGE_dns2socks=m CONFIG_PACKAGE_dns2tcp=m +CONFIG_PACKAGE_dosfstools=m CONFIG_PACKAGE_etherwake=y -CONFIG_PACKAGE_firewall=m +CONFIG_PACKAGE_f2fsck=m +CONFIG_PACKAGE_fdisk=m +# CONFIG_PACKAGE_firewall is not set CONFIG_PACKAGE_firewall4=y +# CONFIG_PACKAGE_hostapd-common is not set CONFIG_PACKAGE_hysteria=m CONFIG_PACKAGE_ip-full=m CONFIG_PACKAGE_ip-tiny=y CONFIG_PACKAGE_iperf3=y +# CONFIG_PACKAGE_ipq-wifi-cmiot_ax18 is not set +# CONFIG_PACKAGE_ipq-wifi-glinet_gl-ax1800 is not set +# CONFIG_PACKAGE_ipq-wifi-glinet_gl-axt1800 is not set +# CONFIG_PACKAGE_ipq-wifi-jdcloud_ax1800-pro is not set +# CONFIG_PACKAGE_ipq-wifi-jdcloud_ax6600 is not set +# CONFIG_PACKAGE_ipq-wifi-qihoo_v6 is not set +# CONFIG_PACKAGE_ipq-wifi-redmi_ax5 is not set +# CONFIG_PACKAGE_ipq-wifi-redmi_ax5-jdcloud is not set +# CONFIG_PACKAGE_ipq-wifi-xiaomi_ax1800 is not set +# CONFIG_PACKAGE_ipq-wifi-zn_m2 is not set CONFIG_PACKAGE_ipt2socks=m CONFIG_PACKAGE_iptables-mod-ipopt=y +# CONFIG_PACKAGE_iw is not set +# CONFIG_PACKAGE_iwinfo is not set +# CONFIG_PACKAGE_kmod-ath is not set +# CONFIG_PACKAGE_kmod-ath11k is not set +# CONFIG_PACKAGE_kmod-ath11k-ahb is not set +# CONFIG_PACKAGE_kmod-ath11k-pci is not set +# CONFIG_PACKAGE_kmod-cfg80211 is not set CONFIG_PACKAGE_kmod-crypto-acompress=y -CONFIG_PACKAGE_kmod-crypto-crc32=y +CONFIG_PACKAGE_kmod-fs-exfat=m CONFIG_PACKAGE_kmod-fs-exportfs=y -CONFIG_PACKAGE_kmod-fs-f2fs=y +CONFIG_PACKAGE_kmod-fs-ntfs=m CONFIG_PACKAGE_kmod-fs-ntfs3=y -CONFIG_PACKAGE_kmod-fs-vfat=y CONFIG_PACKAGE_kmod-fs-xfs=y +CONFIG_PACKAGE_kmod-hwmon-pwmfan=m CONFIG_PACKAGE_kmod-inet-diag=y CONFIG_PACKAGE_kmod-ipt-ipopt=y CONFIG_PACKAGE_kmod-ipt-ipset=y CONFIG_PACKAGE_kmod-lib-lzo=y +# CONFIG_PACKAGE_kmod-mac80211 is not set +# CONFIG_PACKAGE_kmod-mhi-bus is not set CONFIG_PACKAGE_kmod-netlink-diag=y CONFIG_PACKAGE_kmod-nf-socket=y CONFIG_PACKAGE_kmod-nf-tproxy=y @@ -85,16 +100,11 @@ CONFIG_PACKAGE_kmod-nft-fib=y CONFIG_PACKAGE_kmod-nft-fullcone=y CONFIG_PACKAGE_kmod-nft-socket=y CONFIG_PACKAGE_kmod-nft-tproxy=y -CONFIG_PACKAGE_kmod-nls-cp437=y -CONFIG_PACKAGE_kmod-nls-iso8859-1=y -CONFIG_PACKAGE_kmod-nls-utf8=y -CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr=y +# CONFIG_PACKAGE_kmod-qrtr-mhi is not set CONFIG_PACKAGE_kmod-sched-cake=y -CONFIG_PACKAGE_kmod-scsi-core=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-dwc2=y CONFIG_PACKAGE_kmod-usb-dwc2-pci=y -CONFIG_PACKAGE_kmod-usb-ehci=y CONFIG_PACKAGE_kmod-usb-ohci=y CONFIG_PACKAGE_kmod-usb-ohci-pci=y CONFIG_PACKAGE_kmod-usb-phy-nop=y @@ -102,10 +112,8 @@ CONFIG_PACKAGE_kmod-usb-roles=y CONFIG_PACKAGE_kmod-usb-serial=y CONFIG_PACKAGE_kmod-usb-serial-qualcomm=y CONFIG_PACKAGE_kmod-usb-serial-wwan=y -CONFIG_PACKAGE_kmod-usb-storage=y CONFIG_PACKAGE_kmod-usb-storage-extras=y CONFIG_PACKAGE_kmod-usb-uhci=y -CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-zram=y CONFIG_PACKAGE_libatomic=y @@ -114,11 +122,14 @@ CONFIG_PACKAGE_libcap=y CONFIG_PACKAGE_libcap-ng=y CONFIG_PACKAGE_libcurl=m CONFIG_PACKAGE_libelf=m +CONFIG_PACKAGE_libf2fs=m +CONFIG_PACKAGE_libfdisk=m CONFIG_PACKAGE_libiperf3=y CONFIG_PACKAGE_liblua=y CONFIG_PACKAGE_liblucihttp-lua=y CONFIG_PACKAGE_libminiupnpc=y CONFIG_PACKAGE_libnatpmp=y +CONFIG_PACKAGE_libncurses=m CONFIG_PACKAGE_libnghttp2=m CONFIG_PACKAGE_libstdcpp=y CONFIG_PACKAGE_libubus-lua=y @@ -129,12 +140,7 @@ CONFIG_PACKAGE_lua=y CONFIG_PACKAGE_luci-app-argon-config=y CONFIG_PACKAGE_luci-app-cpufreq=y CONFIG_PACKAGE_luci-app-ddns=y -CONFIG_PACKAGE_luci-app-passwall=m -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set +CONFIG_PACKAGE_luci-app-homeproxy=y CONFIG_PACKAGE_luci-app-sqm=y CONFIG_PACKAGE_luci-app-ttyd=y CONFIG_PACKAGE_luci-app-upnp=y @@ -144,7 +150,7 @@ CONFIG_PACKAGE_luci-compat=y CONFIG_PACKAGE_luci-i18n-argon-config-zh-cn=y CONFIG_PACKAGE_luci-i18n-cpufreq-zh-cn=y CONFIG_PACKAGE_luci-i18n-ddns-zh-cn=y -CONFIG_PACKAGE_luci-i18n-passwall-zh-cn=m +CONFIG_PACKAGE_luci-i18n-homeproxy-zh-cn=y CONFIG_PACKAGE_luci-i18n-sqm-zh-cn=y CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y @@ -156,27 +162,30 @@ CONFIG_PACKAGE_luci-lib-jsonc=y CONFIG_PACKAGE_luci-lib-nixio=y CONFIG_PACKAGE_luci-lua-runtime=y CONFIG_PACKAGE_luci-theme-argon=y -CONFIG_PACKAGE_microsocks=m CONFIG_PACKAGE_miniupnpd-nftables=y +CONFIG_PACKAGE_mkf2fs=m CONFIG_PACKAGE_resolveip=m -CONFIG_PACKAGE_sing-box=m +CONFIG_PACKAGE_sing-box=y CONFIG_PACKAGE_sqm-scripts=y CONFIG_PACKAGE_tc-tiny=y CONFIG_PACKAGE_tcping=m -CONFIG_PACKAGE_trojan-plus=m +CONFIG_PACKAGE_terminfo=m CONFIG_PACKAGE_ttyd=y CONFIG_PACKAGE_ucode-mod-lua=y CONFIG_PACKAGE_unzip=m -CONFIG_PACKAGE_v2ray-plugin=m -CONFIG_PACKAGE_wpad-basic-mbedtls=m +# CONFIG_PACKAGE_wifi-scripts is not set +# CONFIG_PACKAGE_wireless-regdb is not set +# CONFIG_PACKAGE_wpad-openssl is not set CONFIG_PACKAGE_xray-core=m CONFIG_PACKAGE_zerotier=y CONFIG_PACKAGE_zlib=y CONFIG_PACKAGE_zram-swap=y +CONFIG_SING_BOX_BUILD_ACME=y CONFIG_SING_BOX_BUILD_CLASH_API=y CONFIG_SING_BOX_BUILD_ECH=y CONFIG_SING_BOX_BUILD_GVISOR=y CONFIG_SING_BOX_BUILD_QUIC=y +CONFIG_SING_BOX_BUILD_REALITY_SERVER=y CONFIG_SING_BOX_BUILD_UTLS=y CONFIG_SING_BOX_BUILD_WIREGUARD=y # CONFIG_TARGET_ROOTFS_INITRAMFS is not set @@ -186,8 +195,31 @@ CONFIG_boost-runtime-shared=y CONFIG_boost-static-and-shared-libs=y CONFIG_boost-variant-release=y CONFIG_PACKAGE_iptables-mod-fullconenat=y +CONFIG_PACKAGE_kmod-crypto-aead=y +CONFIG_PACKAGE_kmod-crypto-ccm=y +CONFIG_PACKAGE_kmod-crypto-cmac=y +CONFIG_PACKAGE_kmod-crypto-ctr=y +CONFIG_PACKAGE_kmod-crypto-gcm=y +CONFIG_PACKAGE_kmod-crypto-geniv=y +CONFIG_PACKAGE_kmod-crypto-gf128=y +CONFIG_PACKAGE_kmod-crypto-ghash=y +CONFIG_PACKAGE_kmod-crypto-hmac=y +CONFIG_PACKAGE_kmod-crypto-manager=y +CONFIG_PACKAGE_kmod-crypto-michael-mic=y +CONFIG_PACKAGE_kmod-crypto-null=y +CONFIG_PACKAGE_kmod-crypto-rng=y +CONFIG_PACKAGE_kmod-crypto-seqiv=y +CONFIG_PACKAGE_kmod-crypto-sha3=y +CONFIG_PACKAGE_kmod-crypto-sha512=y CONFIG_PACKAGE_kmod-ipt-conntrack=y CONFIG_PACKAGE_kmod-ipt-fullconenat=y CONFIG_PACKAGE_kmod-ipt-nat=y +CONFIG_PACKAGE_kmod-qrtr=y +CONFIG_PACKAGE_kmod-qrtr-smd=y CONFIG_PACKAGE_libip4tc=y CONFIG_PACKAGE_libip6tc=y +CONFIG_PACKAGE_libopenssl-conf=y +CONFIG_PACKAGE_libopenssl-legacy=y +CONFIG_PACKAGE_ucode-mod-nl80211=y +CONFIG_PACKAGE_ucode-mod-rtnl=y +CONFIG_PACKAGE_ucode-mod-uloop=y diff --git a/configs/ipq60xx-test.config b/configs/ipq60xx-test.config deleted file mode 100644 index b8de7f30..00000000 --- a/configs/ipq60xx-test.config +++ /dev/null @@ -1,219 +0,0 @@ -CONFIG_TARGET_qualcommax=y -CONFIG_TARGET_qualcommax_ipq60xx=y -CONFIG_TARGET_MULTI_PROFILE=y -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_cmiot_ax18=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_cmiot_ax18="ipq-wifi-cmiot_ax18" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800="ipq-wifi-glinet_gl-ax1800" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800="ipq-wifi-glinet_gl-axt1800" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro="ipq-wifi-jdcloud_ax1800-pro" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600="ipq-wifi-jdcloud_ax6600 ath11k-firmware-qcn9074 kmod-ath11k-pci" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_linksys_mr7350=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_linksys_mr7350="ipq-wifi-linksys_mr7350" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_qihoo_v6=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_qihoo_v6="ipq-wifi-qihoo_v6" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5="ipq-wifi-redmi_ax5" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud="ipq-wifi-redmi_ax5-jdcloud" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800="ipq-wifi-xiaomi_ax1800" -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_zn_m2=y -CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_zn_m2="ipq-wifi-zn_m2" -CONFIG_BUSYBOX_CUSTOM=y -CONFIG_TARGET_PER_DEVICE_ROOTFS=y -# CONFIG_ATH11K_MEM_PROFILE_1G is not set -CONFIG_ATH11K_MEM_PROFILE_512M=y -CONFIG_BUSYBOX_CONFIG_LSUSB=y -CONFIG_COREMARK_ENABLE_MULTITHREADING=y -CONFIG_COREMARK_NUMBER_OF_THREADS=16 -CONFIG_COREMARK_OPTIMIZE_O3=y -CONFIG_LIBCURL_COOKIES=y -CONFIG_LIBCURL_CRYPTO_AUTH=y -CONFIG_LIBCURL_FILE=y -CONFIG_LIBCURL_FTP=y -CONFIG_LIBCURL_HTTP=y -CONFIG_LIBCURL_NGHTTP2=y -CONFIG_LIBCURL_OPENSSL=y -CONFIG_LIBCURL_PROXY=y -CONFIG_LIBCURL_TFTP=y -CONFIG_LIBCURL_THREADED_RESOLVER=y -CONFIG_LIBCURL_TLS_SRP=y -CONFIG_LIBCURL_UNIX_SOCKETS=y -CONFIG_NSS_DRV_WIFI_MESH_ENABLE=y -CONFIG_PACKAGE_blkid=y -CONFIG_PACKAGE_block-mount=y -CONFIG_PACKAGE_boost=m -CONFIG_PACKAGE_boost-program_options=m -CONFIG_PACKAGE_boost-system=m -CONFIG_PACKAGE_btrfs-progs=y -CONFIG_PACKAGE_chinadns-ng=y -CONFIG_PACKAGE_coremark=y -CONFIG_PACKAGE_coreutils=m -CONFIG_PACKAGE_coreutils-base64=m -CONFIG_PACKAGE_coreutils-nohup=m -CONFIG_PACKAGE_curl=m -CONFIG_PACKAGE_ddns-scripts=y -CONFIG_PACKAGE_ddns-scripts-services=y -CONFIG_PACKAGE_dns2socks=m -CONFIG_PACKAGE_dns2tcp=m -CONFIG_PACKAGE_etherwake=y -CONFIG_PACKAGE_firewall=m -CONFIG_PACKAGE_firewall4=y -CONFIG_PACKAGE_hysteria=m -CONFIG_PACKAGE_ip-full=m -CONFIG_PACKAGE_ip-tiny=y -CONFIG_PACKAGE_iperf3=y -CONFIG_PACKAGE_ipt2socks=m -CONFIG_PACKAGE_iptables-mod-ipopt=y -CONFIG_PACKAGE_kmod-crypto-acompress=y -CONFIG_PACKAGE_kmod-crypto-blake2b=y -CONFIG_PACKAGE_kmod-crypto-crc32=y -CONFIG_PACKAGE_kmod-crypto-xxhash=y -CONFIG_PACKAGE_kmod-fs-btrfs=y -CONFIG_PACKAGE_kmod-fs-exportfs=y -CONFIG_PACKAGE_kmod-fs-f2fs=y -CONFIG_PACKAGE_kmod-fs-ntfs3=y -CONFIG_PACKAGE_kmod-fs-vfat=y -CONFIG_PACKAGE_kmod-fs-xfs=y -CONFIG_PACKAGE_kmod-inet-diag=y -CONFIG_PACKAGE_kmod-ipt-ipopt=y -CONFIG_PACKAGE_kmod-ipt-ipset=y -CONFIG_PACKAGE_kmod-lib-lzo=y -CONFIG_PACKAGE_kmod-lib-raid6=y -CONFIG_PACKAGE_kmod-lib-xor=y -CONFIG_PACKAGE_kmod-lib-xxhash=y -CONFIG_PACKAGE_kmod-lib-zlib-deflate=y -CONFIG_PACKAGE_kmod-lib-zlib-inflate=y -CONFIG_PACKAGE_kmod-lib-zstd=y -CONFIG_PACKAGE_kmod-netlink-diag=y -CONFIG_PACKAGE_kmod-nf-socket=y -CONFIG_PACKAGE_kmod-nf-tproxy=y -CONFIG_PACKAGE_kmod-nft-fib=y -CONFIG_PACKAGE_kmod-nft-fullcone=y -CONFIG_PACKAGE_kmod-nft-socket=y -CONFIG_PACKAGE_kmod-nft-tproxy=y -CONFIG_PACKAGE_kmod-nls-cp437=y -CONFIG_PACKAGE_kmod-nls-iso8859-1=y -CONFIG_PACKAGE_kmod-nls-utf8=y -CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr=y -CONFIG_PACKAGE_kmod-sched-cake=y -CONFIG_PACKAGE_kmod-scsi-core=y -CONFIG_PACKAGE_kmod-tun=y -CONFIG_PACKAGE_kmod-usb-dwc2=y -CONFIG_PACKAGE_kmod-usb-dwc2-pci=y -CONFIG_PACKAGE_kmod-usb-ehci=y -CONFIG_PACKAGE_kmod-usb-ohci=y -CONFIG_PACKAGE_kmod-usb-ohci-pci=y -CONFIG_PACKAGE_kmod-usb-phy-nop=y -CONFIG_PACKAGE_kmod-usb-roles=y -CONFIG_PACKAGE_kmod-usb-serial=y -CONFIG_PACKAGE_kmod-usb-serial-qualcomm=y -CONFIG_PACKAGE_kmod-usb-serial-wwan=y -CONFIG_PACKAGE_kmod-usb-storage=y -CONFIG_PACKAGE_kmod-usb-storage-extras=y -CONFIG_PACKAGE_kmod-usb-uhci=y -CONFIG_PACKAGE_kmod-usb2=y -CONFIG_PACKAGE_kmod-usb2-pci=y -CONFIG_PACKAGE_kmod-zram=y -CONFIG_PACKAGE_libatomic=y -CONFIG_PACKAGE_libattr=y -CONFIG_PACKAGE_libbpf=m -CONFIG_PACKAGE_libcap=y -CONFIG_PACKAGE_libcap-ng=y -CONFIG_PACKAGE_libcurl=m -CONFIG_PACKAGE_libelf=m -CONFIG_PACKAGE_libiperf3=y -CONFIG_PACKAGE_liblua=y -CONFIG_PACKAGE_liblucihttp-lua=y -CONFIG_PACKAGE_liblzo=y -CONFIG_PACKAGE_libminiupnpc=y -CONFIG_PACKAGE_libmount=y -CONFIG_PACKAGE_libnatpmp=y -CONFIG_PACKAGE_libncurses=y -CONFIG_PACKAGE_libnghttp2=m -CONFIG_PACKAGE_libparted=y -CONFIG_PACKAGE_libreadline=y -CONFIG_PACKAGE_libstdcpp=y -CONFIG_PACKAGE_libubus-lua=y -CONFIG_PACKAGE_libuci-lua=m -CONFIG_PACKAGE_libuv=y -CONFIG_PACKAGE_libwebsockets-full=y -CONFIG_PACKAGE_lsblk=y -CONFIG_PACKAGE_lua=y -CONFIG_PACKAGE_luci-app-argon-config=y -CONFIG_PACKAGE_luci-app-cpufreq=y -CONFIG_PACKAGE_luci-app-ddns=y -CONFIG_PACKAGE_luci-app-diskman=y -CONFIG_PACKAGE_luci-app-homeproxy=y -CONFIG_PACKAGE_luci-app-passwall=m -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set -# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set -CONFIG_PACKAGE_luci-app-sqm=y -CONFIG_PACKAGE_luci-app-ttyd=y -CONFIG_PACKAGE_luci-app-upnp=y -CONFIG_PACKAGE_luci-app-wol=y -CONFIG_PACKAGE_luci-app-zerotier=y -CONFIG_PACKAGE_luci-compat=y -CONFIG_PACKAGE_luci-i18n-argon-config-zh-cn=y -CONFIG_PACKAGE_luci-i18n-cpufreq-zh-cn=y -CONFIG_PACKAGE_luci-i18n-ddns-zh-cn=y -CONFIG_PACKAGE_luci-i18n-diskman-zh-cn=y -CONFIG_PACKAGE_luci-i18n-homeproxy-zh-cn=y -CONFIG_PACKAGE_luci-i18n-passwall-zh-cn=m -CONFIG_PACKAGE_luci-i18n-sqm-zh-cn=y -CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y -CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y -CONFIG_PACKAGE_luci-i18n-wol-zh-cn=y -CONFIG_PACKAGE_luci-i18n-zerotier-zh-cn=y -CONFIG_PACKAGE_luci-lib-base=y -CONFIG_PACKAGE_luci-lib-ip=y -CONFIG_PACKAGE_luci-lib-jsonc=y -CONFIG_PACKAGE_luci-lib-nixio=y -CONFIG_PACKAGE_luci-lua-runtime=y -CONFIG_PACKAGE_luci-theme-argon=y -CONFIG_PACKAGE_microsocks=m -CONFIG_PACKAGE_miniupnpd-nftables=y -CONFIG_PACKAGE_parted=y -CONFIG_PACKAGE_resolveip=m -CONFIG_PACKAGE_sing-box=y -CONFIG_PACKAGE_smartmontools=y -CONFIG_PACKAGE_sqm-scripts=y -CONFIG_PACKAGE_tc-tiny=y -CONFIG_PACKAGE_tcping=m -CONFIG_PACKAGE_terminfo=y -CONFIG_PACKAGE_trojan-plus=m -CONFIG_PACKAGE_ttyd=y -CONFIG_PACKAGE_ucode-mod-lua=y -CONFIG_PACKAGE_unzip=m -CONFIG_PACKAGE_v2ray-plugin=m -CONFIG_PACKAGE_wpad-basic-mbedtls=m -CONFIG_PACKAGE_xray-core=m -CONFIG_PACKAGE_zerotier=y -CONFIG_PACKAGE_zlib=y -CONFIG_PACKAGE_zram-swap=y -CONFIG_PARTED_READLINE=y -CONFIG_SING_BOX_BUILD_CLASH_API=y -CONFIG_SING_BOX_BUILD_ECH=y -CONFIG_SING_BOX_BUILD_GVISOR=y -CONFIG_SING_BOX_BUILD_QUIC=y -CONFIG_SING_BOX_BUILD_UTLS=y -CONFIG_SING_BOX_BUILD_WIREGUARD=y -# CONFIG_TARGET_ROOTFS_INITRAMFS is not set -CONFIG_ZRAM_DEF_COMP_LZORLE=y -CONFIG_boost-compile-visibility-hidden=y -CONFIG_boost-runtime-shared=y -CONFIG_boost-static-and-shared-libs=y -CONFIG_boost-variant-release=y -CONFIG_PACKAGE_iptables-mod-fullconenat=y -CONFIG_PACKAGE_kmod-ipt-conntrack=y -CONFIG_PACKAGE_kmod-ipt-fullconenat=y -CONFIG_PACKAGE_kmod-ipt-nat=y -CONFIG_PACKAGE_libip4tc=y -CONFIG_PACKAGE_libip6tc=y diff --git a/configs/ipq60xx.config b/configs/ipq60xx.config index 048fb271..f2407df5 100644 --- a/configs/ipq60xx.config +++ b/configs/ipq60xx.config @@ -2,26 +2,35 @@ CONFIG_TARGET_qualcommax=y CONFIG_TARGET_qualcommax_ipq60xx=y CONFIG_TARGET_MULTI_PROFILE=y CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_cmiot_ax18=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_cmiot_ax18="ipq-wifi-cmiot_ax18" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800="ipq-wifi-glinet_gl-ax1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800="ipq-wifi-glinet_gl-axt1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax1800-pro="ipq-wifi-jdcloud_ax1800-pro" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600=y -CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_jdcloud_re-cs-07=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_jdcloud_ax6600="ipq-wifi-jdcloud_ax6600 ath11k-firmware-qcn9074 kmod-ath11k-pci" +CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_linksys_mr7350=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_linksys_mr7350="ipq-wifi-linksys_mr7350" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_qihoo_v6=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_qihoo_v6="ipq-wifi-qihoo_v6" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5="ipq-wifi-redmi_ax5" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_redmi_ax5-jdcloud="ipq-wifi-redmi_ax5-jdcloud" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_xiaomi_ax1800="ipq-wifi-xiaomi_ax1800" CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_zn_m2=y +CONFIG_TARGET_DEVICE_PACKAGES_qualcommax_ipq60xx_DEVICE_zn_m2="ipq-wifi-zn_m2" CONFIG_BUSYBOX_CUSTOM=y -# CONFIG_ATH11K_NSS_SUPPORT is not set -CONFIG_BUSYBOX_CONFIG_DEVMEM=y +CONFIG_TARGET_PER_DEVICE_ROOTFS=y +# CONFIG_ATH11K_MEM_PROFILE_1G is not set +CONFIG_ATH11K_MEM_PROFILE_512M=y CONFIG_BUSYBOX_CONFIG_LSUSB=y CONFIG_COREMARK_ENABLE_MULTITHREADING=y CONFIG_COREMARK_NUMBER_OF_THREADS=16 CONFIG_COREMARK_OPTIMIZE_O3=y -# CONFIG_DRIVER_11AC_SUPPORT is not set -# CONFIG_DRIVER_11AX_SUPPORT is not set -CONFIG_KERNEL_DEVMEM=y CONFIG_LIBCURL_COOKIES=y CONFIG_LIBCURL_CRYPTO_AUTH=y CONFIG_LIBCURL_FILE=y @@ -34,13 +43,12 @@ CONFIG_LIBCURL_TFTP=y CONFIG_LIBCURL_THREADED_RESOLVER=y CONFIG_LIBCURL_TLS_SRP=y CONFIG_LIBCURL_UNIX_SOCKETS=y -# CONFIG_NSS_DRV_WIFI_EXT_VDEV_ENABLE is not set -# CONFIG_PACKAGE_ath11k-firmware-ipq6018 is not set -# CONFIG_PACKAGE_ath11k-firmware-qcn9074 is not set +CONFIG_NSS_DRV_WIFI_MESH_ENABLE=y +CONFIG_PACKAGE_block-mount=y CONFIG_PACKAGE_boost=m CONFIG_PACKAGE_boost-program_options=m CONFIG_PACKAGE_boost-system=m -CONFIG_PACKAGE_chinadns-ng=y +CONFIG_PACKAGE_chinadns-ng=m CONFIG_PACKAGE_coremark=y CONFIG_PACKAGE_coreutils=m CONFIG_PACKAGE_coreutils-base64=m @@ -50,49 +58,26 @@ CONFIG_PACKAGE_ddns-scripts=y CONFIG_PACKAGE_ddns-scripts-services=y CONFIG_PACKAGE_dns2socks=m CONFIG_PACKAGE_dns2tcp=m -CONFIG_PACKAGE_dosfstools=m CONFIG_PACKAGE_etherwake=y -CONFIG_PACKAGE_f2fsck=m -CONFIG_PACKAGE_fdisk=m -# CONFIG_PACKAGE_firewall is not set +CONFIG_PACKAGE_firewall=m CONFIG_PACKAGE_firewall4=y -# CONFIG_PACKAGE_hostapd-common is not set CONFIG_PACKAGE_hysteria=m CONFIG_PACKAGE_ip-full=m CONFIG_PACKAGE_ip-tiny=y CONFIG_PACKAGE_iperf3=y -# CONFIG_PACKAGE_ipq-wifi-cmiot_ax18 is not set -# CONFIG_PACKAGE_ipq-wifi-glinet_gl-ax1800 is not set -# CONFIG_PACKAGE_ipq-wifi-glinet_gl-axt1800 is not set -# CONFIG_PACKAGE_ipq-wifi-jdcloud_ax1800-pro is not set -# CONFIG_PACKAGE_ipq-wifi-jdcloud_ax6600 is not set -# CONFIG_PACKAGE_ipq-wifi-qihoo_v6 is not set -# CONFIG_PACKAGE_ipq-wifi-redmi_ax5 is not set -# CONFIG_PACKAGE_ipq-wifi-redmi_ax5-jdcloud is not set -# CONFIG_PACKAGE_ipq-wifi-xiaomi_ax1800 is not set -# CONFIG_PACKAGE_ipq-wifi-zn_m2 is not set CONFIG_PACKAGE_ipt2socks=m CONFIG_PACKAGE_iptables-mod-ipopt=y -# CONFIG_PACKAGE_iw is not set -# CONFIG_PACKAGE_iwinfo is not set -# CONFIG_PACKAGE_kmod-ath is not set -# CONFIG_PACKAGE_kmod-ath11k is not set -# CONFIG_PACKAGE_kmod-ath11k-ahb is not set -# CONFIG_PACKAGE_kmod-ath11k-pci is not set -# CONFIG_PACKAGE_kmod-cfg80211 is not set CONFIG_PACKAGE_kmod-crypto-acompress=y -CONFIG_PACKAGE_kmod-fs-exfat=m +CONFIG_PACKAGE_kmod-crypto-crc32=y CONFIG_PACKAGE_kmod-fs-exportfs=y -CONFIG_PACKAGE_kmod-fs-ntfs=m +CONFIG_PACKAGE_kmod-fs-f2fs=y CONFIG_PACKAGE_kmod-fs-ntfs3=y +CONFIG_PACKAGE_kmod-fs-vfat=y CONFIG_PACKAGE_kmod-fs-xfs=y -CONFIG_PACKAGE_kmod-hwmon-pwmfan=m CONFIG_PACKAGE_kmod-inet-diag=y CONFIG_PACKAGE_kmod-ipt-ipopt=y CONFIG_PACKAGE_kmod-ipt-ipset=y CONFIG_PACKAGE_kmod-lib-lzo=y -# CONFIG_PACKAGE_kmod-mac80211 is not set -# CONFIG_PACKAGE_kmod-mhi-bus is not set CONFIG_PACKAGE_kmod-netlink-diag=y CONFIG_PACKAGE_kmod-nf-socket=y CONFIG_PACKAGE_kmod-nf-tproxy=y @@ -100,11 +85,16 @@ CONFIG_PACKAGE_kmod-nft-fib=y CONFIG_PACKAGE_kmod-nft-fullcone=y CONFIG_PACKAGE_kmod-nft-socket=y CONFIG_PACKAGE_kmod-nft-tproxy=y -# CONFIG_PACKAGE_kmod-qrtr-mhi is not set +CONFIG_PACKAGE_kmod-nls-cp437=y +CONFIG_PACKAGE_kmod-nls-iso8859-1=y +CONFIG_PACKAGE_kmod-nls-utf8=y +CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr=y CONFIG_PACKAGE_kmod-sched-cake=y +CONFIG_PACKAGE_kmod-scsi-core=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-dwc2=y CONFIG_PACKAGE_kmod-usb-dwc2-pci=y +CONFIG_PACKAGE_kmod-usb-ehci=y CONFIG_PACKAGE_kmod-usb-ohci=y CONFIG_PACKAGE_kmod-usb-ohci-pci=y CONFIG_PACKAGE_kmod-usb-phy-nop=y @@ -112,8 +102,10 @@ CONFIG_PACKAGE_kmod-usb-roles=y CONFIG_PACKAGE_kmod-usb-serial=y CONFIG_PACKAGE_kmod-usb-serial-qualcomm=y CONFIG_PACKAGE_kmod-usb-serial-wwan=y +CONFIG_PACKAGE_kmod-usb-storage=y CONFIG_PACKAGE_kmod-usb-storage-extras=y CONFIG_PACKAGE_kmod-usb-uhci=y +CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-zram=y CONFIG_PACKAGE_libatomic=y @@ -122,14 +114,11 @@ CONFIG_PACKAGE_libcap=y CONFIG_PACKAGE_libcap-ng=y CONFIG_PACKAGE_libcurl=m CONFIG_PACKAGE_libelf=m -CONFIG_PACKAGE_libf2fs=m -CONFIG_PACKAGE_libfdisk=m CONFIG_PACKAGE_libiperf3=y CONFIG_PACKAGE_liblua=y CONFIG_PACKAGE_liblucihttp-lua=y CONFIG_PACKAGE_libminiupnpc=y CONFIG_PACKAGE_libnatpmp=y -CONFIG_PACKAGE_libncurses=m CONFIG_PACKAGE_libnghttp2=m CONFIG_PACKAGE_libstdcpp=y CONFIG_PACKAGE_libubus-lua=y @@ -140,7 +129,12 @@ CONFIG_PACKAGE_lua=y CONFIG_PACKAGE_luci-app-argon-config=y CONFIG_PACKAGE_luci-app-cpufreq=y CONFIG_PACKAGE_luci-app-ddns=y -CONFIG_PACKAGE_luci-app-homeproxy=y +CONFIG_PACKAGE_luci-app-passwall=m +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set +CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set CONFIG_PACKAGE_luci-app-sqm=y CONFIG_PACKAGE_luci-app-ttyd=y CONFIG_PACKAGE_luci-app-upnp=y @@ -150,7 +144,7 @@ CONFIG_PACKAGE_luci-compat=y CONFIG_PACKAGE_luci-i18n-argon-config-zh-cn=y CONFIG_PACKAGE_luci-i18n-cpufreq-zh-cn=y CONFIG_PACKAGE_luci-i18n-ddns-zh-cn=y -CONFIG_PACKAGE_luci-i18n-homeproxy-zh-cn=y +CONFIG_PACKAGE_luci-i18n-passwall-zh-cn=m CONFIG_PACKAGE_luci-i18n-sqm-zh-cn=y CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y @@ -162,30 +156,27 @@ CONFIG_PACKAGE_luci-lib-jsonc=y CONFIG_PACKAGE_luci-lib-nixio=y CONFIG_PACKAGE_luci-lua-runtime=y CONFIG_PACKAGE_luci-theme-argon=y +CONFIG_PACKAGE_microsocks=m CONFIG_PACKAGE_miniupnpd-nftables=y -CONFIG_PACKAGE_mkf2fs=m CONFIG_PACKAGE_resolveip=m -CONFIG_PACKAGE_sing-box=y +CONFIG_PACKAGE_sing-box=m CONFIG_PACKAGE_sqm-scripts=y CONFIG_PACKAGE_tc-tiny=y CONFIG_PACKAGE_tcping=m -CONFIG_PACKAGE_terminfo=m +CONFIG_PACKAGE_trojan-plus=m CONFIG_PACKAGE_ttyd=y CONFIG_PACKAGE_ucode-mod-lua=y CONFIG_PACKAGE_unzip=m -# CONFIG_PACKAGE_wifi-scripts is not set -# CONFIG_PACKAGE_wireless-regdb is not set -# CONFIG_PACKAGE_wpad-openssl is not set +CONFIG_PACKAGE_v2ray-plugin=m +CONFIG_PACKAGE_wpad-basic-mbedtls=m CONFIG_PACKAGE_xray-core=m CONFIG_PACKAGE_zerotier=y CONFIG_PACKAGE_zlib=y CONFIG_PACKAGE_zram-swap=y -CONFIG_SING_BOX_BUILD_ACME=y CONFIG_SING_BOX_BUILD_CLASH_API=y CONFIG_SING_BOX_BUILD_ECH=y CONFIG_SING_BOX_BUILD_GVISOR=y CONFIG_SING_BOX_BUILD_QUIC=y -CONFIG_SING_BOX_BUILD_REALITY_SERVER=y CONFIG_SING_BOX_BUILD_UTLS=y CONFIG_SING_BOX_BUILD_WIREGUARD=y # CONFIG_TARGET_ROOTFS_INITRAMFS is not set @@ -195,31 +186,8 @@ CONFIG_boost-runtime-shared=y CONFIG_boost-static-and-shared-libs=y CONFIG_boost-variant-release=y CONFIG_PACKAGE_iptables-mod-fullconenat=y -CONFIG_PACKAGE_kmod-crypto-aead=y -CONFIG_PACKAGE_kmod-crypto-ccm=y -CONFIG_PACKAGE_kmod-crypto-cmac=y -CONFIG_PACKAGE_kmod-crypto-ctr=y -CONFIG_PACKAGE_kmod-crypto-gcm=y -CONFIG_PACKAGE_kmod-crypto-geniv=y -CONFIG_PACKAGE_kmod-crypto-gf128=y -CONFIG_PACKAGE_kmod-crypto-ghash=y -CONFIG_PACKAGE_kmod-crypto-hmac=y -CONFIG_PACKAGE_kmod-crypto-manager=y -CONFIG_PACKAGE_kmod-crypto-michael-mic=y -CONFIG_PACKAGE_kmod-crypto-null=y -CONFIG_PACKAGE_kmod-crypto-rng=y -CONFIG_PACKAGE_kmod-crypto-seqiv=y -CONFIG_PACKAGE_kmod-crypto-sha3=y -CONFIG_PACKAGE_kmod-crypto-sha512=y CONFIG_PACKAGE_kmod-ipt-conntrack=y CONFIG_PACKAGE_kmod-ipt-fullconenat=y CONFIG_PACKAGE_kmod-ipt-nat=y -CONFIG_PACKAGE_kmod-qrtr=y -CONFIG_PACKAGE_kmod-qrtr-smd=y CONFIG_PACKAGE_libip4tc=y CONFIG_PACKAGE_libip6tc=y -CONFIG_PACKAGE_libopenssl-conf=y -CONFIG_PACKAGE_libopenssl-legacy=y -CONFIG_PACKAGE_ucode-mod-nl80211=y -CONFIG_PACKAGE_ucode-mod-rtnl=y -CONFIG_PACKAGE_ucode-mod-uloop=y diff --git a/configs/ipq807x-wifi.config b/configs/ipq807x.config similarity index 100% rename from configs/ipq807x-wifi.config rename to configs/ipq807x.config diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 6b225ab4..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM scratch -ADD openwrt-armvirt-64-default-rootfs-patched.tar / -EXPOSE 22 53 80 443 7681 -# using exec format so that /sbin/init is proc 1 (see procd docs) -ENTRYPOINT ["/sbin/init"] diff --git a/docker/buildImageX.sh b/docker/buildImageX.sh deleted file mode 100644 index f01a2829..00000000 --- a/docker/buildImageX.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -TMPDIR=openwrt-armvirt -ROOTFS=openwrt-armvirt-64-generic-rootfs.tar.gz - -[ -d "$TMPDIR" ] && rm -rf "$TMPDIR" -mkdir -p "$TMPDIR" && gzip -dc ${ROOTFS} | ( cd "$TMPDIR" && tar xf - && rm -rf ./lib/firmware/* && rm -rf ./lib/modules/*) - -[ -x $TMPDIR/bin/bash ] && \ - cp -f patches/30-sysinfo.sh $TMPDIR/etc/profile.d/ && \ - sed -e "s/\/bin\/ash/\/bin\/bash/" -i $TMPDIR/etc/passwd && \ - sed -e "s/\/bin\/ash/\/bin\/bash/" -i $TMPDIR/usr/libexec/login.sh - -[ -f patches/banner ] && \ - cp -f patches/banner $TMPDIR/etc/ && \ - echo "The docker aarch64 special edition" >> $TMPDIR/etc/banner - -cat >> $TMPDIR/etc/sysupgrade.conf <<EOF -/etc/ssh/ssh_host_ed25519_key -/etc/ssh/ssh_host_ed25519_key.pub -/etc/ssh/ssh_host_rsa_key -/etc/ssh/ssh_host_rsa_key.pub -/root/.ssh/ -EOF - -cp -f patches/rc.local "$TMPDIR/etc/" && \ -cp -f patches/99-custom.conf "$TMPDIR/etc/sysctl.d/" && \ -cp -f patches/cpustat "$TMPDIR/usr/bin/" && chmod 755 "$TMPDIR/usr/bin/cpustat" && \ -cp -f patches/getcpu "$TMPDIR/bin/" && chmod 755 "$TMPDIR/bin/getcpu" && \ -cp -f patches/coremark.sh "$TMPDIR/etc/" && chmod 755 "$TMPDIR/etc/coremark.sh" -cp -f patches/kmod "$TMPDIR/sbin/" && \ - ( - cd $TMPDIR/sbin && \ - chmod 755 kmod && \ - rm insmod lsmod modinfo modprobe rmmod && \ - ln -s kmod insmod && \ - ln -s kmod lsmod && \ - ln -s kmod modinfo && \ - ln -s kmod modprobe && \ - ln -s kmod rmmod - ) - -for p in `echo patches/index.html.patches/*.patch`;do - cat $p | (cd "$TMPDIR/" && patch -p1 && find . -name '*.orig' -exec rm {} \; && find . -name '*.rej' -exec rm {} \;) -done - -cat patches/init.d_turboacc.patch | (cd "$TMPDIR/" && patch -p1) -if ! cat patches/cbi_turboacc_new.patch | (cd "$TMPDIR/" && patch -p1);then - cat patches/cbi_turboacc.patch | (cd "$TMPDIR/" && patch -p1) - ( - find "$TMPDIR" -name '*.rej' -exec rm {} \; - find "$TMPDIR" -name '*.orig' -exec rm {} \; - ) -fi -sed -e "s/hw_flow '1'/hw_flow '0'/" -i $TMPDIR/etc/config/turboacc -sed -e "s/sfe_flow '1'/sfe_flow '0'/" -i $TMPDIR/etc/config/turboacc - -rm -f "$TMPDIR/etc/bench.log" && \ -echo "17 3 * * * /etc/coremark.sh" >> "$TMPDIR/etc/crontabs/root" - -[ -f ${TMPDIR}/etc/config/qbittorrent ] && sed -e 's/\/opt/\/etc/' -i "${TMPDIR}/etc/config/qbittorrent" - -[ -f ${TMPDIR}/etc/ssh/sshd_config ] && sed -e "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" -i "${TMPDIR}/etc/ssh/sshd_config" - -[ -f ${TMPDIR}/etc/samba/smb.conf.template ] && cat patches/smb4.11_enable_smb1.patch | (cd "$TMPDIR" && [ -f etc/samba/smb.conf.template ] && patch -p1) - -sss=$(date +%s) && \ -ddd=$((sss/86400)) && \ -sed -e "s/:0:0:99999:7:::/:${ddd}:0:99999:7:::/" -i "${TMPDIR}/etc/shadow" && \ -sed -e "s/root::/root:\$1\$0yUsq67p\$RC5cEtaQpM6KHQfhUSIAl\.:/" -i "${TMPDIR}/etc/shadow" - -(cd "$TMPDIR" && tar cf ../openwrt-armvirt-64-default-rootfs-patched.tar .) && \ -rm -rf "$TMPDIR" diff --git a/docker/patches/30-sysinfo.sh b/docker/patches/30-sysinfo.sh deleted file mode 100644 index b4f71d35..00000000 --- a/docker/patches/30-sysinfo.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# -# DO NOT EDIT THIS FILE but add config options to /etc/default/motd -# any changes will be lost on board support package update -# -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ -x /usr/bin/dmesg ] && alias dmesg='dmesg --color=auto' - -THIS_SCRIPT="sysinfo" -MOTD_DISABLE="" - -SHOW_IP_PATTERN="^[ewr].*|^br.*|^lt.*|^umts.*" - -DATA_STORAGE=/userdisk/data -MEDIA_STORAGE=/userdisk/snail - -[[ -f /etc/default/motd ]] && . /etc/default/motd -for f in $MOTD_DISABLE; do - [[ $f == $THIS_SCRIPT ]] && exit 0 -done - -# don't edit below here -function display() -{ - # $1=name $2=value $3=red_limit $4=minimal_show_limit $5=unit $6=after $7=acs/desc{ - # battery red color is opposite, lower number - if [[ "$1" == "Battery" ]]; then - local great="<"; - else - local great=">"; - fi - if [[ -n "$2" && "$2" > "0" && (( "${2%.*}" -ge "$4" )) ]]; then - printf "%-14s%s" "$1:" - if awk "BEGIN{exit ! ($2 $great $3)}"; then - echo -ne "\e[0;91m $2"; - else - echo -ne "\e[0;92m $2"; - fi - printf "%-1s%s\x1B[0m" "$5" - printf "%-11s%s\t" "$6" - return 1 - fi -} # display - - -function get_ip_addresses() -{ - local ips=() - for f in /sys/class/net/*; do - local intf=$(basename $f) - # match only interface names starting with e (Ethernet), br (bridge), w (wireless), r (some Ralink drivers use ra<number> format) - if [[ $intf =~ $SHOW_IP_PATTERN ]]; then - local tmp=$(ip -4 addr show dev $intf | awk '/inet/ {print $2}' | cut -d'/' -f1) - # add both name and IP - can be informative but becomes ugly with long persistent/predictable device names - #[[ -n $tmp ]] && ips+=("$intf: $tmp") - # add IP only - [[ -n $tmp ]] && ips+=("$tmp") - fi - done - echo "${ips[@]}" -} # get_ip_addresses - - -function storage_info() -{ - # storage info - RootInfo=$(df -h /) - root_usage=$(awk '/\// {print $(NF-1)}' <<<${RootInfo} | sed 's/%//g') - root_total=$(awk '/\// {print $(NF-4)}' <<<${RootInfo}) - - StorageInfo=$(df -h $MEDIA_STORAGE 2>/dev/null | grep $MEDIA_STORAGE) - if [[ -n "${StorageInfo}" && ${RootInfo} != *$MEDIA_STORAGE* ]]; then - media_usage=$(awk '/\// {print $(NF-1)}' <<<${StorageInfo} | sed 's/%//g') - media_total=$(awk '/\// {print $(NF-4)}' <<<${StorageInfo}) - fi - - StorageInfo=$(df -h $DATA_STORAGE 2>/dev/null | grep $DATA_STORAGE) - if [[ -n "${StorageInfo}" && ${RootInfo} != *$DATA_STORAGE* ]]; then - data_usage=$(awk '/\// {print $(NF-1)}' <<<${StorageInfo} | sed 's/%//g') - data_total=$(awk '/\// {print $(NF-4)}' <<<${StorageInfo}) - fi -} # storage_info - -function get_data_storage() -{ - if which lsblk >/dev/null;then - root_name=$(lsblk -l -o NAME,MOUNTPOINT | awk '$2~/^\/$/ {print $1'}) - mmc_name=$(echo $root_name | awk '{print substr($1,1,length($1)-2);}') - if echo $mmc_name | grep mmcblk >/dev/null;then - DATA_STORAGE="/mnt/${mmc_name}p4" - fi - fi -} - -# query various systems and send some stuff to the background for overall faster execution. -# Works only with ambienttemp and batteryinfo since A20 is slow enough :) -ip_address=$(get_ip_addresses &) -get_data_storage -storage_info -critical_load=$(( 1 + $(grep -c processor /proc/cpuinfo) / 2 )) - -# get uptime, logged in users and load in one take -if [ -x /usr/bin/cpustat ];then - time=$(/usr/bin/cpustat -u) - load=$(/usr/bin/cpustat -l) -else - UptimeString=$(uptime | tr -d ',') - time=$(awk -F" " '{print $3" "$4}' <<<"${UptimeString}") - load="$(awk -F"average: " '{print $2}'<<<"${UptimeString}")" - case ${time} in - 1:*) # 1-2 hours - time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}") - ;; - *:*) # 2-24 hours - time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}") - ;; - *day) # days - days=$(awk -F" " '{print $3"天"}' <<<"${UptimeString}") - time=$(awk -F" " '{print $5}' <<<"${UptimeString}") - time="$days "$(awk -F":" '{print $1"小时 "$2"分钟"}' <<<"${time}") - ;; - esac -fi - -# memory and swap -mem_info=$(LC_ALL=C free -w 2>/dev/null | grep "^Mem" || LC_ALL=C free | grep "^Mem") -memory_usage=$(awk '{printf("%.0f",(($2-($4+$6))/$2) * 100)}' <<<${mem_info}) -memory_total=$(awk '{printf("%d",$2/1024)}' <<<${mem_info}) -swap_info=$(LC_ALL=C free -m | grep "^Swap") -swap_usage=$( (awk '/Swap/ { printf("%3.0f", $3/$2*100) }' <<<${swap_info} 2>/dev/null || echo 0) | tr -c -d '[:digit:]') -swap_total=$(awk '{print $(2)}' <<<${swap_info}) - -if grep -q "ipq40xx" "/etc/openwrt_release"; then - cpu_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" -else - cpu_temp="$(awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp)" -fi -cpu_tempx=`echo $cpu_temp | sed 's/°C//g'` - -if [ -x /usr/bin/cpustat ];then - sys_temp=$(/usr/bin/cpustat -A) -else - sys_temp=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) -fi -sys_tempx=`echo $sys_temp | sed 's/ / /g'` - -# display info - -machine_model=$(cat /proc/device-tree/model|tr -d "\000") -echo -e "设备信息: \033[93m${machine_model}\033[0m" -printf "CPU 型号: \x1B[93m%s\x1B[0m" "$sys_tempx" -echo "" -display "系统负载" "${load%% *}" "${critical_load}" "0" "" "${load#* }" -printf "运行时间: \x1B[92m%s\x1B[0m\t\t" "$time" -echo "" - -display "环境温度" "$cpu_tempx" "60" "0" "°C" "" -if [ -x /usr/bin/cpustat ];then - cpu_freq=$(/usr/bin/cpustat -F1500) - echo -n "当前频率: $cpu_freq" -else - display "当前频率" "$cpu_freq" "1500" "0" " Mhz" "" -fi -echo "" - -display "内存已用" "$memory_usage" "70" "0" "%" " of ${memory_total}MB" -printf "IP 地址: \x1B[92m%s\x1B[0m" "$ip_address" -#display "交换内存" "$swap_usage" "10" "0" "%" " of $swap_total""Mb" -echo "" - -#echo "" # fixed newline - -display "启动存储" "$boot_usage" "90" "1" "%" " of $boot_total" -display "系统存储" "$root_usage" "90" "1" "%" " of $root_total" -echo "" - -if [ "$data_usage" != "" ];then - display "数据存储" "$data_usage" "90" "1" "%" " of $data_total" - echo "" -fi -if [ "$media_usage" != "" ];then - display "媒体存储" "$media_usage" "90" "1" "%" " of $media_total" - echo "" -fi -echo "" - - diff --git a/docker/patches/99-custom.conf b/docker/patches/99-custom.conf deleted file mode 100644 index 4a68e0d7..00000000 --- a/docker/patches/99-custom.conf +++ /dev/null @@ -1,49 +0,0 @@ -# 内核网络参数调整 -###################################################### -# 默认值 (供参考) -# -# net.ipv4.tcp_fastopen = 1 -# net.core.netdev_max_backlog = 1000 -# net.core.rmem_default = 212992 -# net.core.wmem_default = 212992 -# net.core.rmem_max = 4194304 -# net.core.wmem_max = 1048576 -# net.ipv4.tcp_max_syn_backlog = 128 -# net.ipv4.tcp_rmem = 4096 131072 6291456 -# net.ipv4.tcp_wmem = 4096 16384 4194304 -# -###################################################### - -###################################################### -# 优化值(供参考) -net.ipv4.tcp_fastopen = 3 -net.core.netdev_max_backlog = 9000 -net.core.rmem_default = 67108864 -net.core.wmem_default = 67108864 -net.core.rmem_max = 104857600 -net.core.wmem_max = 104857600 -net.ipv4.tcp_max_syn_backlog = 1024 -net.ipv4.tcp_rmem = 10240 87380 67108864 -net.ipv4.tcp_wmem = 10240 87380 67108864 - -# default value: 8000 -net.core.netdev_budget_usecs = 16000 - -# default value: 300 -net.core.netdev_budget = 600 - -# default value: 64 -net.core.dev_weight = 128 - -# default value: 65535 -net.netfilter.nf_conntrack_max = 327680 - -# default value: 16384 -net.netfilter.nf_conntrack_buckets = 81920 - -# -####################################################### - -net.netfilter.nf_conntrack_tcp_no_window_check = 1 -# 系统最少保留内存 (default: 16384) -vm.min_free_kbytes = 32768 diff --git a/docker/patches/banner b/docker/patches/banner deleted file mode 100644 index 3407a1ec..00000000 --- a/docker/patches/banner +++ /dev/null @@ -1,9 +0,0 @@ -[35m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m -[35m\ ____ _ __ __ /[0m -[34m\ / __ \____ ___ ____| | / /____/ /_ /[0m -[36m\ / / / / __ \/ _ \/ __ \ | /| / / ___/ __/ /[0m -[32m\ / /_/ / /_/ / __/ / / / |/ |/ / / / /_ /[0m -[32m\ \____/ .___/\___/_/ /_/|__/|__/_/ \__/ /[0m -[33m\ /_/ W I R E L E S S F R E E D O M /[0m -[33m\ /[0m -[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m diff --git a/docker/patches/cbi_turboacc.patch b/docker/patches/cbi_turboacc.patch deleted file mode 100644 index c3c4e79c..00000000 --- a/docker/patches/cbi_turboacc.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/usr/lib/lua/luci/model/cbi/turboacc.lua -+++ b/usr/lib/lua/luci/model/cbi/turboacc.lua -@@ -10,7 +10,7 @@ s = m:section(TypedSection, "turboacc", - s.addremove = false - s.anonymous = true - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FLOWOFFLOAD.ko") then -+if luci.sys.call("modinfo xt_FLOWOFFLOAD >/dev/null") == 0 then - sw_flow = s:option(Flag, "sw_flow", translate("Software flow offloading")) - sw_flow.default = 0 - sw_flow.description = translate("Software based offloading for routing/NAT") -@@ -24,20 +24,20 @@ hw_flow.description = translate("Require - hw_flow:depends("sw_flow", 1) - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/shortcut-fe-cm.ko") then -+if luci.sys.call("modinfo shortcut-fe-cm >/dev/null") == 0 then - sfe_flow = s:option(Flag, "sfe_flow", translate("Shortcut-FE flow offloading")) - sfe_flow.default = 0 - sfe_flow.description = translate("Shortcut-FE based offloading for routing/NAT") - sfe_flow:depends("sw_flow", 0) - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/tcp_bbr.ko") then -+if luci.sys.call("modinfo tcp_bbr >/dev/null") == 0 then - bbr_cca = s:option(Flag, "bbr_cca", translate("BBR CCA")) - bbr_cca.default = 0 - bbr_cca.description = translate("Using BBR CCA can improve TCP network performance effectively") - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FULLCONENAT.ko") then -+if luci.sys.call("modinfo xt_FULLCONENAT >/dev/null") == 0 then - fullcone_nat = s:option(Flag, "fullcone_nat", translate("FullCone NAT")) - fullcone_nat.default = 0 - fullcone_nat.description = translate("Using FullCone NAT can improve gaming performance effectively") diff --git a/docker/patches/cbi_turboacc_new.patch b/docker/patches/cbi_turboacc_new.patch deleted file mode 100644 index e3b2d6b9..00000000 --- a/docker/patches/cbi_turboacc_new.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/usr/lib/lua/luci/model/cbi/turboacc.lua -+++ b/usr/lib/lua/luci/model/cbi/turboacc.lua -@@ -10,42 +10,42 @@ s = m:section(TypedSection, "turboacc", - s.addremove = false - s.anonymous = true - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FLOWOFFLOAD.ko") and not nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then -+if luci.sys.call("modinfo xt_FLOWOFFLOAD >/dev/null 2>&1") == 0 and luci.sys.call("modinfo mtkhnat >/dev/null") ~= 0 then - sw_flow = s:option(Flag, "sw_flow", translate("Software flow offloading")) - sw_flow.default = 0 - sw_flow.description = translate("Software based offloading for routing/NAT") --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then -+if luci.sys.call("modinfo mtkhnat >/dev/null 2>&1") == 0 then - sw_flow:depends("hw_flow", 0) - else - sw_flow:depends("sfe_flow", 0) - end - end - --if luci.sys.call("cat /etc/openwrt_release | grep -q mt762") == 0 and not nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then -+if luci.sys.call("cat /etc/openwrt_release | grep -q mt762") == 0 and luci.sys.call("modinfo mtkhnat >/dev/null 2>&1") ~= 0 then - hw_flow = s:option(Flag, "hw_flow", translate("Hardware flow offloading")) - hw_flow.default = 0 - hw_flow.description = translate("Requires hardware NAT support. Implemented at least for mt762x") --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then -+if luci.sys.call("modinfo mtkhnat >/dev/null 2>&1") == 0 then - hw_flow:depends("sw_flow", 0) - else - hw_flow:depends("sw_flow", 1) - end - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/shortcut-fe-cm.ko") or nixio.fs.access("/lib/modules/" .. kernel_version .. "/fast-classifier.ko") then -+if luci.sys.call("modinfo shortcut-fe-cm >/dev/null 2>&1") == 0 or luci.sys.call("modinfo fast-classifier >/dev/null 2>&1") == 0 then - sfe_flow = s:option(Flag, "sfe_flow", translate("Shortcut-FE flow offloading")) - sfe_flow.default = 0 - sfe_flow.description = translate("Shortcut-FE based offloading for routing/NAT") - sfe_flow:depends("sw_flow", 0) - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/tcp_bbr.ko") then -+if luci.sys.call("modinfo tcp_bbr >/dev/null 2>&1") == 0 then - bbr_cca = s:option(Flag, "bbr_cca", translate("BBR CCA")) - bbr_cca.default = 0 - bbr_cca.description = translate("Using BBR CCA can improve TCP network performance effectively") - end - --if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FULLCONENAT.ko") then -+if luci.sys.call("modinfo xt_FULLCONENAT >/dev/null 2>&1") == 0 then - fullcone_nat = s:option(Flag, "fullcone_nat", translate("FullCone NAT")) - fullcone_nat.default = 0 - fullcone_nat.description = translate("Using FullCone NAT can improve gaming performance effectively") diff --git a/docker/patches/coremark.sh b/docker/patches/coremark.sh deleted file mode 100644 index 545726f7..00000000 --- a/docker/patches/coremark.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -LOG=/etc/bench.log -echo "<div><table>" > $LOG - -GOV="/sys/devices/system/cpu/cpufreq/policy0/scaling_governor" -if [ -f "$GOV" ];then - CURRENT_GOVERNOR=$(cat $GOV) - GOV_FLAG=1 -else - GOV_FLAG=0 -fi - -trap "echo killed;test $GOV_FLAG -eq 1 && echo ${CURRENT_GOVERNOR} > ${GOV} 2>/dev/null;echo '</table></div>' >> $LOG;rm -f /tmp/*.score;exit" 1 2 3 9 15 - -GOV_HOME='/sys/devices/system/cpu/cpufreq/' -govs=() -if [ $GOV_FLAG -eq 1 ];then - POLICIES=$(cd $GOV_HOME && ls -d policy*) - i=1 - for POLICY in $POLICIES;do - CUR_GOV="${GOV_HOME}/${POLICY}/scaling_governor" - govs[$i]=$(cat $CUR_GOV) - echo "performance" > ${CUR_GOV} 2>/dev/null - i=$((i+1)) - done -fi - -echo "testing coremark ... " -sleep 1 -COREMARK=$(/bin/coremark | tail -n 1 | awk '{print $4}') -# 分数取整 -#COREMARK=${COREMARK%.*} -echo "CPU CoreMark : $COREMARK" -echo "<tr><td width=\"38%\">CPU CoreMark</td><td>$COREMARK</td></tr>" >> $LOG - -if [ -x /usr/bin/openssl ];then - CORES=$(grep processor /proc/cpuinfo | wc -l) - - PROJS="aes-128-gcm aes-256-gcm chacha20-poly1305" - for P in $PROJS;do - echo "testing $P ..." - sleep 1 - /usr/bin/openssl speed -multi $CORES -evp $P 1>/tmp/${P}.score 2>/dev/null || echo "NA" >/tmp/${P}.score - S=$(tail -n 1 /tmp/${P}.score | awk '{print $5}') - echo "${P}(1K) : ${S}" - echo "<tr><td>${P}(1K)</td><td>$S</td></tr>" >> $LOG - rm -f /tmp/${P}.score - done - -fi - -echo "</table></div>" >> $LOG - -if [ $GOV_FLAG -eq 1 ];then - i=1 - for POLICY in $POLICIES;do - CUR_GOV="${GOV_HOME}/${POLICY}/scaling_governor" - echo "${govs[$i]}" > ${CUR_GOV} 2>/dev/null - i=$((i+1)) - done -fi - -if [ -f "$LOG" ]; then - sed -i '/coremark/d' /etc/crontabs/root - crontab /etc/crontabs/root -fi diff --git a/docker/patches/cpustat b/docker/patches/cpustat deleted file mode 100644 index bb2bc0fa..00000000 --- a/docker/patches/cpustat +++ /dev/null @@ -1,386 +0,0 @@ -#!/usr/bin/env perl -use strict; -use utf8; -use Config; -use Time::HiRes qw /usleep/; -binmode(STDOUT, ":utf8"); - -sub get_soc_temp { - my $t=shift; - my @fnames=( - '/sys/devices/virtual/thermal/thermal_zone0/temp', - '/sys/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/temp1_input', - ); - my $temp = "Unknown"; - for my $fname (@fnames) { - if( -f $fname ) { - open my $fh, "<", $fname; - if($t) { - $temp = sprintf "%0.1f", <$fh> / 1000; - } else { - $temp = sprintf "%0.1f℃", <$fh> / 1000; - } - close $fh; - return $temp; - } - } - - return $temp; -} - -sub get_cpu_freq { - my $f=shift; - my @fnames=</sys/devices/system/cpu/cpufreq/policy?/cpuinfo_cur_freq>; - my $freq_str = ""; - for (my $i=0; $i < $#fnames + 1; $i++) { - my $fname = $fnames[$i]; - open my $fh, "<", $fname; - usleep(50000); - my $freq; - if($f =~ /-F(\d*)/) { - my $alert_mhz = 1500; - if($1 ne "") { - $alert_mhz = $1; - } - my $color = "\x1b[92m"; - $freq = <$fh> / 1000; - if($freq > $alert_mhz) { - $color = "\x1b[91m"; - } - $freq = sprintf "%s%d Mhz\x1b[0m", $color, $freq; - } else { - $freq = sprintf "%dMhz", <$fh> / 1000; - } - close $fh; - $freq_str .= $freq; - if($i < $#fnames) { - $freq_str .= " & "; - } - } - - if($#fnames > 0 && $f eq "") { - $freq_str = "(" . $freq_str . ")"; - } - - if($freq_str eq "") { - $freq_str = "Unknown"; - } - return $freq_str; -} - -sub get_arch_info { - my $a=shift; - my @cpus = </sys/devices/system/cpu/cpu?>; - my @cpu_groups; - my %group_core_count; - for my $cpu (@cpus) { - open my $fh, "<", "${cpu}/uevent"; - while(<$fh>) { - chomp; - my($key,$value) = split /=/; - if($key eq "OF_COMPATIBLE_0") { - my($cortex, $a) = split /-/, (split /,/, $value)[1]; - my $core_type_name = ucfirst($cortex) . "-" . ucfirst($a); - if(not exists $group_core_count{$core_type_name}) { - push @cpu_groups, $core_type_name; - $group_core_count{$core_type_name} = 0; - } - $group_core_count{$core_type_name} += 1; - } - } - close $fh; - } - - my $arch_info; - if($a) { - $arch_info = "AArch64 : " if ($a); - } else { - $arch_info = "AArch64 Processor : "; - } - for (my $i = 0; $i < $#cpu_groups + 1; $i++) { - my $group = $cpu_groups[$i]; - #if($i == 0) { - # $arch_info .= ""; - #} - $arch_info .= $group; - if($a) { - $arch_info .= " x "; - } else { - $arch_info .= " * "; - } - $arch_info .= $group_core_count{$group}; - if($i < $#cpu_groups) { - $arch_info .= " & "; - } #else { - # $arch_info .= ""; - #} - } - - return "$arch_info"; -} - -sub get_uptime { - my $fh; - my $result; - open $fh, "<", "/proc/uptime" or die; - my $str_uptime = <$fh>; - if($str_uptime =~ /(\d*)/) { - my $day = int($1/86400); - my $hour = int(($1%86400)/3600); - my $min = int(($1%3600)/60); - my $sec = $1%60; - - my $sday = $day . "天 " if($day>0); - my $shour = $hour . "小时 " if($hour>0 || $day>0) ; - my $smin = $min . "分钟 "; - my $ssec = $sec . "秒"; - $result .= $sday . $shour . $smin . $ssec; - } - close $fh; - return $result; -} - -sub get_avgload { - my $fh; - my $result; - open $fh, "<", "/proc/loadavg" or die; - my $str = <$fh>; - $result = join(' ', (split(/\s+/, $str))[0,1,2]); - close $fh; - return $result; -} - -sub get_eth_name { - my $eth = shift; - return (split /\//, $eth)[-1]; -} - -sub get_eth_operstate { - my $eth = shift; - my $fh; - open $fh, "<", "$eth/operstate" or warn $!; - my $operstate = <$fh>; - close $fh; - $operstate =~ s/\n//; - return $operstate; -} - -sub get_eth_driver { - my $eth = shift; - my $fh; - open $fh, "<", "$eth/device/uevent" or warn $!; - my $driver; - while(<$fh>) { - chomp; - if(/^DRIVER=/) { - $driver = (split /=/, $_)[-1]; - last; - } - } - close $fh; - return $driver; -} - -sub get_eth_duplex { - my $eth = shift; - my $fh; - open $fh, "<", "$eth/duplex" or warn $!; - my $duplex = <$fh>; - close $fh; - $duplex =~ s/\n//; - return $duplex; -} - -sub get_eth_speed { - my $eth = shift; - my $fh; - open $fh, "<", "$eth/speed" or warn $!; - my $speed = <$fh>; - close $fh; - $speed =~ s/\n//; - if($speed == -1) { - my $driver = &get_eth_driver("$eth"); - if($driver eq "virtio_net") { - $speed = "Maximum"; - } else { - $speed = ""; - } - } elsif($speed <= 100) { - $speed .= "Mb/s"; - } else { - $speed = sprintf "%.1fGb/s", $speed / 1000; - } - $speed =~ s/\.0//; - return $speed; -} - -sub get_eth_temperature { - my($driver, $eth_name) = @_; - my $ret = ""; - return $ret if (! -d "/proc/net/r8125/$eth_name"); - if($driver eq 'r8125') { - my $fh; - open $fh, "<", "/proc/net/r8125/$eth_name/temp" or die $!; - while(<$fh>) { - chomp; - if(/^Cel:/) { - $ret = (split /:/, $_)[-1]."℃"; - last; - } - } - close $fh; - } - return $ret; -} - -sub get_ethlist() { - my $board = &get_boardinfo; - if($board eq "FastRhino R66S") { - return reverse sort (</sys/class/net/e[tn]*>); - } elsif($board =~ m/NLnet Watermelon Pi/i) { - return reverse sort (</sys/class/net/e[tn]*>); - } else { - return sort (</sys/class/net/e[tn]*>); - } -} - -sub get_ethcount() { - my @eth_ary = &get_ethlist; - return $#eth_ary + 1; -} - -sub get_ethinfo { - my @eth_ary = &get_ethlist; - my $ret = "[\n"; - for (my $i = 0; $i <= $#eth_ary; $i++) { - $ret .= " {\n"; - my $eth_name = &get_eth_name($eth_ary[$i]); - my $driver = &get_eth_driver($eth_ary[$i]); - my $operstate = &get_eth_operstate($eth_ary[$i]) eq "up" ? 1 : 0; - my $speed = &get_eth_speed($eth_ary[$i]); - my $duplex = &get_eth_duplex($eth_ary[$i]); - my $temperature = &get_eth_temperature($driver, $eth_name); - if($temperature eq "") { - $temperature = "☰"; - } - - if(($duplex eq "unknown")) { - if(($driver eq "virtio_net") && ($operstate == 1)) { - $duplex = "full"; - } - } - - if($operstate == 1) { - $speed .= " $duplex duplex"; - } else { - $speed = "☷"; - } - - $ret .= qq| "name": "| . $eth_name . qq|",\n|; - $ret .= qq| "driver": "| . $driver . qq|",\n|; - $ret .= qq| "temperature": "| . $temperature . qq|",\n|; - $ret .= qq| "operstate": | . $operstate . ",\n"; - $ret .= qq| "speed": "| . $speed . qq|"\n|; - if($i < $#eth_ary) { - $ret .= " },\n"; - } else { - $ret .= " }\n"; - } - } - $ret .= "]"; - return $ret; -} - -sub get_archname() { - return $Config{archname}; -} - -sub get_boardinfo() { - my $ret="unknown"; - my $arch=&get_archname; - if($arch =~ /^aarch64/) { - if(-f "/proc/device-tree/model") { - open my $fh, "<", "/proc/device-tree/model" or warn $!; - read $fh, $ret, 100; - close $fh; - $ret =~ s/\0//; - } elsif(-d "/sys/firmware/qemu_fw_cfg") { - $ret = "QEMU KVM Virtual Machine"; - } - } elsif($arch =~ /^x86/) { - open my $fh, "<", "/proc/cpuinfo" or warn $!; - while(<$fh>) { - chomp; - if(/^model name/) { - $ret = (split /:/, $_)[-1]; - $ret =~ s/\A\s+//; - } - } - } - return $ret; -} - -sub get_dc_voltage() { - my $precision = shift; - my $board = &get_boardinfo; - my $up_res = 0; - my $down_res = 0; - my $iio_channel; - my $ret = 0; - my $fh; - if($board =~ m/Radxa ROCK 5B/) { - $up_res = 100; - $down_res = 8.2; - $iio_channel = 6; - $ret = "(Probably) 12"; - } - - if($up_res && $down_res) { - my $voltage_raw = 0; - my $voltage_scale = 0; - open $fh, "<", "/sys/bus/iio/devices/iio:device0/in_voltage_scale" or die; - read $fh, $voltage_scale, 40; - close $fh; - - open $fh, "<", "/sys/bus/iio/devices/iio:device0/in_voltage${iio_channel}_raw" or die; - read $fh, $voltage_raw, 40; - close $fh; - - if($voltage_raw && $voltage_scale && (($voltage_raw + 1) * $voltage_scale < 1800)) { - $precision = 0 unless $precision; - my $fmt = "%0.${precision}f"; - $ret = sprintf $fmt, $voltage_raw * $voltage_scale * ($up_res + $down_res) / $down_res / 1000.0; - } - } - return $ret; -} - -##### main program ##### -my $argc = scalar( @ARGV ); -if($argc == 0) { - print &get_cpu_freq, " / ", &get_soc_temp, "\n"; -} elsif($ARGV[0] eq "-a") { - print &get_arch_info, "\n"; -} elsif($ARGV[0] eq "-A") { - print &get_arch_info("A"), "\n"; -} elsif($ARGV[0] eq "-t") { - print &get_soc_temp, "\n"; -} elsif($ARGV[0] eq "-T") { - print &get_soc_temp("T"), "\n"; -} elsif($ARGV[0] eq "-f") { - print &get_cpu_freq, "\n"; -} elsif($ARGV[0] =~ /-F/) { - print &get_cpu_freq($ARGV[0]), "\n"; -} elsif($ARGV[0] eq "-u") { - print &get_uptime, "\n"; -} elsif($ARGV[0] eq "-l") { - print &get_avgload, "\n"; -} elsif($ARGV[0] eq "-e") { - print &get_ethinfo, "\n"; -} elsif($ARGV[0] eq "-ec") { - print &get_ethcount, "\n"; -} elsif($ARGV[0] eq "-b") { - print &get_boardinfo, "\n"; -} elsif($ARGV[0] =~ m/-V(\d{0,1})/) { - print &get_dc_voltage($1), "\n"; -} diff --git a/docker/patches/getcpu b/docker/patches/getcpu deleted file mode 100644 index 1480f8b1..00000000 --- a/docker/patches/getcpu +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env perl -#use strict; - -sub get_stat { - open IN, "<", "/proc/stat"; - $_ = <IN>; - chomp; - close(IN); - my ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq, $steal, $guest, $guest_nice) = split; - my $Idle = $idle + $iowait; - my $Non_Idle = $user + $nice + $system + $irq + $softirq + $steal + $guest + $guest_nice; - return ($Idle, $Non_Idle); -} - -my($prev_idle, $prev_non_idle) = &get_stat; -my $prev_total = $prev_idle + $prev_non_idle; -sleep(3); -my($idle, $non_idle) = &get_stat; -my $total = $idle + $non_idle; - -my $totald = $total - $prev_total; -my $idled = $idle - $prev_idle; -my $cpu_percentage = ($totald - $idled) / $totald * 100; - -$| = 1; -open OUT, ">", "/tmp/cpuusage"; -printf OUT "%0.1f\%", $cpu_percentage; -close(OUT); - -exit(0); diff --git a/docker/patches/index.html.patches/index.htm b/docker/patches/index.html.patches/index.htm deleted file mode 100644 index 5079a960..00000000 --- a/docker/patches/index.html.patches/index.htm +++ /dev/null @@ -1,863 +0,0 @@ -<%# - Copyright 2008 Steven Barth <steven@midlink.org> - Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org> - Licensed to the public under the Apache License 2.0. --%> - -<% - local fs = require "nixio.fs" - local util = require "luci.util" - local stat = require "luci.tools.status" - local ver = require "luci.version" - local uci = require("luci.model.uci").cursor() - - local has_ipv6 = fs.access("/usr/sbin/ip6tables") - local has_dhcp = fs.access("/etc/config/dhcp") - local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) - local has_switch = false - - uci:foreach("network", "switch", - function(s) - has_switch = true - return false - end) - - local sysinfo = luci.util.ubus("system", "info") or { } - local boardinfo = luci.util.ubus("system", "board") or { } - local unameinfo = nixio.uname() or { } - - local meminfo = sysinfo.memory or { - total = 0, - free = 0, - buffered = 0, - shared = 0 - } - - local mem_cached = luci.sys.exec("sed -e '/^Cached: /!d; s#Cached: *##; s# kB##g' /proc/meminfo") - - local swapinfo = sysinfo.swap or { - total = 0, - free = 0 - } - - local has_dsl = fs.access("/etc/init.d/dsl_control") - - if luci.http.formvalue("status") == "1" then - local ntm = require "luci.model.network".init() - local wan = ntm:get_wannet() - local wan6 = ntm:get_wan6net() - - local conn_count = tonumber( - fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 - - local conn_max = tonumber(luci.sys.exec( - "sysctl -n -e net.netfilter.nf_conntrack_max net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max | head -n 1"):match("%d+")) or 4096 - - local user_info = luci.sys.exec("cat /proc/net/arp | grep -E 'br-lan|eth0' | grep '0x2' | wc -l") - - local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%" - local cpu_stat = luci.sys.exec("/usr/bin/cpustat 2>/dev/null") or { } - local eth_info = luci.sys.exec("/usr/bin/cpustat -e 2>/dev/null") - local eth_cnt = luci.sys.exec("/usr/bin/cpustat -ec 2>/dev/null") - - local rv = { - cpuusage = cpu_usage, - userinfo = user_info, - uptime = sysinfo.uptime or 0, - localtime = os.date(), - loadavg = sysinfo.load or { 0, 0, 0 }, - memory = meminfo, - memcached = mem_cached, - swap = swapinfo, - ethinfo = eth_info, - ethcount = eth_cnt, - connmax = conn_max, - conncount = conn_count, - leases = stat.dhcp_leases(), - leases6 = stat.dhcp6_leases(), - wifinets = stat.wifi_networks(), - cpustat = cpu_stat - } - - if wan then - rv.wan = { - ipaddr = wan:ipaddr(), - gwaddr = wan:gwaddr(), - netmask = wan:netmask(), - dns = wan:dnsaddrs(), - expires = wan:expires(), - uptime = wan:uptime(), - proto = wan:proto(), - ifname = wan:ifname(), - link = wan:adminlink() - } - end - - if wan6 then - rv.wan6 = { - ip6addr = wan6:ip6addr(), - gw6addr = wan6:gw6addr(), - dns = wan6:dns6addrs(), - ip6prefix = wan6:ip6prefix(), - uptime = wan6:uptime(), - proto = wan6:proto(), - ifname = wan6:ifname(), - link = wan6:adminlink() - } - end - - if has_dsl then - local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat") - local dsl_func = loadstring(dsl_stat) - if dsl_func then - rv.dsl = dsl_func() - end - end - - luci.http.prepare_content("application/json") - luci.http.write_json(rv) - - return - elseif luci.http.formvalue("hosts") == "1" then - luci.http.prepare_content("application/json") - luci.http.write_json(luci.sys.net.host_hints()) - - return - end --%> - -<%+header%> - -<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-23.104.57901-bf5e9ad"></script> -<script type="text/javascript">//<![CDATA[ - function progressbar(v, m) - { - var vn = parseInt(v) || 0; - var mn = parseInt(m) || 100; - var pc = Math.floor((100 / mn) * vn); - - return String.format( - '<div style="width:200px; position:relative; border:1px solid #999999">' + - '<div style="background-color:#CCCCCC; width:%d%%; height:15px">' + - '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' + - '<small>%s / %s (%d%%)</small>' + - '</div>' + - '</div>' + - '</div>', pc, v, m, pc - ); - } - - function wifirate(bss, rx) { - var p = rx ? 'rx_' : 'tx_', - s = '%.1f <%:Mbit/s%>, %d<%:MHz%>' - .format(bss[p+'rate'] / 1000, bss[p+'mhz']), - ht = bss[p+'ht'], vht = bss[p+'vht'], - mhz = bss[p+'mhz'], nss = bss[p+'nss'], - mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'], - he = bss[p+'he'], he_gi = bss[p+'he_gi'], - he_dcm = bss[p+'he_dcm']; - - if (ht || vht) { - if (vht) s += ', VHT-MCS %d'.format(mcs); - if (nss) s += ', VHT-NSS %d'.format(nss); - if (ht) s += ', MCS %s'.format(mcs); - if (sgi) s += ', <%:Short GI%>'; - } - - if (he) { - s += ', HE-MCS %d'.format(mcs); - if (nss) s += ', HE-NSS %d'.format(nss); - if (he_gi) s += ', HE-GI %d'.format(he_gi); - if (he_dcm) s += ', HE-DCM %d'.format(he_dcm); - } - - return s; - } - - function duid2mac(duid) { - // DUID-LLT / Ethernet - if (duid.length === 28 && duid.substr(0, 8) === '00010001') - return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - // DUID-LL / Ethernet - if (duid.length === 20 && duid.substr(0, 8) === '00030001') - return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - return null; - } - - var npoll = 1; - var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>; - - function updateHosts() { - XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) { - hosts = data; - }); - } - - XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 }, - function(x, info) - { - if (!(npoll++ % 5)) - updateHosts(); - - var si = document.getElementById('wan4_i'); - var ss = document.getElementById('wan4_s'); - var ifc = info.wan; - - if (ifc && ifc.ifname && ifc.proto != 'none') - { - var s = String.format( - '<strong><%:Type%>: </strong>%s<br />' + - '<strong><%:Address%>: </strong>%s<br />' + - '<strong><%:Netmask%>: </strong>%s<br />' + - '<strong><%:Gateway%>: </strong>%s<br />', - ifc.proto, - (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0', - (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255', - (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0' - ); - - for (var i = 0; i < ifc.dns.length; i++) - { - s += String.format( - '<strong><%:DNS%> %d: </strong>%s<br />', - i + 1, ifc.dns[i] - ); - } - - if (ifc.expires > -1) - { - s += String.format( - '<strong><%:Expires%>: </strong>%t<br />', - ifc.expires - ); - } - - if (ifc.uptime > 0) - { - s += String.format( - '<strong><%:Connected%>: </strong>%t<br />', - ifc.uptime - ); - } - - ss.innerHTML = String.format('<small>%s</small>', s); - si.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small><a href="%s">%s</a></small>', - ifc.link, ifc.ifname - ); - } - else - { - si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>'; - ss.innerHTML = '<em><%:Not connected%></em>'; - } - - <% if has_ipv6 then %> - var si6 = document.getElementById('wan6_i'); - var ss6 = document.getElementById('wan6_s'); - var ifc6 = info.wan6; - - if (ifc6 && ifc6.ifname && ifc6.proto != 'none') - { - var s = String.format( - '<strong><%:Type%>: </strong>%s%s<br />', - ifc6.proto, (ifc6.ip6prefix) ? '-pd' : '' - ); - - if (!ifc6.ip6prefix) - { - s += String.format( - '<strong><%:Address%>: </strong>%s<br />', - (ifc6.ip6addr) ? ifc6.ip6addr : '::' - ); - } - else - { - s += String.format( - '<strong><%:Prefix Delegated%>: </strong>%s<br />', - ifc6.ip6prefix - ); - if (ifc6.ip6addr) - { - s += String.format( - '<strong><%:Address%>: </strong>%s<br />', - ifc6.ip6addr - ); - } - } - - s += String.format( - '<strong><%:Gateway%>: </strong>%s<br />', - (ifc6.gw6addr) ? ifc6.gw6addr : '::' - ); - - for (var i = 0; i < ifc6.dns.length; i++) - { - s += String.format( - '<strong><%:DNS%> %d: </strong>%s<br />', - i + 1, ifc6.dns[i] - ); - } - - if (ifc6.uptime > 0) - { - s += String.format( - '<strong><%:Connected%>: </strong>%t<br />', - ifc6.uptime - ); - } - - ss6.innerHTML = String.format('<small>%s</small>', s); - si6.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small><a href="%s">%s</a></small>', - ifc6.link, ifc6.ifname - ); - } - else - { - si6.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>'; - ss6.innerHTML = '<em><%:Not connected%></em>'; - } - <% end %> - - <% if has_dsl then %> - var dsl_i = document.getElementById('dsl_i'); - var dsl_s = document.getElementById('dsl_s'); - - var s = String.format( - '<strong><%:Status%>: </strong>%s<br />' + - '<strong><%:Line State%>: </strong>%s [0x%x]<br />' + - '<strong><%:Line Mode%>: </strong>%s<br />' + - '<strong><%:Annex%>: </strong>%s<br />' + - '<strong><%:Profile%>: </strong>%s<br />' + - '<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' + - '<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' + - '<strong><%:Latency%>: </strong>%s / %s<br />' + - '<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' + - '<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' + - '<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' + - '<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' + - '<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' + - '<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' + - '<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' + - '<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' + - '<strong><%:Line Uptime%>: </strong>%s<br />' + - '<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' + - '<strong><%:Power Management Mode%>: </strong>%s<br />', - info.dsl.line_state, info.dsl.line_state_detail, - info.dsl.line_state_num, - info.dsl.line_mode_s, - info.dsl.annex_s, - info.dsl.profile_s, - info.dsl.data_rate_down_s, info.dsl.data_rate_up_s, - info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s, - info.dsl.latency_num_down, info.dsl.latency_num_up, - info.dsl.line_attenuation_down, info.dsl.line_attenuation_up, - info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up, - info.dsl.noise_margin_down, info.dsl.noise_margin_up, - info.dsl.actatp_down, info.dsl.actatp_up, - info.dsl.errors_fec_near, info.dsl.errors_fec_far, - info.dsl.errors_es_near, info.dsl.errors_es_far, - info.dsl.errors_ses_near, info.dsl.errors_ses_far, - info.dsl.errors_loss_near, info.dsl.errors_loss_far, - info.dsl.errors_uas_near, info.dsl.errors_uas_far, - info.dsl.errors_hec_near, info.dsl.errors_hec_far, - info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far, - info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far, - info.dsl.line_uptime_s, - info.dsl.atuc_vendor_id, - info.dsl.power_mode_s - ); - - dsl_s.innerHTML = String.format('<small>%s</small>', s); - dsl_i.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small>DSL</small>' - ); - <% end %> - - <% if has_dhcp then %> - var ls = document.getElementById('lease_status_table'); - if (ls) - { - /* clear all rows */ - while( ls.rows.length > 1 ) - ls.rows[0].parentNode.deleteRow(1); - - for( var i = 0; i < info.leases.length; i++ ) - { - var timestr; - - if (info.leases[i].expires === false) - timestr = '<em><%:unlimited%></em>'; - else if (info.leases[i].expires <= 0) - timestr = '<em><%:expired%></em>'; - else - timestr = String.format('%t', info.leases[i].expires); - - var tr = ls.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); - - tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?'; - tr.insertCell(-1).innerHTML = info.leases[i].ipaddr; - tr.insertCell(-1).innerHTML = info.leases[i].macaddr; - tr.insertCell(-1).innerHTML = timestr; - } - - if( ls.rows.length == 1 ) - { - var tr = ls.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 4; - td.innerHTML = '<em><br /><%:There are no active leases.%></em>'; - } - } - - var ls6 = document.getElementById('lease6_status_table'); - if (ls6 && info.leases6) - { - ls6.parentNode.style.display = 'block'; - - /* clear all rows */ - while( ls6.rows.length > 1 ) - ls6.rows[0].parentNode.deleteRow(1); - - for( var i = 0; i < info.leases6.length; i++ ) - { - var timestr; - - if (info.leases6[i].expires === false) - timestr = '<em><%:unlimited%></em>'; - else if (info.leases6[i].expires <= 0) - timestr = '<em><%:expired%></em>'; - else - timestr = String.format('%t', info.leases6[i].expires); - - var tr = ls6.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); - - var host = hosts[duid2mac(info.leases6[i].duid)]; - if (!info.leases6[i].hostname) - tr.insertCell(-1).innerHTML = - (host && (host.name || host.ipv4 || host.ipv6)) - ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6) - : '?'; - else - tr.insertCell(-1).innerHTML = - (host && host.name && info.leases6[i].hostname != host.name) - ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name) - : info.leases6[i].hostname; - - tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr; - tr.insertCell(-1).innerHTML = info.leases6[i].duid; - tr.insertCell(-1).innerHTML = timestr; - } - - if( ls6.rows.length == 1 ) - { - var tr = ls6.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 4; - td.innerHTML = '<em><br /><%:There are no active leases.%></em>'; - } - } - <% end %> - - <% if has_wifi then %> - var assoclist = [ ]; - - var ws = document.getElementById('wifi_status_table'); - if (ws) - { - var wsbody = ws.rows[0].parentNode; - while (ws.rows.length > 0) - wsbody.deleteRow(0); - - for (var didx = 0; didx < info.wifinets.length; didx++) - { - var dev = info.wifinets[didx]; - - var tr = wsbody.insertRow(-1); - var td; - - td = tr.insertCell(-1); - td.width = "33%"; - td.innerHTML = dev.name; - td.style.verticalAlign = "top"; - - td = tr.insertCell(-1); - - var s = ''; - - for (var nidx = 0; nidx < dev.networks.length; nidx++) - { - var net = dev.networks[nidx]; - var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled); - - var icon; - if (!is_assoc) - icon = "<%=resource%>/icons/signal-none.png"; - else if (net.quality == 0) - icon = "<%=resource%>/icons/signal-0.png"; - else if (net.quality < 25) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (net.quality < 50) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (net.quality < 75) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - s += String.format( - '<table><tr><td style="text-align:center; width:32px; padding:3px">' + - '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" />' + - '<br /><small>%d%%</small>' + - '</td><td style="text-align:left; padding:3px"><small>' + - '<strong><%:SSID%>:</strong> <a href="%s">%h</a><br />' + - '<strong><%:Mode%>:</strong> %s<br />' + - '<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' + - '<strong><%:Bitrate%>:</strong> %s <%:Mbit/s%><br />', - icon, net.signal, net.noise, - net.quality, - net.link, net.ssid || '?', - net.mode, - net.channel, net.frequency, - net.bitrate || '?' - ); - - if (is_assoc) - { - s += String.format( - '<strong><%:BSSID%>:</strong> %s<br />' + - '<strong><%:Encryption%>:</strong> %s', - net.bssid || '?', - net.encryption - ); - } - else - { - s += '<em><%:Wireless is disabled or not associated%></em>'; - } - - s += '</small></td></tr></table>'; - - for (var bssid in net.assoclist) - { - var bss = net.assoclist[bssid]; - - bss.bssid = bssid; - bss.link = net.link; - bss.name = net.name; - bss.ifname = net.ifname; - bss.radio = dev.name; - - assoclist.push(bss); - } - } - - if (!s) - s = '<em><%:No information available%></em>'; - - td.innerHTML = s; - } - } - - var ac = document.getElementById('wifi_assoc_table'); - if (ac) - { - /* clear all rows */ - while( ac.rows.length > 1 ) - ac.rows[0].parentNode.deleteRow(1); - - assoclist.sort(function(a, b) { - return (a.name == b.name) - ? (a.bssid < b.bssid) - : (a.name > b.name ) - ; - }); - - for( var i = 0; i < assoclist.length; i++ ) - { - var tr = ac.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + (1 + (i % 2)); - - var icon; - var q = (-1 * (assoclist[i].noise - assoclist[i].signal)) / 5; - if (q < 1) - icon = "<%=resource%>/icons/signal-0.png"; - else if (q < 2) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (q < 3) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (q < 4) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - tr.insertCell(-1).innerHTML = String.format( - '<span class="ifacebadge" title="%q"><img src="<%=resource%>/icons/wifi.png" /> %h</span>', - assoclist[i].radio, assoclist[i].ifname - ); - - tr.insertCell(-1).innerHTML = String.format( - '<a href="%s">%s</a>', - assoclist[i].link, - '%h'.format(assoclist[i].name).nobr() - ); - - tr.insertCell(-1).innerHTML = assoclist[i].bssid; - - var host = hosts[assoclist[i].bssid]; - if (host) - tr.insertCell(-1).innerHTML = String.format( - '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>', - ((host.name && (host.ipv4 || host.ipv6)) - ? '%h (%s)'.format(host.name, host.ipv4 || host.ipv6) - : '%h'.format(host.name || host.ipv4 || host.ipv6)).nobr() - ); - else - tr.insertCell(-1).innerHTML = '?'; - - tr.insertCell(-1).innerHTML = String.format( - '<span class="ifacebadge" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%> / <%:SNR%>: %d"><img src="%s" /> %d / %d <%:dBm%></span>', - assoclist[i].signal, assoclist[i].noise, assoclist[i].signal - assoclist[i].noise, - icon, - assoclist[i].signal, assoclist[i].noise - ); - - tr.insertCell(-1).innerHTML = wifirate(assoclist[i], true).nobr() + '<br />' + wifirate(assoclist[i], false).nobr(); - } - - if (ac.rows.length == 1) - { - var tr = ac.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 7; - td.innerHTML = '<br /><em><%:No information available%></em>'; - } - } - <% end %> - - var e; - - if (e = document.getElementById('ethinfo')) { - var ports = eval('(' + info.ethinfo + ')'); - var avg_width = info.ethcount ? 100 / info.ethcount : 100; - var tmp = ""; - for (var i in ports) - { - tmp = tmp + String.format( - '<td style="text-align:center" width="%d%%"><span style="line-height:25px">%s</span><br /><small><img src="<%=resource%>/icons/%s" /><br />%s<br />%s<br />%s</small></td>', - avg_width, - ports[i].name, - ports[i].operstate ? 'port_up.png' : 'port_down.png', - ports[i].driver, - ports[i].speed, - ports[i].temperature); - }; - e.innerHTML = "<tr>" + tmp + "</tr>"; - } - - if (e = document.getElementById('localtime')) - e.innerHTML = info.localtime; - - if (e = document.getElementById('cpustat')) - e.innerHTML = info.cpustat; - - if (e = document.getElementById('uptime')) - e.innerHTML = String.format('%t', info.uptime); - - if (e = document.getElementById('userinfo')) - e.innerHTML = info.userinfo; - - if (e = document.getElementById('cpuusage')) - e.innerHTML = info.cpuusage; - - if (e = document.getElementById('loadavg')) - e.innerHTML = String.format( - '%.02f, %.02f, %.02f', - info.loadavg[0] / 65535.0, - info.loadavg[1] / 65535.0, - info.loadavg[2] / 65535.0 - ); - - if (e = document.getElementById('memtotal')) - e.innerHTML = progressbar( - Math.floor(((info.memory.free + info.memory.buffered) / 1048576) + (info.memcached / 1024)) + " <%:MB%>", - Math.floor(info.memory.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('membuff')) - e.innerHTML = progressbar( - Math.floor(info.memory.buffered / 1048576) + " <%:MB%>", - Math.floor(info.memory.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('swaptotal')) - e.innerHTML = progressbar( - Math.floor(info.swap.free / 1048576) + " <%:MB%>", - Math.floor(info.swap.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('swapfree')) - e.innerHTML = progressbar( - Math.floor(info.swap.free / 1048576) + " <%:MB%>", - Math.floor(info.swap.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('conns')) - e.innerHTML = progressbar(info.conncount, info.connmax); - - } - ); -//]]></script> - -<h2 name="content"><%:Status%></h2> - -<fieldset class="cbi-section"> - <legend><%:System%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr> - <tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or " "%></td></tr> - <tr><td width="33%"><%:Architecture%></td><td><%=luci.sys.exec("/usr/bin/cpustat -a 2>/dev/null")%></td></tr> - <tr><td width="33%"><%:Firmware Version%></td><td> - <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> / - <%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>) - </td></tr> - <tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr> - <tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr> - <tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr> - <tr><td width="33%"><%:CPU状态%></td><td id="cpustat">-</td></tr> - <tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr> - <tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr> - </table> -</fieldset> - -<fieldset class="cbi-section"> - <legend><%:Memory%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Total Available%></td><td id="memtotal">-</td></tr> - <tr><td width="33%"><%:Buffered%></td><td id="membuff">-</td></tr> - </table> -</fieldset> - -<% if swapinfo.total > 0 then %> -<fieldset class="cbi-section"> - <legend><%:Swap%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Total Available%></td><td id="swaptotal">-</td></tr> - <tr><td width="33%"><%:Free%></td><td id="swapfree">-</td></tr> - </table> -</fieldset> -<% end %> - -<% if not has_switch then %> -<fieldset class="cbi-section"> - <legend><%:Interfaces%></legend> - - <table width="100%" cellspacing="10" id="ethinfo"> - </table> -</fieldset> -<% end %> - -<fieldset class="cbi-section"> - <legend><%:Network%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%" style="vertical-align:top"><%:IPv4 WAN Status%></td><td> - <table><tr> - <td id="wan4_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="wan4_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - <% if has_ipv6 then %> - <tr><td width="33%" style="vertical-align:top"><%:IPv6 WAN Status%></td><td> - <table><tr> - <td id="wan6_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="wan6_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - <% end %> - <tr><td width="33%"><%:Online Users%></td><td id="userinfo">0</td></tr> - <tr><td width="33%"><%:Active Connections%></td><td id="conns">-</td></tr> - </table> -</fieldset> - -<% if has_dhcp then %> -<fieldset class="cbi-section"> - <legend><%:DHCP Leases%></legend> - - <table class="cbi-section-table" id="lease_status_table"> - <tr class="cbi-section-table-titles"> - <th class="cbi-section-table-cell"><%:Hostname%></th> - <th class="cbi-section-table-cell"><%:IPv4-Address%></th> - <th class="cbi-section-table-cell"><%:MAC-Address%></th> - <th class="cbi-section-table-cell"><%:Leasetime remaining%></th> - </tr> - <tr class="cbi-section-table-row"> - <td colspan="4"><em><br /><%:Collecting data...%></em></td> - </tr> - </table> -</fieldset> - -<% if has_ipv6 then %> -<fieldset class="cbi-section" style="display:none"> - <legend><%:DHCPv6 Leases%></legend> - - <table class="cbi-section-table" id="lease6_status_table"> - <tr class="cbi-section-table-titles"> - <th class="cbi-section-table-cell"><%:Host%></th> - <th class="cbi-section-table-cell"><%:IPv6-Address%></th> - <th class="cbi-section-table-cell"><%:DUID%></th> - <th class="cbi-section-table-cell"><%:Leasetime remaining%></th> - </tr> - <tr class="cbi-section-table-row"> - <td colspan="4"><em><br /><%:Collecting data...%></em></td> - </tr> - </table> -</fieldset> -<% end %> -<% end %> - -<% if has_dsl then %> -<fieldset class="cbi-section"> - <legend><%:DSL%></legend> - <table width="100%" cellspacing="10"> - <tr><td width="33%" style="vertical-align:top"><%:DSL Status%></td><td> - <table><tr> - <td id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - </table> -</fieldset> -<% end %> - -<% if has_wifi then %> -<fieldset class="cbi-section"> - <legend><%:Wireless%></legend> - - <table id="wifi_status_table" width="100%" cellspacing="10"> - <tr><td><em><%:Collecting data...%></em></td></tr> - </table> -</fieldset> -<% end %> - -<%+footer%> diff --git a/docker/patches/index.html.patches/index.htm.orig b/docker/patches/index.html.patches/index.htm.orig deleted file mode 100644 index d78bcc41..00000000 --- a/docker/patches/index.html.patches/index.htm.orig +++ /dev/null @@ -1,819 +0,0 @@ -<%# - Copyright 2008 Steven Barth <steven@midlink.org> - Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org> - Licensed to the public under the Apache License 2.0. --%> - -<% - local fs = require "nixio.fs" - local util = require "luci.util" - local stat = require "luci.tools.status" - local ver = require "luci.version" - - local has_ipv6 = fs.access("/usr/sbin/ip6tables") - local has_dhcp = fs.access("/etc/config/dhcp") - local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) - - local sysinfo = luci.util.ubus("system", "info") or { } - local boardinfo = luci.util.ubus("system", "board") or { } - local unameinfo = nixio.uname() or { } - - local meminfo = sysinfo.memory or { - total = 0, - free = 0, - buffered = 0, - shared = 0 - } - - local mem_cached = luci.sys.exec("sed -e '/^Cached: /!d; s#Cached: *##; s# kB##g' /proc/meminfo") - - local swapinfo = sysinfo.swap or { - total = 0, - free = 0 - } - - local has_dsl = fs.access("/etc/init.d/dsl_control") - - if luci.http.formvalue("status") == "1" then - local ntm = require "luci.model.network".init() - local wan = ntm:get_wannet() - local wan6 = ntm:get_wan6net() - - local conn_count = tonumber( - fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 - - local conn_max = tonumber(luci.sys.exec( - "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max" - ):match("%d+")) or 4096 - - local user_info = luci.sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") - - local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%" - - local rv = { - cpuusage = cpu_usage, - userinfo = user_info, - uptime = sysinfo.uptime or 0, - localtime = os.date(), - loadavg = sysinfo.load or { 0, 0, 0 }, - memory = meminfo, - memcached = mem_cached, - swap = swapinfo, - connmax = conn_max, - conncount = conn_count, - leases = stat.dhcp_leases(), - leases6 = stat.dhcp6_leases(), - wifinets = stat.wifi_networks() - } - - if wan then - rv.wan = { - ipaddr = wan:ipaddr(), - gwaddr = wan:gwaddr(), - netmask = wan:netmask(), - dns = wan:dnsaddrs(), - expires = wan:expires(), - uptime = wan:uptime(), - proto = wan:proto(), - ifname = wan:ifname(), - link = wan:adminlink() - } - end - - if wan6 then - rv.wan6 = { - ip6addr = wan6:ip6addr(), - gw6addr = wan6:gw6addr(), - dns = wan6:dns6addrs(), - ip6prefix = wan6:ip6prefix(), - uptime = wan6:uptime(), - proto = wan6:proto(), - ifname = wan6:ifname(), - link = wan6:adminlink() - } - end - - if has_dsl then - local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat") - local dsl_func = loadstring(dsl_stat) - if dsl_func then - rv.dsl = dsl_func() - end - end - - luci.http.prepare_content("application/json") - luci.http.write_json(rv) - - return - elseif luci.http.formvalue("hosts") == "1" then - luci.http.prepare_content("application/json") - luci.http.write_json(luci.sys.net.host_hints()) - - return - end --%> - -<%+header%> - -<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-23.104.57901-bf5e9ad"></script> -<script type="text/javascript">//<![CDATA[ - function progressbar(v, m) - { - var vn = parseInt(v) || 0; - var mn = parseInt(m) || 100; - var pc = Math.floor((100 / mn) * vn); - - return String.format( - '<div style="width:200px; position:relative; border:1px solid #999999">' + - '<div style="background-color:#CCCCCC; width:%d%%; height:15px">' + - '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' + - '<small>%s / %s (%d%%)</small>' + - '</div>' + - '</div>' + - '</div>', pc, v, m, pc - ); - } - - function wifirate(bss, rx) { - var p = rx ? 'rx_' : 'tx_', - s = '%.1f <%:Mbit/s%>, %d<%:MHz%>' - .format(bss[p+'rate'] / 1000, bss[p+'mhz']), - ht = bss[p+'ht'], vht = bss[p+'vht'], - mhz = bss[p+'mhz'], nss = bss[p+'nss'], - mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'], - he = bss[p+'he'], he_gi = bss[p+'he_gi'], - he_dcm = bss[p+'he_dcm']; - - if (ht || vht) { - if (vht) s += ', VHT-MCS %d'.format(mcs); - if (nss) s += ', VHT-NSS %d'.format(nss); - if (ht) s += ', MCS %s'.format(mcs); - if (sgi) s += ', <%:Short GI%>'; - } - - if (he) { - s += ', HE-MCS %d'.format(mcs); - if (nss) s += ', HE-NSS %d'.format(nss); - if (he_gi) s += ', HE-GI %d'.format(he_gi); - if (he_dcm) s += ', HE-DCM %d'.format(he_dcm); - } - - return s; - } - - function duid2mac(duid) { - // DUID-LLT / Ethernet - if (duid.length === 28 && duid.substr(0, 8) === '00010001') - return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - // DUID-LL / Ethernet - if (duid.length === 20 && duid.substr(0, 8) === '00030001') - return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - return null; - } - - var npoll = 1; - var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>; - - function updateHosts() { - XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) { - hosts = data; - }); - } - - XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 }, - function(x, info) - { - if (!(npoll++ % 5)) - updateHosts(); - - var si = document.getElementById('wan4_i'); - var ss = document.getElementById('wan4_s'); - var ifc = info.wan; - - if (ifc && ifc.ifname && ifc.proto != 'none') - { - var s = String.format( - '<strong><%:Type%>: </strong>%s<br />' + - '<strong><%:Address%>: </strong>%s<br />' + - '<strong><%:Netmask%>: </strong>%s<br />' + - '<strong><%:Gateway%>: </strong>%s<br />', - ifc.proto, - (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0', - (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255', - (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0' - ); - - for (var i = 0; i < ifc.dns.length; i++) - { - s += String.format( - '<strong><%:DNS%> %d: </strong>%s<br />', - i + 1, ifc.dns[i] - ); - } - - if (ifc.expires > -1) - { - s += String.format( - '<strong><%:Expires%>: </strong>%t<br />', - ifc.expires - ); - } - - if (ifc.uptime > 0) - { - s += String.format( - '<strong><%:Connected%>: </strong>%t<br />', - ifc.uptime - ); - } - - ss.innerHTML = String.format('<small>%s</small>', s); - si.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small><a href="%s">%s</a></small>', - ifc.link, ifc.ifname - ); - } - else - { - si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>'; - ss.innerHTML = '<em><%:Not connected%></em>'; - } - - <% if has_ipv6 then %> - var si6 = document.getElementById('wan6_i'); - var ss6 = document.getElementById('wan6_s'); - var ifc6 = info.wan6; - - if (ifc6 && ifc6.ifname && ifc6.proto != 'none') - { - var s = String.format( - '<strong><%:Type%>: </strong>%s%s<br />', - ifc6.proto, (ifc6.ip6prefix) ? '-pd' : '' - ); - - if (!ifc6.ip6prefix) - { - s += String.format( - '<strong><%:Address%>: </strong>%s<br />', - (ifc6.ip6addr) ? ifc6.ip6addr : '::' - ); - } - else - { - s += String.format( - '<strong><%:Prefix Delegated%>: </strong>%s<br />', - ifc6.ip6prefix - ); - if (ifc6.ip6addr) - { - s += String.format( - '<strong><%:Address%>: </strong>%s<br />', - ifc6.ip6addr - ); - } - } - - s += String.format( - '<strong><%:Gateway%>: </strong>%s<br />', - (ifc6.gw6addr) ? ifc6.gw6addr : '::' - ); - - for (var i = 0; i < ifc6.dns.length; i++) - { - s += String.format( - '<strong><%:DNS%> %d: </strong>%s<br />', - i + 1, ifc6.dns[i] - ); - } - - if (ifc6.uptime > 0) - { - s += String.format( - '<strong><%:Connected%>: </strong>%t<br />', - ifc6.uptime - ); - } - - ss6.innerHTML = String.format('<small>%s</small>', s); - si6.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small><a href="%s">%s</a></small>', - ifc6.link, ifc6.ifname - ); - } - else - { - si6.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>'; - ss6.innerHTML = '<em><%:Not connected%></em>'; - } - <% end %> - - <% if has_dsl then %> - var dsl_i = document.getElementById('dsl_i'); - var dsl_s = document.getElementById('dsl_s'); - - var s = String.format( - '<strong><%:Status%>: </strong>%s<br />' + - '<strong><%:Line State%>: </strong>%s [0x%x]<br />' + - '<strong><%:Line Mode%>: </strong>%s<br />' + - '<strong><%:Annex%>: </strong>%s<br />' + - '<strong><%:Profile%>: </strong>%s<br />' + - '<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' + - '<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' + - '<strong><%:Latency%>: </strong>%s / %s<br />' + - '<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' + - '<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' + - '<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' + - '<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' + - '<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' + - '<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' + - '<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' + - '<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' + - '<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' + - '<strong><%:Line Uptime%>: </strong>%s<br />' + - '<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' + - '<strong><%:Power Management Mode%>: </strong>%s<br />', - info.dsl.line_state, info.dsl.line_state_detail, - info.dsl.line_state_num, - info.dsl.line_mode_s, - info.dsl.annex_s, - info.dsl.profile_s, - info.dsl.data_rate_down_s, info.dsl.data_rate_up_s, - info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s, - info.dsl.latency_num_down, info.dsl.latency_num_up, - info.dsl.line_attenuation_down, info.dsl.line_attenuation_up, - info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up, - info.dsl.noise_margin_down, info.dsl.noise_margin_up, - info.dsl.actatp_down, info.dsl.actatp_up, - info.dsl.errors_fec_near, info.dsl.errors_fec_far, - info.dsl.errors_es_near, info.dsl.errors_es_far, - info.dsl.errors_ses_near, info.dsl.errors_ses_far, - info.dsl.errors_loss_near, info.dsl.errors_loss_far, - info.dsl.errors_uas_near, info.dsl.errors_uas_far, - info.dsl.errors_hec_near, info.dsl.errors_hec_far, - info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far, - info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far, - info.dsl.line_uptime_s, - info.dsl.atuc_vendor_id, - info.dsl.power_mode_s - ); - - dsl_s.innerHTML = String.format('<small>%s</small>', s); - dsl_i.innerHTML = String.format( - '<img src="<%=resource%>/icons/ethernet.png" />' + - '<br /><small>DSL</small>' - ); - <% end %> - - <% if has_dhcp then %> - var ls = document.getElementById('lease_status_table'); - if (ls) - { - /* clear all rows */ - while( ls.rows.length > 1 ) - ls.rows[0].parentNode.deleteRow(1); - - for( var i = 0; i < info.leases.length; i++ ) - { - var timestr; - - if (info.leases[i].expires === false) - timestr = '<em><%:unlimited%></em>'; - else if (info.leases[i].expires <= 0) - timestr = '<em><%:expired%></em>'; - else - timestr = String.format('%t', info.leases[i].expires); - - var tr = ls.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); - - tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?'; - tr.insertCell(-1).innerHTML = info.leases[i].ipaddr; - tr.insertCell(-1).innerHTML = info.leases[i].macaddr; - tr.insertCell(-1).innerHTML = timestr; - } - - if( ls.rows.length == 1 ) - { - var tr = ls.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 4; - td.innerHTML = '<em><br /><%:There are no active leases.%></em>'; - } - } - - var ls6 = document.getElementById('lease6_status_table'); - if (ls6 && info.leases6) - { - ls6.parentNode.style.display = 'block'; - - /* clear all rows */ - while( ls6.rows.length > 1 ) - ls6.rows[0].parentNode.deleteRow(1); - - for( var i = 0; i < info.leases6.length; i++ ) - { - var timestr; - - if (info.leases6[i].expires === false) - timestr = '<em><%:unlimited%></em>'; - else if (info.leases6[i].expires <= 0) - timestr = '<em><%:expired%></em>'; - else - timestr = String.format('%t', info.leases6[i].expires); - - var tr = ls6.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); - - var host = hosts[duid2mac(info.leases6[i].duid)]; - if (!info.leases6[i].hostname) - tr.insertCell(-1).innerHTML = - (host && (host.name || host.ipv4 || host.ipv6)) - ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6) - : '?'; - else - tr.insertCell(-1).innerHTML = - (host && host.name && info.leases6[i].hostname != host.name) - ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name) - : info.leases6[i].hostname; - - tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr; - tr.insertCell(-1).innerHTML = info.leases6[i].duid; - tr.insertCell(-1).innerHTML = timestr; - } - - if( ls6.rows.length == 1 ) - { - var tr = ls6.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 4; - td.innerHTML = '<em><br /><%:There are no active leases.%></em>'; - } - } - <% end %> - - <% if has_wifi then %> - var assoclist = [ ]; - - var ws = document.getElementById('wifi_status_table'); - if (ws) - { - var wsbody = ws.rows[0].parentNode; - while (ws.rows.length > 0) - wsbody.deleteRow(0); - - for (var didx = 0; didx < info.wifinets.length; didx++) - { - var dev = info.wifinets[didx]; - - var tr = wsbody.insertRow(-1); - var td; - - td = tr.insertCell(-1); - td.width = "33%"; - td.innerHTML = dev.name; - td.style.verticalAlign = "top"; - - td = tr.insertCell(-1); - - var s = ''; - - for (var nidx = 0; nidx < dev.networks.length; nidx++) - { - var net = dev.networks[nidx]; - var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled); - - var icon; - if (!is_assoc) - icon = "<%=resource%>/icons/signal-none.png"; - else if (net.quality == 0) - icon = "<%=resource%>/icons/signal-0.png"; - else if (net.quality < 25) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (net.quality < 50) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (net.quality < 75) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - s += String.format( - '<table><tr><td style="text-align:center; width:32px; padding:3px">' + - '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" />' + - '<br /><small>%d%%</small>' + - '</td><td style="text-align:left; padding:3px"><small>' + - '<strong><%:SSID%>:</strong> <a href="%s">%h</a><br />' + - '<strong><%:Mode%>:</strong> %s<br />' + - '<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' + - '<strong><%:Bitrate%>:</strong> %s <%:Mbit/s%><br />', - icon, net.signal, net.noise, - net.quality, - net.link, net.ssid || '?', - net.mode, - net.channel, net.frequency, - net.bitrate || '?' - ); - - if (is_assoc) - { - s += String.format( - '<strong><%:BSSID%>:</strong> %s<br />' + - '<strong><%:Encryption%>:</strong> %s', - net.bssid || '?', - net.encryption - ); - } - else - { - s += '<em><%:Wireless is disabled or not associated%></em>'; - } - - s += '</small></td></tr></table>'; - - for (var bssid in net.assoclist) - { - var bss = net.assoclist[bssid]; - - bss.bssid = bssid; - bss.link = net.link; - bss.name = net.name; - bss.ifname = net.ifname; - bss.radio = dev.name; - - assoclist.push(bss); - } - } - - if (!s) - s = '<em><%:No information available%></em>'; - - td.innerHTML = s; - } - } - - var ac = document.getElementById('wifi_assoc_table'); - if (ac) - { - /* clear all rows */ - while( ac.rows.length > 1 ) - ac.rows[0].parentNode.deleteRow(1); - - assoclist.sort(function(a, b) { - return (a.name == b.name) - ? (a.bssid < b.bssid) - : (a.name > b.name ) - ; - }); - - for( var i = 0; i < assoclist.length; i++ ) - { - var tr = ac.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + (1 + (i % 2)); - - var icon; - var q = (-1 * (assoclist[i].noise - assoclist[i].signal)) / 5; - if (q < 1) - icon = "<%=resource%>/icons/signal-0.png"; - else if (q < 2) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (q < 3) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (q < 4) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - tr.insertCell(-1).innerHTML = String.format( - '<span class="ifacebadge" title="%q"><img src="<%=resource%>/icons/wifi.png" /> %h</span>', - assoclist[i].radio, assoclist[i].ifname - ); - - tr.insertCell(-1).innerHTML = String.format( - '<a href="%s">%s</a>', - assoclist[i].link, - '%h'.format(assoclist[i].name).nobr() - ); - - tr.insertCell(-1).innerHTML = assoclist[i].bssid; - - var host = hosts[assoclist[i].bssid]; - if (host) - tr.insertCell(-1).innerHTML = String.format( - '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>', - ((host.name && (host.ipv4 || host.ipv6)) - ? '%h (%s)'.format(host.name, host.ipv4 || host.ipv6) - : '%h'.format(host.name || host.ipv4 || host.ipv6)).nobr() - ); - else - tr.insertCell(-1).innerHTML = '?'; - - tr.insertCell(-1).innerHTML = String.format( - '<span class="ifacebadge" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%> / <%:SNR%>: %d"><img src="%s" /> %d / %d <%:dBm%></span>', - assoclist[i].signal, assoclist[i].noise, assoclist[i].signal - assoclist[i].noise, - icon, - assoclist[i].signal, assoclist[i].noise - ); - - tr.insertCell(-1).innerHTML = wifirate(assoclist[i], true).nobr() + '<br />' + wifirate(assoclist[i], false).nobr(); - } - - if (ac.rows.length == 1) - { - var tr = ac.rows[0].parentNode.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 7; - td.innerHTML = '<br /><em><%:No information available%></em>'; - } - } - <% end %> - - var e; - - if (e = document.getElementById('localtime')) - e.innerHTML = info.localtime; - - if (e = document.getElementById('uptime')) - e.innerHTML = String.format('%t', info.uptime); - - if (e = document.getElementById('userinfo')) - e.innerHTML = info.userinfo; - - if (e = document.getElementById('cpuusage')) - e.innerHTML = info.cpuusage; - - if (e = document.getElementById('loadavg')) - e.innerHTML = String.format( - '%.02f, %.02f, %.02f', - info.loadavg[0] / 65535.0, - info.loadavg[1] / 65535.0, - info.loadavg[2] / 65535.0 - ); - - if (e = document.getElementById('memtotal')) - e.innerHTML = progressbar( - Math.floor(((info.memory.free + info.memory.buffered) / 1048576) + (info.memcached / 1024)) + " <%:MB%>", - Math.floor(info.memory.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('membuff')) - e.innerHTML = progressbar( - Math.floor(info.memory.buffered / 1048576) + " <%:MB%>", - Math.floor(info.memory.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('swaptotal')) - e.innerHTML = progressbar( - Math.floor(info.swap.free / 1048576) + " <%:MB%>", - Math.floor(info.swap.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('swapfree')) - e.innerHTML = progressbar( - Math.floor(info.swap.free / 1048576) + " <%:MB%>", - Math.floor(info.swap.total / 1048576) + " <%:MB%>" - ); - - if (e = document.getElementById('conns')) - e.innerHTML = progressbar(info.conncount, info.connmax); - - } - ); -//]]></script> - -<h2 name="content"><%:Status%></h2> - -<fieldset class="cbi-section"> - <legend><%:System%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr> - <tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or " "%></td></tr> - <tr><td width="33%"><%:Architecture%></td><td><%=pcdata(boardinfo.system or "ARMv8 Processor")%> x <%=luci.sys.exec("cat /proc/cpuinfo | grep 'processor' | wc -l") or "1"%></td></tr> - <tr><td width="33%"><%:Firmware Version%></td><td> - <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> / - <%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>) - </td></tr> - <tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr> - <tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr> - <tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr> - <tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr> - <tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr> - </table> -</fieldset> - -<fieldset class="cbi-section"> - <legend><%:Memory%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Total Available%></td><td id="memtotal">-</td></tr> - <tr><td width="33%"><%:Buffered%></td><td id="membuff">-</td></tr> - </table> -</fieldset> - -<% if swapinfo.total > 0 then %> -<fieldset class="cbi-section"> - <legend><%:Swap%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Total Available%></td><td id="swaptotal">-</td></tr> - <tr><td width="33%"><%:Free%></td><td id="swapfree">-</td></tr> - </table> -</fieldset> -<% end %> - -<fieldset class="cbi-section"> - <legend><%:Network%></legend> - - <table width="100%" cellspacing="10"> - <tr><td width="33%" style="vertical-align:top"><%:IPv4 WAN Status%></td><td> - <table><tr> - <td id="wan4_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="wan4_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - <% if has_ipv6 then %> - <tr><td width="33%" style="vertical-align:top"><%:IPv6 WAN Status%></td><td> - <table><tr> - <td id="wan6_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="wan6_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - <% end %> - <tr><td width="33%"><%:Online Users%></td><td id="userinfo">0</td></tr> - <tr><td width="33%"><%:Active Connections%></td><td id="conns">-</td></tr> - </table> -</fieldset> - -<% if has_dhcp then %> -<fieldset class="cbi-section"> - <legend><%:DHCP Leases%></legend> - - <table class="cbi-section-table" id="lease_status_table"> - <tr class="cbi-section-table-titles"> - <th class="cbi-section-table-cell"><%:Hostname%></th> - <th class="cbi-section-table-cell"><%:IPv4-Address%></th> - <th class="cbi-section-table-cell"><%:MAC-Address%></th> - <th class="cbi-section-table-cell"><%:Leasetime remaining%></th> - </tr> - <tr class="cbi-section-table-row"> - <td colspan="4"><em><br /><%:Collecting data...%></em></td> - </tr> - </table> -</fieldset> - -<% if has_ipv6 then %> -<fieldset class="cbi-section" style="display:none"> - <legend><%:DHCPv6 Leases%></legend> - - <table class="cbi-section-table" id="lease6_status_table"> - <tr class="cbi-section-table-titles"> - <th class="cbi-section-table-cell"><%:Host%></th> - <th class="cbi-section-table-cell"><%:IPv6-Address%></th> - <th class="cbi-section-table-cell"><%:DUID%></th> - <th class="cbi-section-table-cell"><%:Leasetime remaining%></th> - </tr> - <tr class="cbi-section-table-row"> - <td colspan="4"><em><br /><%:Collecting data...%></em></td> - </tr> - </table> -</fieldset> -<% end %> -<% end %> - -<% if has_dsl then %> -<fieldset class="cbi-section"> - <legend><%:DSL%></legend> - <table width="100%" cellspacing="10"> - <tr><td width="33%" style="vertical-align:top"><%:DSL Status%></td><td> - <table><tr> - <td id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td> - <td id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td> - </tr></table> - </td></tr> - </table> -</fieldset> -<% end %> - -<% if has_wifi then %> -<fieldset class="cbi-section"> - <legend><%:Wireless%></legend> - - <table id="wifi_status_table" width="100%" cellspacing="10"> - <tr><td><em><%:Collecting data...%></em></td></tr> - </table> -</fieldset> -<% end %> - -<%+footer%> diff --git a/docker/patches/index.html.patches/luci-admin-status-index-html.patch b/docker/patches/index.html.patches/luci-admin-status-index-html.patch deleted file mode 100644 index 32504ee1..00000000 --- a/docker/patches/index.html.patches/luci-admin-status-index-html.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/usr/lib/lua/luci/view/admin_status/index.htm -+++ b/usr/lib/lua/luci/view/admin_status/index.htm -@@ -9,10 +9,18 @@ - local util = require "luci.util" - local stat = require "luci.tools.status" - local ver = require "luci.version" -+ local uci = require("luci.model.uci").cursor() - - local has_ipv6 = fs.access("/usr/sbin/ip6tables") - local has_dhcp = fs.access("/etc/config/dhcp") - local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) -+ local has_switch = false -+ -+ uci:foreach("network", "switch", -+ function(s) -+ has_switch = true -+ return false -+ end) - - local sysinfo = luci.util.ubus("system", "info") or { } - local boardinfo = luci.util.ubus("system", "board") or { } -@@ -43,12 +51,14 @@ - fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 - - local conn_max = tonumber(luci.sys.exec( -- "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max" -- ):match("%d+")) or 4096 -+ "sysctl -n -e net.netfilter.nf_conntrack_max net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max | head -n 1"):match("%d+")) or 4096 - -- local user_info = luci.sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") -+ local user_info = luci.sys.exec("cat /proc/net/arp | grep -E 'br-lan|eth0' | grep '0x2' | wc -l") - - local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%" -+ local cpu_stat = luci.sys.exec("/usr/bin/cpustat 2>/dev/null") or { } -+ local eth_info = luci.sys.exec("/usr/bin/cpustat -e 2>/dev/null") -+ local eth_cnt = luci.sys.exec("/usr/bin/cpustat -ec 2>/dev/null") - - local rv = { - cpuusage = cpu_usage, -@@ -59,11 +69,14 @@ - memory = meminfo, - memcached = mem_cached, - swap = swapinfo, -+ ethinfo = eth_info, -+ ethcount = eth_cnt, - connmax = conn_max, - conncount = conn_count, - leases = stat.dhcp_leases(), - leases6 = stat.dhcp6_leases(), -- wifinets = stat.wifi_networks() -+ wifinets = stat.wifi_networks(), -+ cpustat = cpu_stat - } - - if wan then -@@ -641,9 +654,30 @@ - - var e; - -+ if (e = document.getElementById('ethinfo')) { -+ var ports = eval('(' + info.ethinfo + ')'); -+ var avg_width = info.ethcount ? 100 / info.ethcount : 100; -+ var tmp = ""; -+ for (var i in ports) -+ { -+ tmp = tmp + String.format( -+ '<td style="text-align:center" width="%d%%"><span style="line-height:25px">%s</span><br /><small><img src="<%=resource%>/icons/%s" /><br />%s<br />%s<br />%s</small></td>', -+ avg_width, -+ ports[i].name, -+ ports[i].operstate ? 'port_up.png' : 'port_down.png', -+ ports[i].driver, -+ ports[i].speed, -+ ports[i].temperature); -+ }; -+ e.innerHTML = "<tr>" + tmp + "</tr>"; -+ } -+ - if (e = document.getElementById('localtime')) - e.innerHTML = info.localtime; - -+ if (e = document.getElementById('cpustat')) -+ e.innerHTML = info.cpustat; -+ - if (e = document.getElementById('uptime')) - e.innerHTML = String.format('%t', info.uptime); - -@@ -700,7 +734,7 @@ - <table width="100%" cellspacing="10"> - <tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr> - <tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or " "%></td></tr> -- <tr><td width="33%"><%:Architecture%></td><td><%=pcdata(boardinfo.system or "ARMv8 Processor")%> x <%=luci.sys.exec("cat /proc/cpuinfo | grep 'processor' | wc -l") or "1"%></td></tr> -+ <tr><td width="33%"><%:Architecture%></td><td><%=luci.sys.exec("/usr/bin/cpustat -a 2>/dev/null")%></td></tr> - <tr><td width="33%"><%:Firmware Version%></td><td> - <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> / - <%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>) -@@ -708,6 +742,7 @@ - <tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr> - <tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr> - <tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr> -+ <tr><td width="33%"><%:CPU状态%></td><td id="cpustat">-</td></tr> - <tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr> - <tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr> - </table> -@@ -732,6 +767,15 @@ - </table> - </fieldset> - <% end %> -+ -+<% if not has_switch then %> -+<fieldset class="cbi-section"> -+ <legend><%:Interfaces%></legend> -+ -+ <table width="100%" cellspacing="10" id="ethinfo"> -+ </table> -+</fieldset> -+<% end %> - - <fieldset class="cbi-section"> - <legend><%:Network%></legend> diff --git a/docker/patches/init.d_turboacc.patch b/docker/patches/init.d_turboacc.patch deleted file mode 100644 index a7962511..00000000 --- a/docker/patches/init.d_turboacc.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/etc/init.d/turboacc -+++ b/etc/init.d/turboacc -@@ -21,10 +21,10 @@ inital_conf(){ - config_get "dns_caching_mode" "config" "dns_caching_mode" "0" - config_get "dns_caching_dns" "config" "dns_caching_dns" - -- [ -e "/lib/modules/$(uname -r)/mtkhnat.ko" ] && { sw_flow="0"; hw_flow="1"; } -- [ ! -e "/lib/modules/$(uname -r)/xt_FLOWOFFLOAD.ko" ] && { sw_flow="0"; hw_flow="0"; } -- [ ! -e "/lib/modules/$(uname -r)/tcp_bbr.ko" ] && bbr_cca="0" -- [ ! -e "/lib/modules/$(uname -r)/xt_FULLCONENAT.ko" ] && fullcone_nat="0" -+ modinfo mtkhnat >/dev/null 2>&1 && { sw_flow="0"; hw_flow="1"; } -+ modinfo xt_FLOWOFFLOAD >/dev/null 2>&1 || { sw_flow="0"; hw_flow="0"; } -+ modinfo tcp_bbr >/dev/null 2>&1 || bbr_cca="0" -+ modinfo xt_FULLCONENAT >/dev/null 2>&1 || fullcone_nat="0" - } - - start_pdnsd() { -@@ -228,8 +228,8 @@ revert_dns() { - load_sfe() { - local kernel_version=$(uname -r) - -- [ -e "/lib/modules/$kernel_version/shortcut-fe-cm.ko" ] && modprobe shortcut-fe-cm -- [ -e "/lib/modules/$kernel_version/fast-classifier.ko" ] && modprobe fast-classifier -+ modinfo shortcut-fe-cm >/dev/null 2>&1 && modprobe shortcut-fe-cm -+ modinfo fast-classifier >/dev/null 2>&1 && modprobe fast-classifier - } - - unload_sfe() { diff --git a/docker/patches/kmod b/docker/patches/kmod deleted file mode 100644 index 1cfdc1b4..00000000 Binary files a/docker/patches/kmod and /dev/null differ diff --git a/docker/patches/rc.local b/docker/patches/rc.local deleted file mode 100644 index c299656a..00000000 --- a/docker/patches/rc.local +++ /dev/null @@ -1,13 +0,0 @@ -# 修复在某些docker环境下网络卡顿的问题, 如果非必要请勿删除! -cat > /etc/resolv.conf <<EOF -search lan -nameserver 127.0.0.1 -options ndots:0 -EOF - -# -# -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -exit 0 diff --git a/docker/patches/smb4.11_enable_smb1.patch b/docker/patches/smb4.11_enable_smb1.patch deleted file mode 100644 index 807503ad..00000000 --- a/docker/patches/smb4.11_enable_smb1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/etc/samba/smb.conf.template 2020-03-13 14:56:40.275184245 +0800 -+++ b/etc/samba/smb.conf.template 2020-03-13 14:58:38.665344696 +0800 -@@ -20,6 +20,8 @@ - ## This parameter controls whether a remote client is allowed or required to use SMB encryption. - ## It has different effects depending on whether the connection uses SMB1 or SMB2 and newer: - ## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions. -+ server min protocol = NT1 -+ client min protocol = NT1 - ## If the connection uses SMB2 or newer, then this option controls the use of the SMB-level encryption that is supported in SMB version 3.0 and above and available in Windows 8 and newer. - ## (default/auto,desired,required,off) - #smb encrypt = default diff --git a/patches/0001-show-soc-status-on-luci.patch b/patches/0001-show-soc-status-on-luci.patch deleted file mode 100644 index 3c0204f3..00000000 --- a/patches/0001-show-soc-status-on-luci.patch +++ /dev/null @@ -1,222 +0,0 @@ -From 6607061537b4007182f51d31ba4af3427082d45c Mon Sep 17 00:00:00 2001 -From: pexcn <pexcn97@gmail.com> -Date: Sun, 3 Mar 2024 15:31:06 +0800 -Subject: [PATCH] show soc status on luci - -Signed-off-by: pexcn <pexcn97@gmail.com> ---- - modules/luci-base/root/sbin/soc-status | 63 +++++++++++++++++++ - .../luci-base/root/usr/share/rpcd/ucode/luci | 51 +++++++++++++++ - .../view/status/include/10_system.js | 30 ++++++++- - .../usr/share/rpcd/acl.d/luci-mod-status.json | 2 +- - 4 files changed, 142 insertions(+), 4 deletions(-) - create mode 100755 modules/luci-base/root/sbin/soc-status - -diff --git a/modules/luci-base/root/sbin/soc-status b/modules/luci-base/root/sbin/soc-status -new file mode 100755 -index 0000000000..467b3247bf ---- /dev/null -+++ b/modules/luci-base/root/sbin/soc-status -@@ -0,0 +1,63 @@ -+#!/bin/sh -+# shellcheck disable=SC2155 -+ -+get_cpu_freq() { -+ local value="$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq 2>/dev/null)" -+ [ -n "$value" ] || value="0" -+ echo "$value" -+} -+ -+get_cpu_governor() { -+ local value="$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null)" -+ [ -n "$value" ] || value="unknown" -+ echo "$value" -+} -+ -+get_cpu_temp() { -+ local value="$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null | sort -n | tail -1)" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_wifi_temp() { -+ local value="$(cat /sys/class/ieee80211/phy*/hwmon*/temp*_input 2>/dev/null | sort -n | tail -1)" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_cpu_usage() { -+ local value="$(top -b -n1 | awk '/^CPU/ { print 100-$8 }')" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_nss_usage() { -+ local value="$(grep '%' /sys/kernel/debug/qca-nss-drv/stats/cpu_load_ubi 2>/dev/null | awk '{print $2}' | sed 's/%//')" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+case "$1" in -+ cpu_freq) -+ get_cpu_freq -+ ;; -+ cpu_governor) -+ get_cpu_governor -+ ;; -+ cpu_temp) -+ get_cpu_temp | awk '{ printf("%.1f\n", $1/1000) }' -+ ;; -+ wifi_temp) -+ get_wifi_temp | awk '{ printf("%.1f\n", $1/1000) }' -+ ;; -+ cpu_usage) -+ get_cpu_usage -+ ;; -+ nss_usage) -+ get_nss_usage -+ ;; -+ *) -+ echo "Usage: $0 {cpu_freq|cpu_governor|cpu_temp|wifi_temp|cpu_usage|nss_usage}" -+ exit 1 -+ ;; -+esac -diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci -index 3c4fea4691..abccca886e 100644 ---- a/modules/luci-base/root/usr/share/rpcd/ucode/luci -+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci -@@ -581,6 +581,57 @@ const methods = { - - return { result: ports }; - } -+ }, -+ -+ getCoreInfo: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_freq'); -+ result.cpufreq = trim(fd.read('all')); -+ fd.close(); -+ -+ fd = popen('soc-status cpu_governor'); -+ result.governor = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } -+ }, -+ -+ getCoreTemp: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_temp'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ fd = popen('soc-status wifi_temp'); -+ result.wifi = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } -+ }, -+ -+ getCoreUsage: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_usage'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ fd = popen('soc-status nss_usage'); -+ result.nss = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } - } - }; - -diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -index 45f7b4acae..032f74bdd4 100644 ---- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -@@ -8,6 +8,21 @@ var callLuciVersion = rpc.declare({ - method: 'getVersion' - }); - -+var callCoreInfo = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreInfo' -+}); -+ -+var callCoreTemp = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreTemp' -+}); -+ -+var callCoreUsage = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreUsage' -+}); -+ - var callSystemBoard = rpc.declare({ - object: 'system', - method: 'board' -@@ -25,14 +40,20 @@ return baseclass.extend({ - return Promise.all([ - L.resolveDefault(callSystemBoard(), {}), - L.resolveDefault(callSystemInfo(), {}), -- L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }) -+ L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }), -+ L.resolveDefault(callCoreInfo(), {}), -+ L.resolveDefault(callCoreTemp(), {}), -+ L.resolveDefault(callCoreUsage(), {}) - ]); - }, - - render: function(data) { - var boardinfo = data[0], - systeminfo = data[1], -- luciversion = data[2]; -+ luciversion = data[2], -+ coreinfo = data[3], -+ coretemp = data[4], -+ coreusage = data[5]; - - luciversion = luciversion.branch + ' ' + luciversion.revision; - -@@ -64,7 +85,10 @@ return baseclass.extend({ - systeminfo.load[0] / 65535.0, - systeminfo.load[1] / 65535.0, - systeminfo.load[2] / 65535.0 -- ) : null -+ ) : null, -+ _('核心频率'), coreinfo.cpufreq / 1000 + ' MHz ' + '(' + coreinfo.governor + ')', -+ _('核心温度'), 'CPU ' + coretemp.cpu + ' °C' + ' / ' + 'WiFi ' + coretemp.wifi + ' °C', -+ _('使用率'), 'CPU ' + coreusage.cpu + '%' + ' / ' + 'NSS ' + coreusage.nss + '%' - ]; - - var table = E('table', { 'class': 'table' }); -diff --git a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -index 45dd7d7d9e..8f60a1eda8 100644 ---- a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -+++ b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -@@ -3,7 +3,7 @@ - "description": "Grant access to realtime statistics", - "read": { - "ubus": { -- "luci": [ "getConntrackList", "getRealtimeStats" ], -+ "luci": [ "getConntrackList", "getRealtimeStats", "getCoreInfo", "getCoreTemp", "getCoreUsage" ], - "network.rrdns": [ "lookup" ] - } - } --- -2.39.2 - diff --git a/patches/0002-show-soc-status-on-luci.patch b/patches/0002-show-soc-status-on-luci.patch deleted file mode 100644 index ee003ca5..00000000 --- a/patches/0002-show-soc-status-on-luci.patch +++ /dev/null @@ -1,170 +0,0 @@ -From d36f3bcef56a912b04670680e41cc4c729848ef1 Mon Sep 17 00:00:00 2001 -From: pexcn <pexcn97@gmail.com> -Date: Sun, 3 Mar 2024 15:31:06 +0800 -Subject: [PATCH] show soc status on luci - -Signed-off-by: pexcn <pexcn97@gmail.com> - -123 - -fix bugs ---- - modules/luci-base/root/sbin/soc-status | 36 +++++++++++++++++++ - .../luci-base/root/usr/share/rpcd/ucode/luci | 30 ++++++++++++++++ - .../view/status/include/10_system.js | 22 ++++++++++-- - .../usr/share/rpcd/acl.d/luci-mod-status.json | 2 +- - 4 files changed, 86 insertions(+), 4 deletions(-) - create mode 100755 modules/luci-base/root/sbin/soc-status - -diff --git a/modules/luci-base/root/sbin/soc-status b/modules/luci-base/root/sbin/soc-status -new file mode 100755 -index 0000000..1c173f7 ---- /dev/null -+++ b/modules/luci-base/root/sbin/soc-status -@@ -0,0 +1,36 @@ -+#!/bin/sh -+# shellcheck disable=SC2155 -+ -+get_cpu_temp() { -+ local value="$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null | sort -n | tail -1)" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_cpu_usage() { -+ local value="$(top -b -n1 | awk '/^CPU/ { print 100-$8 }')" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_nss_usage() { -+ local value="$(grep '%' /sys/kernel/debug/qca-nss-drv/stats/cpu_load_ubi 2>/dev/null | awk '{print $2}' | sed 's/%//')" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+case "$1" in -+ cpu_temp) -+ get_cpu_temp | awk '{ printf("%.1f\n", $1/1000) }' -+ ;; -+ cpu_usage) -+ get_cpu_usage -+ ;; -+ nss_usage) -+ get_nss_usage -+ ;; -+ *) -+ echo "Usage: $0 {cpu_temp|cpu_usage|nss_usage}" -+ exit 1 -+ ;; -+esac -diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci -index 3c4fea4..7935b43 100644 ---- a/modules/luci-base/root/usr/share/rpcd/ucode/luci -+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci -@@ -581,6 +581,36 @@ const methods = { - - return { result: ports }; - } -+ }, -+ -+ getCoreTemp: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_temp'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } -+ }, -+ -+ getCoreUsage: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_usage'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ fd = popen('soc-status nss_usage'); -+ result.nss = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } - } - }; - -diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -index 45f7b4a..b83955c 100644 ---- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -@@ -8,6 +8,16 @@ var callLuciVersion = rpc.declare({ - method: 'getVersion' - }); - -+var callCoreTemp = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreTemp' -+}); -+ -+var callCoreUsage = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreUsage' -+}); -+ - var callSystemBoard = rpc.declare({ - object: 'system', - method: 'board' -@@ -25,14 +35,18 @@ return baseclass.extend({ - return Promise.all([ - L.resolveDefault(callSystemBoard(), {}), - L.resolveDefault(callSystemInfo(), {}), -- L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }) -+ L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }), -+ L.resolveDefault(callCoreTemp(), {}), -+ L.resolveDefault(callCoreUsage(), {}) - ]); - }, - - render: function(data) { - var boardinfo = data[0], - systeminfo = data[1], -- luciversion = data[2]; -+ luciversion = data[2], -+ coretemp = data[3], -+ coreusage = data[4]; - - luciversion = luciversion.branch + ' ' + luciversion.revision; - -@@ -64,7 +78,9 @@ return baseclass.extend({ - systeminfo.load[0] / 65535.0, - systeminfo.load[1] / 65535.0, - systeminfo.load[2] / 65535.0 -- ) : null -+ ) : null, -+ _('核心温度'), 'CPU ' + coretemp.cpu + ' °C', -+ _('使用率'), 'CPU ' + coreusage.cpu + '%' + ' / ' + 'NSS ' + coreusage.nss + '%' - ]; - - var table = E('table', { 'class': 'table' }); -diff --git a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -index 45dd7d7..127daa5 100644 ---- a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -+++ b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -@@ -3,7 +3,7 @@ - "description": "Grant access to realtime statistics", - "read": { - "ubus": { -- "luci": [ "getConntrackList", "getRealtimeStats" ], -+ "luci": [ "getConntrackList", "getRealtimeStats", "getCoreTemp", "getCoreUsage" ], - "network.rrdns": [ "lookup" ] - } - } --- -2.34.1 - diff --git a/patches/0003-add-coremark-luci.patch b/patches/0003-add-coremark-luci.patch deleted file mode 100644 index 6365c523..00000000 --- a/patches/0003-add-coremark-luci.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 5a2e4568a558a63ac34304ab886619668f1776f9 Mon Sep 17 00:00:00 2001 -From: Wan Guofeng <grapenskrskr@gmail.com> -Date: Thu, 9 May 2024 20:11:56 +0800 -Subject: [PATCH] add-coremark-luci - ---- - modules/luci-base/root/sbin/soc-status | 27 ++++++++++++++ - .../luci-base/root/usr/share/rpcd/ucode/luci | 36 +++++++++++++++++++ - .../view/status/include/10_system.js | 29 +++++++++++++--- - .../usr/share/rpcd/acl.d/luci-mod-status.json | 2 +- - 4 files changed, 90 insertions(+), 4 deletions(-) - create mode 100755 modules/luci-base/root/sbin/soc-status - -diff --git a/modules/luci-base/root/sbin/soc-status b/modules/luci-base/root/sbin/soc-status -new file mode 100755 -index 0000000000..2755b99a31 ---- /dev/null -+++ b/modules/luci-base/root/sbin/soc-status -@@ -0,0 +1,27 @@ -+#!/bin/sh -+# shellcheck disable=SC2155 -+ -+get_cpu_temp() { -+ local value="$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null | sort -n | tail -1)" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+get_cpu_usage() { -+ local value="$(top -b -n1 | awk '/^CPU/ { print 100-$8 }')" -+ [ -n "$value" ] || value="-1" -+ echo "$value" -+} -+ -+case "$1" in -+ cpu_temp) -+ get_cpu_temp | awk '{ printf("%.1f\n", $1/1000) }' -+ ;; -+ cpu_usage) -+ get_cpu_usage -+ ;; -+ *) -+ echo "Usage: $0 {cpu_temp|cpu_usage}" -+ exit 1 -+ ;; -+esac -diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci -index 3c4fea4691..939920a372 100644 ---- a/modules/luci-base/root/usr/share/rpcd/ucode/luci -+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci -@@ -581,6 +581,42 @@ const methods = { - - return { result: ports }; - } -+ }, -+ -+ getCoreTemp: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_temp'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } -+ }, -+ -+ getCPUBench: { -+ call: function() { -+ return { cpubench: readfile('/etc/bench.log') || '' }; -+ } -+ }, -+ -+ getCoreUsage: { -+ call: function() { -+ let fd; -+ let result = {}; -+ -+ fd = popen('soc-status cpu_usage'); -+ result.cpu = trim(fd.read('all')); -+ fd.close(); -+ -+ fd = popen('soc-status nss_usage'); -+ result.nss = trim(fd.read('all')); -+ fd.close(); -+ -+ return result; -+ } - } - }; - -diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -index 45f7b4acae..68b41e4b48 100644 ---- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js -@@ -8,6 +8,21 @@ var callLuciVersion = rpc.declare({ - method: 'getVersion' - }); - -+var callCPUBench = rpc.declare({ -+ object: 'luci', -+ method: 'getCPUBench' -+}); -+ -+var callCoreTemp = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreTemp' -+}); -+ -+var callCoreUsage = rpc.declare({ -+ object: 'luci', -+ method: 'getCoreUsage' -+}); -+ - var callSystemBoard = rpc.declare({ - object: 'system', - method: 'board' -@@ -25,7 +40,10 @@ return baseclass.extend({ - return Promise.all([ - L.resolveDefault(callSystemBoard(), {}), - L.resolveDefault(callSystemInfo(), {}), -- L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }) -+ L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }), -+ L.resolveDefault(callCPUBench(), {}), -+ L.resolveDefault(callCoreTemp(), {}), -+ L.resolveDefault(callCoreUsage(), {}) - ]); - }, - -@@ -33,6 +51,9 @@ return baseclass.extend({ - var boardinfo = data[0], - systeminfo = data[1], - luciversion = data[2], -+ cpubench = data[3], -+ coretemp = data[4], -+ coreusage = data[5]; - - luciversion = luciversion.branch + ' ' + luciversion.revision; - -@@ -53,7 +74,7 @@ return baseclass.extend({ - - var fields = [ - _('Hostname'), boardinfo.hostname, -- _('Model'), boardinfo.model, -+ _('Model'), boardinfo.model + cpubench.cpubench, - _('Architecture'), boardinfo.system, - _('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''), - _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''), -@@ -65,6 +86,8 @@ return baseclass.extend({ - systeminfo.load[1] / 65535.0, - systeminfo.load[2] / 65535.0 -- ) : null -+ ) : null, -+ _('核心温度'), 'CPU ' + coretemp.cpu + ' °C', -+ _('使用率'), 'CPU ' + coreusage.cpu + '%' - ]; - - var table = E('table', { 'class': 'table' }); -diff --git a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -index 45dd7d7d9e..dfefb50f6e 100644 ---- a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -+++ b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json -@@ -3,7 +3,7 @@ - "description": "Grant access to realtime statistics", - "read": { - "ubus": { -- "luci": [ "getConntrackList", "getRealtimeStats" ], -+ "luci": [ "getConntrackList", "getRealtimeStats", "getCPUBench", "getCoreTemp", "getCoreUsage" ], - "network.rrdns": [ "lookup" ] - } - } --- -2.34.1 - diff --git a/patches/0004-add-coremark-packages.patch b/patches/0004-add-coremark-packages.patch deleted file mode 100644 index b6fded5b..00000000 --- a/patches/0004-add-coremark-packages.patch +++ /dev/null @@ -1,48 +0,0 @@ -From babdea674a730cf6df059d60bfab281767d4740f Mon Sep 17 00:00:00 2001 -From: breeze303 <grapenskrskr@gmail.com> -Date: Wed, 8 May 2024 22:10:07 +0800 -Subject: [PATCH] add-coremark-packages - ---- - utils/coremark/coremark | 7 +++++++ - utils/coremark/coremark.sh | 12 ++++++++++++ - 2 files changed, 19 insertions(+) - create mode 100644 utils/coremark/coremark - create mode 100644 utils/coremark/coremark.sh - -diff --git a/utils/coremark/coremark b/utils/coremark/coremark -new file mode 100644 -index 000000000..2fcdd544b ---- /dev/null -+++ b/utils/coremark/coremark -@@ -0,0 +1,7 @@ -+#!/bin/sh -+ -+sed -i '/coremark/d' /etc/crontabs/root -+echo "0 4 * * * /etc/coremark.sh" >> /etc/crontabs/root -+crontab /etc/crontabs/root -+ -+touch /etc/bench.log -\ No newline at end of file -diff --git a/utils/coremark/coremark.sh b/utils/coremark/coremark.sh -new file mode 100644 -index 000000000..e581b7c92 ---- /dev/null -+++ b/utils/coremark/coremark.sh -@@ -0,0 +1,12 @@ -+#!/bin/sh -+ -+/bin/coremark > /tmp/coremark.log -+ -+cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 > /etc/bench.log -+sed -i 's/CoreMark 1.0/ (CpuMark/g' /etc/bench.log -+echo " Scores)" >> /etc/bench.log -+ -+if [ -f "/etc/bench.log" ]; then -+ sed -i '/coremark/d' /etc/crontabs/root -+ crontab /etc/crontabs/root -+fi -\ No newline at end of file --- -2.34.1 -