| 1 |
Please read this file thoroughly before you try to install and run things. It |
|---|
| 2 |
will safe you many headaches. Installation is not really difficult, but there |
|---|
| 3 |
are a few pitfalls. |
|---|
| 4 |
|
|---|
| 5 |
ALWAYS READ THE `BUGS' FILE! This file contains a list of known |
|---|
| 6 |
incompatibilities with this package. Most are highly kernel-dependent and |
|---|
| 7 |
usually not fatal, but still. |
|---|
| 8 |
|
|---|
| 9 |
COMPILATION AND INSTALLATION |
|---|
| 10 |
============================ |
|---|
| 11 |
|
|---|
| 12 |
Basic installation is uncomplicated. Run 'make all', followed by an optional |
|---|
| 13 |
'make install'. Everything is compiled using the Makefile in the root of |
|---|
| 14 |
this package. |
|---|
| 15 |
|
|---|
| 16 |
You need flex and bison (reportedly a version newer than 1.22). You must |
|---|
| 17 |
also make sure you have all kernel headers installed properly, including |
|---|
| 18 |
the ones created during the kernel compilation. Some of the additional |
|---|
| 19 |
programs in the prog/ subdirectory need Perl and GAWK to run, but you |
|---|
| 20 |
don't need them to use this package. And you need a fully working compilation |
|---|
| 21 |
environment, of course; the program should compile against both libc5 |
|---|
| 22 |
and glibc2. Like always, we recommend gcc-2.7.2.3 as the compiler for |
|---|
| 23 |
kernel modules, but 2.8.1 and any non-buggy egcs version will very |
|---|
| 24 |
probably work too. The modules in this package should work with any 2.0, |
|---|
| 25 |
2.1 or 2.2 kernel. |
|---|
| 26 |
|
|---|
| 27 |
Some interesting Makefile variables: |
|---|
| 28 |
|
|---|
| 29 |
* SMP |
|---|
| 30 |
This must be set to 1 if your kernel was compiled with SMP set to 1. There |
|---|
| 31 |
is a sort of magic invocation which tries to check this; it will fail if |
|---|
| 32 |
you do not have the correct kernel tree in /usr/src/linux. If you set it, |
|---|
| 33 |
a '-D__SMP__' argument will be added to all module compiles. |
|---|
| 34 |
* MODVER |
|---|
| 35 |
This must be set to 1 if your kernel was compiled with CONFIG_MODVERSIONS |
|---|
| 36 |
enabled. There is some magic which tries to retrieve this information |
|---|
| 37 |
from /usr/include/linux/config.h and /usr/include/linux/autoconf.h. |
|---|
| 38 |
* I2C |
|---|
| 39 |
If you already have Simon Vogl's i2c package installed, you may not have |
|---|
| 40 |
to compile the version included in this package. In that case, check |
|---|
| 41 |
the file i2c/MODIFICATIONS in this package to see what versions are |
|---|
| 42 |
safe. |
|---|
| 43 |
* WARN, DEBUG |
|---|
| 44 |
These options should only be needed if you are an active developer of |
|---|
| 45 |
this package. |
|---|
| 46 |
* PREFIX (/usr/local) |
|---|
| 47 |
The prefix which is added to most directory locations below. |
|---|
| 48 |
* MODDIR (/lib/modules/extra/misc) |
|---|
| 49 |
The directory where 'make install' installs your modules. |
|---|
| 50 |
* ETCDIR (/etc) |
|---|
| 51 |
The directory where 'make install' installs the example configuration file |
|---|
| 52 |
if none is found there. |
|---|
| 53 |
* LIBDIR ($(PREFIX)/lib) |
|---|
| 54 |
The directory where 'make install' installs the shared and static libraries. |
|---|
| 55 |
* BINDIR ($(PREFIX)/bin) |
|---|
| 56 |
The directory where 'make install' installs all executables. |
|---|
| 57 |
* INCLUDEDIR ($(PREFIX)/include) |
|---|
| 58 |
The base directory where 'make install' installs your include files. |
|---|
| 59 |
Actually, SYSINCLUDEDIR ($(INCLUDEDIR)/linux) is used for kernel header |
|---|
| 60 |
files, and LIBINCLUDEDIR ($(INCLUDEDIR)/sensors) is used for library |
|---|
| 61 |
header files. |
|---|
| 62 |
* MANDIR ($(PREFIX)/man) |
|---|
| 63 |
The base directory where manual pages are installed. |
|---|
| 64 |
* MANOWN, MANGRP (root, root) |
|---|
| 65 |
Owner and group of installed manual pages |
|---|
| 66 |
|
|---|
| 67 |
Warning! In 2.2 and newer 2.1 kernels, there is support for I2C. This support |
|---|
| 68 |
is NOT compatible with this module! Actually, Simon Vogl's modules package |
|---|
| 69 |
(which IS compatible) is scheduled to replace the current support. If you |
|---|
| 70 |
actually use these modules, you have a problem; they can not coexist |
|---|
| 71 |
with Simon's modules. Theoretically, you should be able to replace |
|---|
| 72 |
the old modules in the kernel tree with the new stuff in our i2c directory, |
|---|
| 73 |
recompile the kernel, and then compile our modules with I2C=0. If you try |
|---|
| 74 |
this, please share the results with us! There have also been some rumors |
|---|
| 75 |
about the peaceful coexistence of both sets of modules, but others found |
|---|
| 76 |
some problems with it. |
|---|
| 77 |
|
|---|
| 78 |
Please make sure that /usr/include/linux and /usr/include/asm are symlinks |
|---|
| 79 |
into the kernel tree which corresponds with the kernel version you are using |
|---|
| 80 |
now (or more exactly, the kernel which you will use the compiled modules |
|---|
| 81 |
with). If the tree and the running kernel do not match, you will either |
|---|
| 82 |
be unable to insert the modules at all, or you can expect strange |
|---|
| 83 |
behaviour (probably leading to crashes). |
|---|
| 84 |
|
|---|
| 85 |
If you do a 'make install', remember to do a 'depmod -a' and a 'ldconfig' |
|---|
| 86 |
to make sure the new modules and shared libraries are recognized. |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
TESTING AND RUNNING |
|---|
| 90 |
=================== |
|---|
| 91 |
|
|---|
| 92 |
When you have compiled this package, you will be left with a lot of modules. |
|---|
| 93 |
It can be tricky to know which modules you need to insert. For this reason, |
|---|
| 94 |
I suggest you go the 'modprobe' way, as described within doc/modules. |
|---|
| 95 |
If you just want to run a test without installing them, try the following: |
|---|
| 96 |
insmod i2c/i2c-core.o |
|---|
| 97 |
insmod kernel/i2c-proc.o |
|---|
| 98 |
insmod kernel/i2c-dev.o |
|---|
| 99 |
insmod kernel/smbus.o |
|---|
| 100 |
insmod kernel/sensors.o |
|---|
| 101 |
insmod kernel/busses/i2c-isa.o |
|---|
| 102 |
insmod kernel/busses/i2c-piix4.o # Or whatever SMBus controller you have |
|---|
| 103 |
insmod kernel/chips/lm78.o # Or whatever hardware monitoring chip you have |
|---|
| 104 |
Now you should have new directories under /proc/sys/dev/sensors and some files |
|---|
| 105 |
beginning with i2c in /proc/bus. |
|---|
| 106 |
|
|---|
| 107 |
If you have installed the modules, as described within doc/modules, you can |
|---|
| 108 |
do: |
|---|
| 109 |
modprobe i2c-isa && modprobe i2c-piix4 && modprobe lm78 && modprobe i2c-proc |
|---|
| 110 |
(the last is optional) from any directory to reach the same situation. |
|---|
| 111 |
|
|---|
| 112 |
There is a program 'detect.pl' in prog/detect which should tell you at least |
|---|
| 113 |
what bus driver you should insert. This program is not completely failsafe, |
|---|
| 114 |
but it may at least help. It will be expanded to cover chip detection too, |
|---|
| 115 |
in the future. |
|---|
| 116 |
|
|---|
| 117 |
Do not panic if some (or all) of the values in the /proc/sys/dev/sensors/*/* |
|---|
| 118 |
files do not seem to correspond to anything in earlier versions. Starting |
|---|
| 119 |
with lm_sensors version 2.1.0, these files will reflect the real chip |
|---|
| 120 |
measurements, without any scaling or adjusting. This is most obvious for |
|---|
| 121 |
the voltage files. You can specify the conversion factors in a configuration |
|---|
| 122 |
file. Use an application linked to libsensors to read these real values. |
|---|
| 123 |
|
|---|
| 124 |
This package contains a library of functions which can be used to |
|---|
| 125 |
access sensor data in a more programmer-friendly way. It will be built as |
|---|
| 126 |
both a shared and a static library, and installed in your LIB directory |
|---|
| 127 |
(normally /usr/local/lib). It needs a configuration file, which is usually |
|---|
| 128 |
called 'sensors.conf', and can be placed in /etc, /usr/lib/sensors, |
|---|
| 129 |
/usr/local/lib/sensors, /usr/lib, or /usr/local/lib. |
|---|
| 130 |
|
|---|
| 131 |
Note that if you already have a config file, it is NOT overwritten! You |
|---|
| 132 |
may still want to do this by hand (`cp etc/sensors.conf.eg /etc/sensors.conf') |
|---|
| 133 |
as the example config file may be updated. |
|---|
| 134 |
|
|---|
| 135 |
Where version 1 of this package had the human-readable /proc/sensors file, |
|---|
| 136 |
this version includes a user-space program which gathers all data |
|---|
| 137 |
and displays it in a comparable format. This program is called 'sensors'. |
|---|
| 138 |
Everybody can use it to read sensors values; only root can use it to |
|---|
| 139 |
set minimum and maximum values (using the `-s' switch). |
|---|
| 140 |
|
|---|
| 141 |
If you want to run 'sensors' without installing the package, you must |
|---|
| 142 |
use the following command to make it able to find its shared library: |
|---|
| 143 |
(bash) export LD_LIBRARY_PATH=/WHEREVER/lm_sensors-2.X.Y/lib:$LD_LIBRARY_PATH |
|---|
| 144 |
(tcsh) setenv LD_LIBRARYPATH /WHEREVER/lm_sensors-2.X.Y/lib:$LD_LIBRARY_PATH |
|---|
| 145 |
Replace /WHEREVER/lm_sensors-2.X.Y with the base directory of the package |
|---|
| 146 |
source code. |
|---|
| 147 |
|
|---|
| 148 |
Please examine the files in the doc subdirectory for more information, |
|---|
| 149 |
especially about individual drivers. You can always mail us at |
|---|
| 150 |
<lm78@stimpy.netroedge.com>. Alternatively, consider useing the (free) |
|---|
| 151 |
support site at http://www.netroedge.com/~lm78/support.html. Good luck! |
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
USEFUL PROGRAMS |
|---|
| 155 |
=============== |
|---|
| 156 |
|
|---|
| 157 |
The prog subdirectory contains lots of useful programs, many of which are |
|---|
| 158 |
not installed. doc/progs contains some documentation for each of them. |
|---|
| 159 |
Most important are prog/mkdev/mkdev.sh, which creates /dev/i2c-* files, |
|---|
| 160 |
and prog/detect/dectect.pl, which tries to detect what adapters are |
|---|
| 161 |
present on your system. |
|---|