ThinkPad Fan Control

Aus ThinkPad-Wiki
Version vom 20. Dezember 2011, 22:31 Uhr von Linrunner (Diskussion | Beiträge) (kein Support für T420(s)/T520/W520/X220)

Einleitung

GUI von Thinkpad Fan Control

Thinkpad Fan Control (auch als tp-fan oder tpfand bekannt) ist eine Software zur Lüftersteuerung für Linux. Im Unterschied zu Thinkfan beinhaltet Thinkpad Fan Control eine GUI zur Einstellung der Temperaturschwellen. Leider wird das ursprüngliche tp-fan von seinem Autor seit Mitte 2009 nicht mehr gewartet. Seit September 2011 gibt es ein neues Projekt namens tpfanco, das sich um die Wartung des Codes von tp-fan und die Erstellung von aktuellen Ubuntu-Paketen kümmert.

Voraussetzungen

Unterstützt werden alle ThinkPad-Modelle bei denen das Kernelmodul thinkpad_acpi geladen werden kann. Ausnahmen sind:

  • T420(s)/T520/W520/X220: keine Unterstützung für /proc/acpi/ibm/thermal
  • SL300/400/500: keine Unterstützung für thinkpad_acpi
  • L-, Edge-Reihe, X100e: benötigt Ubuntu 10.10 mit Kernel 2.6.35 (oder höher), alternativ 10.04 mit tp-Kernel 2.6.32

Installation

Ältere Ubuntu-Versionen (bis Ubuntu 9.10)

Für Ubuntu-Versionen bis einschließlich Karmic Koala, (d.h Ubuntu 8.04, Ubuntu 8.10, Ubuntu 9.04 und Ubuntu 9.10) lädt man die drei für 9.04 bestimmten Pakete von Hand aus dem alten tp-fan PPA herunter und installiert sie:

Neuere Ubuntu-Versionen (ab Ubuntu 10.04)

Für Ubuntu-Versionen ab Lucid Lynx (d.h Ubuntu 10.04, Ubuntu 10.10, Ubuntu 11.04) lädt man die neuesten Pakete von tpfanco. Zuerst installiert man tpfand, danach auch tpfan-admin und tpfan-profiles. Nach der Installation ist ein Neustart erforderlich. Auch Kubuntu und Xubuntu werden unterstützt.

Konfiguration

Nach der Installation ruft man die Konfiguration mit "System -> Systemeinstellungen -> ThinkPad Fan Control" auf.

Veraltete Informationen

Achtung!!! Nachfolgende Anleitungen sind veraltet, teilweise unvollständig und sollten nicht mehr genutzt werden. Sie werden hier lediglich der Vollständigkeit halber bereitgestellt. Für aktuelle Ubuntu-Versionen sollen stattdessen die tpfanco-Pakete verwendet werden!

Ubuntu 10.10

Um ThinkPad Fan Control unter Ubuntu 10.10 zu nutzen, müssen die vorhandenen Pakete entsprechend angepasst werden. Dafür gibt es zwei Gründe:

  • zur Bestimmung des Thinkpad-Modells verwendet tpfan die ab Ubuntu 10.10 nicht mehr vorhandene HAL-Schnittstelle
  • tpfan-admin hängt vom Paket python-gnome2-desktop, welches ab Ubuntu 10.10 ebenfalls nicht mehr vorhanden ist

Für diese Probleme gibt es folgende Lösungen

  • ein Patch für tpfan sorgt dafür, dass die Modellbestimmung über lshw funktioniert
  • python-gnome2-desktop-Abhängigkeit von tpfan-admin muss durch python-rsvg ersetzt werden

All das lässt sich vollautomatisch erledigen. Zuerst installiert man das Paket patch:

sudo apt-get install patch

Anschließend öffnet man die Kommandozeile und gibt folgende Befehle ein

cd ~
echo "Patching tpfan-admin"
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfan-admin/tpfan-admin_0.96-ubuntu1_all.deb
dpkg-deb -x tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched
dpkg-deb -e tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched/DEBIAN
sed -i 's/python-gnome2-desktop (>= 2.22)/python-rsvg (>=2.30.0)/g' tpfan-admin_0.96-ubuntu1_all_patched/DEBIAN/control
dpkg-deb -b tpfan-admin_0.96-ubuntu1_all_patched
rm -r tpfan-admin_0.96-ubuntu1_all_patched tpfan-admin_0.96-ubuntu1_all.deb
echo "Patching tpfand"
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand/tpfand_0.95-ubuntu1_all.deb
dpkg-deb -x tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched
dpkg-deb -e tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched/DEBIAN
wget https://bugs.launchpad.net/tp-fan/+bug/575199/+attachment/1702159/+files/tpfan_nohal.patch
patch tpfand_0.95-ubuntu1_all_patched/usr/share/pyshared/tpfand/settings.py -i tpfan_nohal.patch -o tpfand_0.95-ubuntu1_all_patched/usr/share/pyshared/tpfand/settings_patch.py
mv tpfand_0.95-ubuntu1_all_patched/usr/share/pyshared/tpfand/settings_patch.py tpfand_0.95-ubuntu1_all_patched/usr/share/pyshared/tpfand/settings.py
dpkg-deb -b tpfand_0.95-ubuntu1_all_patched
rm -r tpfand_0.95-ubuntu1_all.deb tpfan_nohal.patch tpfand_0.95-ubuntu1_all_patched
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand-profiles/tpfand-profiles_20090309-ubuntu1_all.deb

