lm_sensors 2.7.0 インストール (2004-09-29) †
GNU Goとか動作させてる時は、排気がかなり熱くなる。そこで、CPUの温度とか知りたいと思いlm_sensorsを入れてみることにした。
なお、なぜ最新のlm_sensors-2.8.7を使わないかというと、kernelにすでにi2cモジュールが入っており、しかもバージョンが2.7.0なのでi2c-2.8.1以上が必要なlm_sensors-2.8.7はコンパイル通らなかったため(T-T)
- 事前にapt-get必要なもの
- kernel-headers
- bison
- flex
(kernel-sourcesが必要かと思ったが、そうでもないみたい)
- コンパイル
まず、/usr/src/linux/.config ファイルが必要です。
/usr/src/linux/configs の中に以下ファイルがあるので、自分の使用しているカーネルに合ったconfigファイルをコピーします。
# cd /usr/src/linux/
# ls configs
kernel-2.4.26-athlon-smp.config kernel-2.4.26-i586-smp.config
kernel-2.4.26-athlon.config kernel-2.4.26-i586.config
kernel-2.4.26-i386-BOOT.config kernel-2.4.26-i686-smp.config
kernel-2.4.26-i386-smp.config kernel-2.4.26-i686.config
kernel-2.4.26-i386.config
# cp kernel-2.4.26-i686.config .config
lm_sensors をコンパイルします。
$ tar zxvf lm_sensors-2.7.0.tar.gz
$ cd lm_sensors-2.7.0
$ make
$ su
# make install
- モジュールdetect
どういう設定をすればいいのか、調査して教えてくれるプログラムがあるので、やってみる。
んで、うちのマザボはAOpen AX3S Proなんで、チップはi815E。
(コンパイルに続けて行う前提です。)
# export PATH=$PATH:/sbin ←modprobeを使うので(特に困らないけど(^^;)
# prog/detect/sensors-detect
(いろいろ聞かれますが、トントンとリターン押してくと。。。)
・
・
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 00:1f.3: Intel 82801BA ICH2
Use driver `i2c-riva' for device 01:0a.0: RIVA TNT
Probe succesfully concluded.
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
Load `i2c-riva' (say NO if built into your kernel)? (YES/no):
modprobe: Can't locate module i2c-riva
Loading failed... skipping.
・
・
Probing for `Winbond W83627HF'
Character in 'C' format wrapped in pack at ./sensors-detect line 1137.
Trying address 0x0290... Success!
(confidence 8, driver `w83781d')
・
・
WARNING! If you have some things built into your kernel, the
below list will contain too many modules. Skip the appropriate ones!
To load everything that is needed, add this to some /etc/rc* file:
#----cut here----
# I2C adapter drivers
modprobe i2c-isa
# I2C chip drivers
modprobe w83781d
#----cut here----
To make the sensors modules behave correctly, add these lines to either
/etc/modules.conf or /etc/conf.modules:
#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): y
Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
for initialization at boot time.
i2c-rivaがごちゃごちゃ言われるので調べてみると、i2c-rivaってのはvideo4linuxのRIVAカード向けドライバみたいで、I2Cのモジュールも提供するらしい。とりあえずいらない。
Winbond W83627HFちゅう〜のはなんじゃらほい?とか思ったら。スーパーI/Oチップとかで古いI/OのIrDA、シリアル、パラレル、FDC、ハードウェアモニター(CPU温度および電圧ステータスモニター)らしい。って本命じゃん(^o^; 念のためにAOpenのサイトでボードの写真を見てみたら、しっかりコイツが載ってたよ。
- 設定
/etc/modules.conf に
alias char-major-89 i2c-dev
を追加。
/etc/sysconfig/lm_sensors にはすでにファイルがコピーされてるので、改めてコピーの必要なし。
んで、/etc/sysconfig/lm_sensors の内容を読み込んで カーネルモジュールをロードするように、サービスを登録する。
(lm_sensorsを展開・コンパイルしたディレクトリから)
# cp prog/init/lm_sensors.init /etc/rc.d/init.d/lm_sensors
# /sbin/chkconfig --add lm_sensors
ここまで終わったら、一旦リブート。
- 実行確認
sensorsコマンドを実行してみて、以下のように表示されればオッケー。
$ sensors
w83627hf-isa-0290
Adapter: ISA adapter
Algorithm: ISA algorithm
VCore 1: +1.64 V (min = +1.48 V, max = +1.80 V)
VCore 2: +1.84 V (min = +1.48 V, max = +1.80 V)
+3.3V: +3.36 V (min = +2.97 V, max = +3.63 V)
+5V: +5.04 V (min = +4.50 V, max = +5.48 V)
+12V: +11.97 V (min = +10.79 V, max = +13.11 V)
-12V: -12.29 V (min = -13.21 V, max = -10.90 V)
-5V: -5.10 V (min = -5.51 V, max = -4.51 V)
V5SB: +5.56 V (min = +4.50 V, max = +5.48 V)
VBat: +3.28 V (min = +2.70 V, max = +3.29 V) ALARM
fan1: 4354 RPM (min = 3000 RPM, div = 2)
fan2: 0 RPM (min = 3000 RPM, div = 2)
fan3: 0 RPM (min = 3000 RPM, div = 2)
temp1: +38庵 (limit = +60庵) sensor = thermistor
temp2: +33.5庵 (limit = +60庵, hysteresis = +50庵) sensor = PII/Celeron diode
temp3: +127.5庵 (limit = +60庵, hysteresis = +50庵) sensor = PII/Celeron diode ALARM
vid: +1.650 V
alarms:
beep_enable:
Sound alarm disabled
GKerllM2 の始めから付いて来る「センサ」表示機能にて表示すると、こんな感じ。

上記は起動時の温度。安定するとM/B温度は39℃、CPU温度は30℃くらい。seti@homeのクライアントを使ってみると、M/B温度はさほど変わらないものの、CPU温度は50℃突破しちゃう(^O^; 筐体のカバーを開けると8℃ほど下がるんですが。。。空気の流れが悪いのかな。