From d3e56689439a4a24c357e3731aa5bc55e21c5440 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 17 Apr 2021 11:02:01 +0800 Subject: [PATCH] autocore-arm: add mt76 temperature for hiwifi c526a Ref: https://github.com/openwrt/mt76/commit/c7f82146ef9683e336d459474ab82d670afcc69c --- package/lean/autocore/Makefile | 2 +- package/lean/autocore/files/arm/sbin/tempinfo | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 3224cbb8fb..d6f0a0c15f 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autocore PKG_VERSION:=1 -PKG_RELEASE:=39 +PKG_RELEASE:=40 include $(INCLUDE_DIR)/package.mk diff --git a/package/lean/autocore/files/arm/sbin/tempinfo b/package/lean/autocore/files/arm/sbin/tempinfo index bd32b8fb16..812d1750f4 100755 --- a/package/lean/autocore/files/arm/sbin/tempinfo +++ b/package/lean/autocore/files/arm/sbin/tempinfo @@ -1,9 +1,14 @@ #!/bin/sh +mt76_path="/sys/kernel/debug/ieee80211/phy0/mt76/temperature" +if [ -e "${mt76_path}" ]; then + mt76_temp=" $(cat "${mt76_path}" | awk -F ': ' '{print $2}')°C" +fi + sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | grep -Ev 'high' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" if grep -q "ipq40xx" "/etc/openwrt_release"; then - echo -n "WiFi: ${sys_temp}" + echo -n "WiFi:${mt76_temp} ${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}"