Die Warnungen seitens dpkg-deb können ignoriert werden. Anschließend findet man in seinem Home-Verzeichnis folgende Dateien:

tpfand_0.95-ubuntu1_all_patched.deb
tpfan-admin_0.96-ubuntu1_all_patched.deb
tpfand-profiles_20090309-ubuntu1_all.deb

Diese sollen in genau dieser Reihenfolge durch Doppelklicken installiert werden. Danach am besten den Rechner neustarten, damit die vorhandenen Profile verwendet werden können. Nach dem Neustart ruft man die Konfiguration mit "System -> Systemeinstellungen -> ThinkPad Fan Control" auf.

Kubuntu 10.10

Um ThinkPad Fan Control unter Kubuntu 10.10 zu nutzen, müssen die vorhandenen Pakete entsprechend angepasst werden. Dafür gibt es drei Gründe:

  • zur Bestimmung des Thinkpad-Modells verwendet tpfan die ab Ubuntu 10.10 nicht mehr vorhandene HAL-Schnittstelle
  • tpfan-admin hängt vom Paket python-gnome2-desktop, welches ab Ubuntu 10.10 ebenfalls nicht mehr vorhanden ist
  • um root-Rechte zu erlangen, setzt tpfan-admin auf gksu, was unter KDE nicht wirklich reibungslos funktioniert

Für diese Probleme gibt es folgende Lösungen

  • ein Patch für tpfan sorgt dafür, dass die Modellbestimmung über lshw funktioniert
  • python-gnome2-desktop-Abhängigkeit von tpfan-admin muss durch python-rsvg ersetzt werden
  • gksu-Aufrufe im Quellcode müssen durch kdesudo ersetzt werden.

All das lässt sich vollautomatisch erledigen. Zuerst installiert man das Paket patch:

sudo apt-get install patch

Anschließend öffnet man die Kommandozeile und gibt folgende Befehle ein

cd ~
echo "Patching tpfan-admin for Kubuntu"
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfan-admin/tpfan-admin_0.96-ubuntu1_all.deb
dpkg-deb -x tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched_KDE
dpkg-deb -e tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched_KDE/DEBIAN
sed -i 's/python-gnome2-desktop (>= 2.22)/python-rsvg (>=2.30.0)/g' tpfan-admin_0.96-ubuntu1_all_patched_KDE/DEBIAN/control
sed -i 's/gksu (>= 2.0)/kdesudo (>= 2.5)/g' tpfan-admin_0.96-ubuntu1_all_patched_KDE/DEBIAN/control
sed -i 's/gksu/kdesudo/;s/--message/--comment/g' tpfan-admin_0.96-ubuntu1_all_patched_KDE/usr/share/pyshared/tpfanadmin/build.py
dpkg-deb -b tpfan-admin_0.96-ubuntu1_all_patched_KDE
rm -r tpfan-admin_0.96-ubuntu1_all_patched_KDE tpfan-admin_0.96-ubuntu1_all.deb
echo "Patching tpfand for Kubuntu"
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand/tpfand_0.95-ubuntu1_all.deb
dpkg-deb -x tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched_KDE
dpkg-deb -e tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched_KDE/DEBIAN
wget https://bugs.launchpad.net/tp-fan/+bug/575199/+attachment/1702159/+files/tpfan_nohal.patch
patch tpfand_0.95-ubuntu1_all_patched_KDE/usr/share/pyshared/tpfand/settings.py -i tpfan_nohal.patch -o tpfand_0.95-ubuntu1_all_patched_KDE/usr/share/pyshared/tpfand/settings_patch.py
mv tpfand_0.95-ubuntu1_all_patched_KDE/usr/share/pyshared/tpfand/settings_patch.py tpfand_0.95-ubuntu1_all_patched_KDE/usr/share/pyshared/tpfand/settings.py
dpkg-deb -b tpfand_0.95-ubuntu1_all_patched_KDE
rm -r tpfand_0.95-ubuntu1_all.deb tpfan_nohal.patch tpfand_0.95-ubuntu1_all_patched_KDE
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand-profiles/tpfand-profiles_20090309-ubuntu1_all.deb

Die Warnungen seitens dpkg-deb können ignoriert werden. Anschließend findet man in seinem Home-Verzeichnis folgende Dateien:

tpfand_0.95-ubuntu1_all_patched_KDE.deb
tpfan-admin_0.96-ubuntu1_all_patched_KDE.deb
tpfand-profiles_20090309-ubuntu1_all.deb

