autocore-arm: bug fixes

This commit is contained in:
Tianling Shen
2020-12-23 22:55:09 +08:00
parent 944473726b
commit 0dab146fd7

View File

@@ -9,14 +9,14 @@ if grep -q "bcm53xx" "/etc/openwrt_release"; then
elif grep -q "mvebu" "/etc/openwrt_release"; then
cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz"
else
little_cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
big_cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq) / 1000)MHz"
[ -n "${big_cpu_freq}" ] && big_cpu_freq="${big_cpu_freq} "
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
big_cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq) / 1000)"
[ -n "${big_cpu_freq}" ] && big_cpu_freq="${big_cpu_freq}MHz "
fi
if grep -q "ipq" "/etc/openwrt_release"; then
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq})"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${little_cpu_freq}, ${cpu_temp})"
echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${cpu_freq}, ${cpu_temp})"
fi