autocore-arm: add support for big.LITTLE arch

This commit is contained in:
CN_SZTL 2020-12-12 22:39:42 +08:00 committed by Tianling Shen
parent 2fb6ef3dd2
commit ac003a674f
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -9,13 +9,15 @@ 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
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
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} "
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
sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
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}, ${sys_temp})"
echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${little_cpu_freq}, ${cpu_temp})"