xbmc: add a more general check for cpu temperature found on some newer systems

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2014-09-27 21:08:55 +02:00
parent e0f918b0db
commit b257a37628

View File

@ -32,32 +32,42 @@ if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then
fi
if [ "$1" = "cpu" -o "$TEMP" = "0" ]; then
if [ -f /sys/class/hwmon/hwmon1/temp1_input ]; then
# used on Asus systems (ie. AT5IONT-I)
TEMP=`cat /sys/class/hwmon/hwmon1/temp1_input`
elif [ -f /sys/devices/platform/coretemp.0/temp1_input ]; then
# used with coretemp
TEMP=`cat /sys/devices/platform/coretemp.0/temp1_input`
elif [ -f /sys/devices/platform/coretemp.0/temp2_input ]; then
# used with coretemp
TEMP=`cat /sys/devices/platform/coretemp.0/temp2_input`
elif [ -f /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp ]; then
# used on some intel systems
TEMP=`cat /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp`
elif [ -f /sys/devices/virtual/thermal/thermal_zone0/temp ]; then
# used on some intel systems
TEMP=`cat /sys/devices/virtual/thermal/thermal_zone0/temp`
elif [ -f /sys/class/hwmon/hwmon0/temp1_input ]; then
# hwmon for new 2.6.39, 3.0 linux kernels
TEMP=`cat /sys/class/hwmon/hwmon0/temp1_input`
elif [ -f /sys/class/hwmon/hwmon0/device/temp1_input ]; then
# used on AMD systems
# used with coretemp
for hwmon in hwmon0 hwmon1; do
for temp in temp1 temp2; do
if [ "$TEMP" = "0" -a -f /sys/class/hwmon/${hwmon}/${temp}_input ]; then
if [ -f /sys/class/hwmon/${hwmon}/name ]; then
if [ ! "$(cat /sys/class/hwmon/${hwmon}/name)" = acpitz ]; then
TEMP=$(cat /sys/class/hwmon/${hwmon}/${temp}_input)
fi
fi
fi
done
done
# used on AMD systems
if [ "$TEMP" = "0" -a -f /sys/class/hwmon/hwmon0/device/temp1_input ]; then
TEMP=`cat /sys/class/hwmon/hwmon0/device/temp1_input`
elif [ -f /sys/class/hwmon/hwmon0/device/temp2_input ]; then
# used on ION systems
fi
# used on ION systems
if [ "$TEMP" = "0" -a -f /sys/class/hwmon/hwmon0/device/temp2_input ]; then
TEMP=`cat /sys/class/hwmon/hwmon0/device/temp2_input`
elif [ -f /sys/class/thermal/thermal_zone0/temp ]; then
# used on RaspberryPi
fi
# used on some intel systems
if [ "$TEMP" = "0" -a -f /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp ]; then
TEMP=`cat /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp`
fi
# used on some intel systems
if [ "$TEMP" = "0" -a -f /sys/devices/virtual/thermal/thermal_zone0/temp ]; then
TEMP=`cat /sys/devices/virtual/thermal/thermal_zone0/temp`
fi
# used on RaspberryPi
if [ "$TEMP" = "0" -a -f /sys/class/thermal/thermal_zone0/temp ]; then
TEMP=`cat /sys/class/thermal/thermal_zone0/temp`
fi