diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk index 111afa4236..6a90052436 100644 --- a/packages/mediacenter/xbmc/package.mk +++ b/packages/mediacenter/xbmc/package.mk @@ -454,7 +454,7 @@ post_makeinstall_target() { mkdir -p $INSTALL/usr/bin cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin - cp $PKG_DIR/scripts/gputemp $INSTALL/usr/bin + ln -sf cputemp $INSTALL/usr/bin/gputemp cp $PKG_DIR/scripts/setwakeup.sh $INSTALL/usr/bin cp tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send diff --git a/packages/mediacenter/xbmc/scripts/cputemp b/packages/mediacenter/xbmc/scripts/cputemp index 0c78f1d57b..6860c6dd7f 100755 --- a/packages/mediacenter/xbmc/scripts/cputemp +++ b/packages/mediacenter/xbmc/scripts/cputemp @@ -23,33 +23,45 @@ TEMP=0 -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 - TEMP=`cat /sys/class/hwmon/hwmon0/device/temp1_input` -elif [ -f /sys/class/hwmon/hwmon0/device/temp2_input ]; then - # used on ION systems - TEMP=`cat /sys/class/hwmon/hwmon0/device/temp2_input` -elif [ -f /sys/class/thermal/thermal_zone0/temp ]; then - # used on RaspberryPi - TEMP=`cat /sys/class/thermal/thermal_zone0/temp` +if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then + if [ -x /usr/bin/lspci ]; then + if lspci -n | grep 0300 | grep -q 10de; then + [ -x /usr/bin/nvidia-smi ] && TEMP=`/usr/bin/nvidia-smi -q -x | grep 'gpu_temp' | awk '{ print $1 }' | sed 's,,,g'` + fi + fi fi -echo "$(( $TEMP / 1000 )) C" +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 + TEMP=`cat /sys/class/hwmon/hwmon0/device/temp1_input` + elif [ -f /sys/class/hwmon/hwmon0/device/temp2_input ]; then + # used on ION systems + TEMP=`cat /sys/class/hwmon/hwmon0/device/temp2_input` + elif [ -f /sys/class/thermal/thermal_zone0/temp ]; then + # used on RaspberryPi + TEMP=`cat /sys/class/thermal/thermal_zone0/temp` + fi + + TEMP="$(( $TEMP / 1000 ))" +fi + +echo "${TEMP} C" diff --git a/packages/mediacenter/xbmc/scripts/gputemp b/packages/mediacenter/xbmc/scripts/gputemp deleted file mode 100755 index 09cd5802fa..0000000000 --- a/packages/mediacenter/xbmc/scripts/gputemp +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) -# -# OpenELEC is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# OpenELEC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenELEC. If not, see . -################################################################################ - -TEMP="0" - -if [ -x /usr/bin/lspci ] ; then - if lspci -n | grep 0300 | grep -q 10de; then - [ -f /usr/bin/nvidia-smi ] && TEMP=`/usr/bin/nvidia-smi -q -x | grep 'gpu_temp' | awk '{ print $1 }' | sed 's,,,g'` - fi -fi - -echo "${TEMP} C"