forked from 00575/R2S
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enable_autocore.diff
41 lines (37 loc) · 1.92 KB
/
enable_autocore.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile
index 03e4fb6..f774324 100644
--- a/package/lean/autocore/Makefile
+++ b/package/lean/autocore/Makefile
@@ -16,8 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/autocore-arm
TITLE:=Arm auto core loadbalance script.
MAINTAINER:=CN_SZTL
- DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x||TARGET_mvebu||TARGET_rockchip) \
- +TARGET_bcm27xx:bcm27xx-userland +TARGET_bcm53xx:nvram
+ DEPENDS:=+bc +lm-sensors +ethtool
VARIANT:=arm
endef
diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo
index 5a525a5..6adabea 100755
--- a/package/lean/autocore/files/arm/sbin/cpuinfo
+++ b/package/lean/autocore/files/arm/sbin/cpuinfo
@@ -4,20 +4,8 @@
[ -z "${cpu_arch}" ] && cpu_arch="ARMv8 Processor"
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
-if grep -q "bcm27xx" "/etc/openwrt_release"; then
- cpu_freq="$(vcgencmd get_config arm_freq | awk -F '=' '{print $2}')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"
-else
- cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
-fi
+cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpu[04]/cpufreq/cpuinfo_cur_freq) / 1000) MHz"
-if grep -q "ipq40xx" "/etc/openwrt_release"; then
- sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input)"
-else
- sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp)"
-fi
+sys_temp="$(awk '{ printf("%.2f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp)"
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})"