Diese sollen in genau dieser Reihenfolge durch Doppelklicken installiert werden. Danach am besten den Rechner neustarten, damit die vorhandenen Profile verwendet werden können. Nach dem Neustart ruft man die Konfiguration mit "KDE -> Anwendungen -> System -> ThinkPad Fan Control" auf.

Ubuntu 11.04

Um ThinkPad Fan Control unter Ubuntu 11.04 zu nutzen, müssen die vorhandenen Pakete entsprechend angepasst werden. Dafür gibt es einige Gründe:

  • zur Bestimmung des Thinkpad-Modells verwendet tpfan die ab Ubuntu 11.04 nicht mehr vorhandene HAL-Schnittstelle
  • tpfan-admin hängt vom Paket python-gnome2-desktop, welches ab Ubuntu 11.04 ebenfalls nicht mehr vorhanden ist

Für diese Probleme gibt es folgende Lösungen

  • ein Patch für tpfan sorgt dafür, dass die Modellbestimmung über dmidecode
  • python-gnome2-desktop-Abhängigkeit von tpfan-admin muss durch python-rsvg ersetzt werden

All das lässt sich vollautomatisch erledigen. Zuerst installiert man das Paket patch:

sudo apt-get install patch

Anschließend öffnet man die Kommandozeile und gibt folgende Befehle ein

cd ~
# Patching tpfan-admin
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfan-admin/tpfan-admin_0.96-ubuntu1_all.deb
dpkg-deb -x tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched
dpkg-deb -e tpfan-admin_0.96-ubuntu1_all.deb tpfan-admin_0.96-ubuntu1_all_patched/DEBIAN
sed -i 's/python-gnome2-desktop (>= 2.22)/python-rsvg (>=2.30.0)/g' tpfan-admin_0.96-ubuntu1_all_patched/DEBIAN/control
# This is needed to make our package pass the lintian-check
sed -i 's/# Please also look if there are files or directories which have a//g' tpfan-admin_0.96-ubuntu1_all_patched/usr/share/doc/tpfan-admin/copyright
sed -i 's/# different copyright\/license attached and list them here.//g' tpfan-admin_0.96-ubuntu1_all_patched/usr/share/doc/tpfan-admin/copyright
chmod +x tpfan-admin_0.96-ubuntu1_all_patched/usr/share/tpfan-admin/open-url.sh
cd tpfan-admin_0.96-ubuntu1_all_patched
find usr/ -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums 
cd ~
# Building the package
fakeroot dpkg-deb -b tpfan-admin_0.96-ubuntu1_all_patched
rm -r tpfan-admin_0.96-ubuntu1_all_patched tpfan-admin_0.96-ubuntu1_all.deb
# Patching tpfand
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand/tpfand_0.95-ubuntu1_all.deb
dpkg-deb -x tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched
dpkg-deb -e tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched/DEBIAN
cd tpfand_0.95-ubuntu1_all_patched/usr/share/pyshared/
wget https://launchpadlibrarian.net/70852691/tpfan_dmidecode.patch
patch -p0 < tpfan_dmidecode.patch
rm tpfan_dmidecode.patch
cd ~
sed -i 's/python-dbus (>= 0.82)/python-dbus (>= 0.82), python-dmidecode (>= 3.10)/g' tpfand_0.95-ubuntu1_all_patched/DEBIAN/control
# This is needed to make our package pass the lintian-check
cd tpfand_0.95-ubuntu1_all_patched
find usr/ -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums 
cd ~
sed -i 's/Required-Start:    $syslog $time/Required-Start:    $remote_fs $syslog $time/g' tpfand_0.95-ubuntu1_all_patched/etc/init.d/tpfand
sed -i 's/Required-Stop:     $syslog $time/Required-Stop:     $remote_fs $syslog $time/g' tpfand_0.95-ubuntu1_all_patched/etc/init.d/tpfand
sed -i 's/*)/force-reload)\n        $0 restart\n        ;;\n&\n /g' tpfand_0.95-ubuntu1_all_patched/etc/init.d/tpfand
sed -i 's/restart}/restart|force-reload}/g' tpfand_0.95-ubuntu1_all_patched/etc/init.d/tpfand
# Building the package
fakeroot dpkg-deb -b tpfand_0.95-ubuntu1_all_patched
rm -r tpfand_0.95-ubuntu1_all.deb tpfand_0.95-ubuntu1_all_patched
wget http://ppa.launchpad.net/tp-fan/ppa/ubuntu/pool/main/t/tpfand-profiles/tpfand-profiles_20090309-ubuntu1_all.deb

Die Warnungen seitens dpkg-deb können ignoriert werden. Anschließend findet man in seinem Home-Verzeichnis folgende Dateien:

tpfand_0.95-ubuntu1_all_patched.deb
tpfan-admin_0.96-ubuntu1_all_patched.deb
tpfand-profiles_20090309-ubuntu1_all.deb

Diese sollen in genau dieser Reihenfolge durch Doppelklicken installiert werden. Danach am besten den Rechner neustarten, damit die vorhandenen Profile verwendet werden können. Nach dem Neustart ruft man die Konfiguration mit "System -> Systemeinstellungen -> ThinkPad Fan Control" auf.

Links