cpuinfo: add support for AMD Zen CPU temperature sensor

* fb74eb547c
This commit is contained in:
Bard 2025-05-27 18:33:43 +08:00 committed by GitHub
parent 1302871ab2
commit 4644197dcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,7 +41,7 @@ case "$DISTRIB_TARGET" in
# Intel
cpu_temp="$(sensors "coretemp-*" 2>"/dev/null" | grep -E "(Package id |Core )" | grep -Eo "\+[0-9.]*°C" | head -n1 | tr -d "+")"
# AMD
[ -n "${cpu_temp}" ] || cpu_temp="$(sensors "k*temp-*" 2>"/dev/null" | awk '/Tdie/ {print $2}' | head -n1 | tr -d "+")"
[ -n "${cpu_temp}" ] || cpu_temp="$(sensors "k10temp-*" 2>"/dev/null" | awk '/Tctl|Tdie/ {print $2}' | head -n1 | tr -d "+")"
;;
*)
[ ! -e "$THERMAL_PATH/thermal_zone0/temp" ] || \