From ffe0e5134d65dd71f3e17e187a5096cf6d968151 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 28 Jun 2011 22:52:37 +0000 Subject: [PATCH] * usr/lib/byobu/cpu_temp: LP: #799237 - fix temperature on Atom D510 --- debian/changelog | 2 ++ usr/lib/byobu/cpu_temp | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b3ab0029..4d572ddf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ byobu (4.17) unreleased; urgency=low * usr/bin/byobu-launch: LP: #802646 - ensure that .profile gets sourced if launching byobu by default, but also make sure that we won't recurse! + * usr/lib/byobu/cpu_temp: LP: #799237 + - fix temperature on Atom D510 -- Dustin Kirkland Mon, 27 Jun 2011 14:14:17 +0000 diff --git a/usr/lib/byobu/cpu_temp b/usr/lib/byobu/cpu_temp index 5a993a84..22618e13 100755 --- a/usr/lib/byobu/cpu_temp +++ b/usr/lib/byobu/cpu_temp @@ -19,11 +19,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -CPU_TEMP_DIR="/proc/acpi/thermal_zone" - __cpu_temp_detail() { local i - for i in "$CPU_TEMP_DIR"/*; do + for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /sys/class/hwmon/hwmon*/device/temp*_input /proc/acpi/ibm/thermal /proc/acpi/thermal_zone/*/temperature; do [ -r "$i" ] || continue echo "$i:" cat "$i"/* @@ -32,7 +30,7 @@ __cpu_temp_detail() { __cpu_temp() { local i t unit - for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal "$CPU_TEMP_DIR"/*/temperature; do + for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /sys/class/hwmon/hwmon*/device/temp*_input /proc/acpi/ibm/thermal /proc/acpi/thermal_zone/*/temperature; do case "$i" in *temp*_input) [ -s "$i" ] && read t < "$i" && t=$(($t/1000)) @@ -41,7 +39,7 @@ __cpu_temp() { [ -s "$i" ] && t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i") ;; esac - if [ -n "$t" ]; then + if [ -n "$t" ] && [ "$t" -gt 0 ]; then unit="$ICON_C" if [ "$TEMP" = "F" ]; then t=$(($t*9/5 + 32))