autocore-arm: simplify script

This commit is contained in:
CN_SZTL 2020-08-01 19:30:37 +08:00
parent 7aacd4fb65
commit 35bfeba3aa
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 6 additions and 15 deletions

View File

@ -44,11 +44,7 @@ define Package/autocore-arm/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm
$(INSTALL_DIR) $(1)/sbin
ifneq ($(BOARD),ipq40xx)
$(CP) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
else
$(CP) ./files/arm/sbin/cpuinfo-ipq40xx $(1)/sbin/cpuinfo
endif
$(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
endef
define Package/autocore-x86/install

View File

@ -5,6 +5,10 @@ cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': '
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
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"
fi
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})"

View File

@ -1,9 +0,0 @@
#!/bin/sh
cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' '{print $2}')"
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')"
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})"