diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 5b04de7347..f9c0a312cf 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -17,7 +17,9 @@ define Package/autocore-arm TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_mvebu||TARGET_ipq40xx||TARGET_ipq806x) \ - +TARGET_bcm53xx:nvram +(TARGET_ipq40xx||TARGET_ipq806x):lm-sensors + +TARGET_bcm27xx:bcm27xx-userland \ + +TARGET_bcm53xx:nvram \ + +(TARGET_ipq40xx||TARGET_ipq806x):lm-sensors VARIANT:=arm endef diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo index 1db947f34b..afdfc7a6fa 100755 --- a/package/lean/autocore/files/arm/sbin/cpuinfo +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -4,7 +4,9 @@ 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)" -if grep -q "bcm53xx" "/etc/openwrt_release"; then +if grep -q "bcm27xx" "/etc/openwrt_release"; then + cpu_freq="$(expr $(vcgencmd measure_clock arm | awk -F '=' '{print $2}') / 1000000)Mhz" +elif grep -q "bcm53xx" "/etc/openwrt_release"; then cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" elif grep -q "mvebu" "/etc/openwrt_release"; then cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz" @@ -15,6 +17,10 @@ fi if grep -q "ipq" "/etc/openwrt_release"; then echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq})" else - sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" - echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})" + if grep -q "bcm27xx" "/etc/openwrt_release"; then + cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C" + else + cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" + fi + echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${cpu_temp})" fi