From 55097d4f7ca7618336372a9d46af970f38bd0d2a Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 25 Sep 2020 11:25:09 +0800 Subject: [PATCH] autocore: enable sensors support for ipq806x --- package/lean/autocore/Makefile | 6 ++++-- package/lean/autocore/files/arm/index.htm | 6 +++++- package/lean/autocore/files/arm/sbin/cpuinfo | 12 ++++++++---- package/lean/autocore/files/arm/sbin/tempinfo | 6 ++++++ 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100755 package/lean/autocore/files/arm/sbin/tempinfo diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index b10064baed..1fe5c9f2e1 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -17,8 +17,7 @@ define Package/autocore-arm TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x) \ - +TARGET_bcm53xx:nvram \ - +TARGET_ipq40xx:lm-sensors + +TARGET_bcm53xx:nvram +(TARGET_ipq40xx||TARGET_ipq806x):lm-sensors VARIANT:=arm endef @@ -47,6 +46,9 @@ define Package/autocore-arm/install $(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm $(INSTALL_DIR) $(1)/sbin $(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo +ifeq ($(BOARD),ipq806x) + $(INSTALL_BIN) ./files/arm/sbin/tempinfo $(1)/sbin/tempinfo +endif endef define Package/autocore-x86/install diff --git a/package/lean/autocore/files/arm/index.htm b/package/lean/autocore/files/arm/index.htm index ff979fc9e8..0a348fe462 100644 --- a/package/lean/autocore/files/arm/index.htm +++ b/package/lean/autocore/files/arm/index.htm @@ -13,6 +13,7 @@ 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_temp = fs.access("/sbin/tempinfo") local sysinfo = luci.util.ubus("system", "info") or { } local boardinfo = luci.util.ubus("system", "board") or { } @@ -49,7 +50,7 @@ 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 cpu_info = luci.sys.exec("/sbin/cpuinfo") or "ARM Processor x 0 (233MHz, 2.3°C)" + local cpu_info = luci.sys.exec("/sbin/cpuinfo") or "ARM Processor" local rv = { cpuinfo = cpu_info, @@ -705,6 +706,9 @@