From 0d010655f2837eba1cb63658cf05e1218ddc7a12 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 20:30:43 +0800 Subject: [PATCH] update-02.15 --- .../root/etc/profile.d/opkg.sh | 2 +- .../root/etc/mosdns/def_config.yaml | 14 ++-- luci-app-pushbot/README.md | 2 +- luci-app-quickstart/Makefile | 2 +- .../luasrc/controller/quickstart.lua | 15 +++- my-autocore/files/x86/autocore | 7 +- my-default-settings/Makefile | 13 +++- my-default-settings/files/etc/banner | 11 --- .../etc/uci-defaults/95-default-settings | 4 +- .../armv8/files/etc/init.d/fa-fancontrol | 7 ++ .../armv8/files/usr/bin/fa-fancontrol.sh | 69 +++++++++++++++++++ 11 files changed, 116 insertions(+), 30 deletions(-) delete mode 100644 my-default-settings/files/etc/banner create mode 100644 my-default-settings/target/rockchip/armv8/files/etc/init.d/fa-fancontrol create mode 100644 my-default-settings/target/rockchip/armv8/files/usr/bin/fa-fancontrol.sh diff --git a/luci-app-gpsysupgrade/root/etc/profile.d/opkg.sh b/luci-app-gpsysupgrade/root/etc/profile.d/opkg.sh index ddfba25a0..aa929d272 100644 --- a/luci-app-gpsysupgrade/root/etc/profile.d/opkg.sh +++ b/luci-app-gpsysupgrade/root/etc/profile.d/opkg.sh @@ -22,7 +22,7 @@ set opkg.defaults.proc='--force-overwrite --force-checksum --force-depends' set opkg.defaults.reinstall='--force-reinstall --force-overwrite --force-checksum --force-depends' set opkg.defaults.newconf='/etc' EOI -echo "kmod busybox base-files luci-app-openclash opkg " \ +echo "kmod busybox base-files luci-app-openclash " \ | sed -e "s/\s/ ipkg\n/g" | opkg uci ignore } diff --git a/luci-app-mosdns/root/etc/mosdns/def_config.yaml b/luci-app-mosdns/root/etc/mosdns/def_config.yaml index 2ccd6176c..cd840617c 100644 --- a/luci-app-mosdns/root/etc/mosdns/def_config.yaml +++ b/luci-app-mosdns/root/etc/mosdns/def_config.yaml @@ -24,21 +24,22 @@ plugin: exec: - if: - query_is_ad_domain + - qtype65 exec: - _block_with_nxdomain - - _end + - _return - if: - query_is_whitelist_domain - query_is_local_domain - '!_query_is_common' exec: - forward_local - - _end + - _return - if: - query_is_non_local_domain exec: - forward_remote - - _end + - _return - primary: - forward_local - if: @@ -68,9 +69,7 @@ plugin: args: upstream: - addr: 'tls://8.8.4.4' - idle_timeout: 10 - addr: 'tls://9.9.9.9' - idle_timeout: 10 - tag: lazy_cache type: cache @@ -101,3 +100,8 @@ plugin: args: domain: - 'ext:./serverlist.txt' + + - tag: qtype65 + type: query_matcher + args: + qtype: [65] diff --git a/luci-app-pushbot/README.md b/luci-app-pushbot/README.md index 19e50e6f1..3c3284a54 100644 --- a/luci-app-pushbot/README.md +++ b/luci-app-pushbot/README.md @@ -27,7 +27,7 @@ - 因微信推送存在诸多弊端(无法分开聊天工具与功能性消息推送,通知内不显示内容,内容需要点开才能查看等), - 故由 然后七年 @zzsj0928 重新修改为本插件,为钉钉机器人API使用。 - 本插件工作在:openwrt -- 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS) +- 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS),PushDeer,PushDeer自架 - 自20210911之后的版本,支持Bark群组,群组名默认为设备名 - 自20210901之后的版本,增加依赖jq,请重新编译或在安装前同步安装jq diff --git a/luci-app-quickstart/Makefile b/luci-app-quickstart/Makefile index c1645d498..8bd69ea5d 100644 --- a/luci-app-quickstart/Makefile +++ b/luci-app-quickstart/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for quickstart LUCI_DEPENDS:=+quickstart +shadow-useradd +luci-app-store LUCI_PKGARCH:=all -PKG_VERSION:=0.2.0 +PKG_VERSION:=0.2.1 PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-quickstart/luasrc/controller/quickstart.lua b/luci-app-quickstart/luasrc/controller/quickstart.lua index 84ff131a7..df6346056 100644 --- a/luci-app-quickstart/luasrc/controller/quickstart.lua +++ b/luci-app-quickstart/luasrc/controller/quickstart.lua @@ -5,9 +5,14 @@ module("luci.controller.quickstart", package.seeall) local page_index = {"admin", "quickstart", "pages"} function index() - entry({"admin", "quickstart"}, call("redirect_index"), _("QuickStart"), 1) - entry({"admin", "network_guide"}, call("networkguide_index"), _("NetworkGuide"), 2) - entry({"admin", "quickstart", "pages"}, call("quickstart_index")).leaf = true + if luci.sys.call("pgrep quickstart >/dev/null") == 0 then + entry({"admin", "quickstart"}, call("redirect_index"), _("QuickStart"), 1) + entry({"admin", "network_guide"}, call("networkguide_index"), _("NetworkGuide"), 2) + entry({"admin", "quickstart", "pages"}, call("quickstart_index")).leaf = true + else + entry({"admin", "quickstart"}) + entry({"admin", "quickstart", "pages"}, call("redirect_fallback")).leaf = true + end end function networkguide_index() @@ -18,6 +23,10 @@ function redirect_index() luci.http.redirect(luci.dispatcher.build_url(unpack(page_index))) end +function redirect_fallback() + luci.http.redirect(luci.dispatcher.build_url("admin","status")) +end + function quickstart_index() luci.template.render("quickstart/main", {prefix=luci.dispatcher.build_url(unpack(page_index))}) end \ No newline at end of file diff --git a/my-autocore/files/x86/autocore b/my-autocore/files/x86/autocore index ca82c6683..181acd005 100644 --- a/my-autocore/files/x86/autocore +++ b/my-autocore/files/x86/autocore @@ -28,10 +28,11 @@ start() d=$(echo -n ' Core ') e=$(cat /proc/cpuinfo | grep 'processor' | wc -l) f=$(echo -n ' Thread ') - g=${b}${c}${d}${e}${f} + g=$(dmesg | grep 'DMI:' | awk -F ',' '{print $1$2 }' | awk -F ':' '{print $2 }') + h=${g}' '${b}${c}${d}${e}${f} mkdir -p /tmp/sysinfo - sed -i "s/\(.\+\)/\1$g /" /tmp/sysinfo/model + echo $h > /tmp/sysinfo/model a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.") b=$(echo "$a" | wc -l) @@ -47,4 +48,6 @@ start() ethtool -K $c tso on >/dev/null 2>&1 ethtool -K $c ufo on >/dev/null 2>&1 done + + [ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm } diff --git a/my-default-settings/Makefile b/my-default-settings/Makefile index 96db93a31..85b2fcae0 100644 --- a/my-default-settings/Makefile +++ b/my-default-settings/Makefile @@ -6,10 +6,11 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=my-default-settings PKG_VERSION:=1 -PKG_RELEASE:=10 +PKG_RELEASE:=40 include $(INCLUDE_DIR)/package.mk @@ -27,7 +28,7 @@ define Package/$(PKG_NAME)/conffiles endef define Build/Prepare - chmod +x ./files/bin/* ./files/sbin/* ./files/etc/profile.d/* ./files/usr/share/* >/dev/null || true + chmod +x ./files/bin/* ./files/sbin/* ./files/etc/profile.d/* ./files/usr/share/* target/*/{*,}/files/{etc/init.d/*,usr/bin/*} >/dev/null || true endef define Build/Compile @@ -35,10 +36,16 @@ endef define Package/$(PKG_NAME)/install $(CP) ./files/* $(1)/ + echo $(BOARD)$(TARGETID) + if [ -d ./target/$(BOARD)/files/. ]; then \ + $(CP) ./target/$(BOARD)/files/* $(1)/; \ + fi + if [ -d ./target/$(TARGETID)/files/. ]; then \ + $(CP) ./target/$(TARGETID)/files/* $(1)/; \ + fi; \ $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n po2lmo ./po/zh_Hans/default.po $(1)/usr/lib/lua/luci/i18n/default.zh-cn.lmo endef $(eval $(call BuildPackage,$(PKG_NAME))) - diff --git a/my-default-settings/files/etc/banner b/my-default-settings/files/etc/banner deleted file mode 100644 index 8f84119b2..000000000 --- a/my-default-settings/files/etc/banner +++ /dev/null @@ -1,11 +0,0 @@ - _____ - _____________________________ __________ /_ - _ __ \__ __ \ _ \_ __ \_ | /| / /_ ___/ __/ - / /_/ /_ /_/ / __/ / / /_ |/ |/ /_ / / /_ - \____/_ .___/\___//_/ /_/____/|__/ /_/ \__/ - /_/ - _________________________________________ - - %D %C by Kiddin' - _________________________________________ - diff --git a/my-default-settings/files/etc/uci-defaults/95-default-settings b/my-default-settings/files/etc/uci-defaults/95-default-settings index fbe21fc5e..fc9b7075f 100644 --- a/my-default-settings/files/etc/uci-defaults/95-default-settings +++ b/my-default-settings/files/etc/uci-defaults/95-default-settings @@ -226,8 +226,6 @@ uci commit base_config [[ -f "/bin/coremark" && ! -f "/etc/bench.log" && "$(uci -q get wizard.default.coremark)" == '1' ]] && { sleep 30 /bin/coremark >/tmp/coremark.log - cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 >/etc/bench.log - sed -i 's/CoreMark 1.0/(CpuMark/g' /etc/bench.log - echo " Scores)" >>/etc/bench.log + cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 | sed -e 's/CoreMark 1.0\(.*\)/(CpuMark\1 Scores)/g' >/etc/bench.log } ) & diff --git a/my-default-settings/target/rockchip/armv8/files/etc/init.d/fa-fancontrol b/my-default-settings/target/rockchip/armv8/files/etc/init.d/fa-fancontrol new file mode 100644 index 000000000..dd8489271 --- /dev/null +++ b/my-default-settings/target/rockchip/armv8/files/etc/init.d/fa-fancontrol @@ -0,0 +1,7 @@ +#!/bin/sh /etc/rc.common + +START=21 +start() { + /usr/bin/fa-fancontrol.sh & +} + diff --git a/my-default-settings/target/rockchip/armv8/files/usr/bin/fa-fancontrol.sh b/my-default-settings/target/rockchip/armv8/files/usr/bin/fa-fancontrol.sh new file mode 100644 index 000000000..8fa9d9e1b --- /dev/null +++ b/my-default-settings/target/rockchip/armv8/files/usr/bin/fa-fancontrol.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# determine fan controller +if [ -d /sys/devices/platform/pwm-fan ]; then + echo "pls use /usr/bin/fa-fancontrol.sh." + exit 1 +fi + +if [ ! -d /sys/class/pwm/pwmchip0 ]; then + echo "this model does not support pwm." + exit 1 +fi +if [ ! -d /sys/class/pwm/pwmchip0/pwm0 ]; then + echo 0 > /sys/class/pwm/pwmchip0/export +fi +sleep 1 +while [ ! -d /sys/class/pwm/pwmchip0/pwm0 ]; +do + sleep 1 +done +ISENABLE=`cat /sys/class/pwm/pwmchip0/pwm0/enable` +if [ $ISENABLE -eq 1 ]; then + echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable +fi +echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period +echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable + +# max speed run 5s +echo 46990 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle +sleep 5 +echo 25000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle + +# declare -a CpuTemps=(55000 43000 38000 32000) +# declare -a PwmDutyCycles=(1000 20000 30000 45000) + +declare -a CpuTemps=(75000 63000 58000 52000) +declare -a PwmDutyCycles=(25000 35000 45000 46990) + +declare -a Percents=(100 75 50 25) +DefaultDuty=49990 +DefaultPercents=0 + +while true +do + temp=$(cat /sys/class/thermal/thermal_zone0/temp) + INDEX=0 + FOUNDTEMP=0 + DUTY=$DefaultDuty + PERCENT=$DefaultPercents + + for i in 0 1 2 3; do + if [ $temp -gt ${CpuTemps[$i]} ]; then + INDEX=$i + FOUNDTEMP=1 + break + fi + done + if [ ${FOUNDTEMP} == 1 ]; then + DUTY=${PwmDutyCycles[$i]} + PERCENT=${Percents[$i]} + fi + + echo $DUTY > /sys/class/pwm/pwmchip0/pwm0/duty_cycle; + + # echo "temp: $temp, duty: $DUTY, ${PERCENT}%" + # cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq + + sleep 2s; +done