From c7e6a991ffbe3dc07c1543c7f238fc8af3f7dadc Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 23 Aug 2020 23:31:16 +0800 Subject: [PATCH] autocore: add bcm53xx support --- package/lean/autocore/Makefile | 4 +++- package/lean/autocore/files/arm/sbin/cpuinfo | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 905e44b581..b10064baed 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -16,7 +16,9 @@ include $(INCLUDE_DIR)/package.mk define Package/autocore-arm TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL - DEPENDS:=@(TARGET_bcm27xx||TARGET_ipq40xx||TARGET_ipq806x) +TARGET_ipq40xx:lm-sensors + DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x) \ + +TARGET_bcm53xx:nvram \ + +TARGET_ipq40xx:lm-sensors VARIANT:=arm endef diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo index 88cf35d430..3b870290da 100755 --- a/package/lean/autocore/files/arm/sbin/cpuinfo +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -4,7 +4,12 @@ cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' [ -z "${cpu_arch}" ] && cpu_arch="ARMv8 Processor" cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)" -cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" +if grep -q "bcm53xx" "/etc/openwrt_release"; then + cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" +else + cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" +fi + if grep -q "ipq40xx" "/etc/openwrt_release"; then sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" else