autocore-arm: adjust display order

This commit is contained in:
AmadeusGhost 2020-10-18 11:02:09 +08:00
parent ad8c4d3e8d
commit ea3ddbe9ca
4 changed files with 12 additions and 13 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=35
PKG_RELEASE:=36
include $(INCLUDE_DIR)/package.mk
@ -46,7 +46,7 @@ define Package/autocore-arm/install
$(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
ifeq ($(BOARD),ipq806x)
ifneq (, $(findstring $(BOARD), ipq40xx ipq806x))
$(INSTALL_BIN) ./files/arm/sbin/tempinfo $(1)/sbin/tempinfo
endif
endef

View File

@ -698,6 +698,9 @@
<tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or ""%></td></tr>
<tr><td width="33%"><%:Architecture%></td><td id="cpuinfo">-</td></tr>
<% if has_temp then %>
<tr><td width="33%"><%:Temperature%></td><td><%=luci.sys.exec("/sbin/tempinfo") or "?"%></td></tr>
<% end %>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%><!-- /
<%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>) !-->
@ -706,9 +709,6 @@
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
<% if has_temp then %>
<tr><td width="33%"><%:Temperature%></td><td><%=luci.sys.exec("/sbin/tempinfo") or "?"%></td></tr>
<% end %>
<tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr>
</table>
</fieldset>

View File

@ -11,12 +11,7 @@ else
fi
if grep -q "ipq" "/etc/openwrt_release"; then
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')"
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})"
else
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq})"
fi
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})"

View File

@ -1,6 +1,10 @@
#!/bin/sh
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | grep -Ev 'high' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')"
echo -n "CPU: ${cpu_temp}, WiFi: ${sys_temp}"
if grep -q "ipq40xx" "/etc/openwrt_release"; then
echo -n "WiFi: ${sys_temp}"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
echo -n "CPU: ${cpu_temp}, WiFi: ${sys_temp}"
fi