summaryrefslogtreecommitdiff
path: root/INSTALL
blob: 424e3c82eae8f7b4c3519d3c22caebad612d1b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
=============================================================================
INSTALLATION - SHORT INSTRUCTIONS - NON-KERNEL INSTALLATION
=============================================================================

	- Make sure you also have the i2c package installed
	  in the same directory as lm_sensors2
	- rmdir i2c
	- ln -s ../i2c i2c
	- cd i2c
	- make (ignore 'no such file or directory' warnings)
	- (as root) make install
	- cd ../lm_sensors2
	- make (ignore 'no such file or directory' warnings)
	- (as root) make install
	- (as root) prog/mkdev/mkdev.sh        (makes the devices in /dev)
	- (as root) prog/detect/sensors-detect (determines installed hardware)
	- Place the 'modprobe' commands output by sensors-detect in a
	  boot file like /etc/rc.d/rc.multi.
	  Make sure it is after 'depmod -a -e' is run.
	- After those commands, put the line 'sensors -s' in the boot file
	  to initialize the sensors at boot time
	- Place the lines output by sensors-detect in the module
	  configuration file /etc/conf.modules or /etc/modules.conf
	- Reboot
	- Verify correct installation of modules at boot time
	- Use the command 'sensors' to check sensor status.


=============================================================================
=============================================================================

Please read this file thoroughly before you try to install and run things. It
will safe you many headaches. Installation is not really difficult, but there
are a few pitfalls.

ALWAYS READ THE `BUGS' FILE! This file contains a list of known 
incompatibilities with this package. Most are highly kernel-dependent and
usually not fatal, but still.

COMPILATION AND INSTALLATION
============================

Basic installation is uncomplicated. Run `make all', followed by an optional
`make install'. Everything is compiled using the Makefile in the root of
this package. 

You need flex and bison (reportedly a version newer than 1.22). You must
also make sure you have all kernel headers installed properly, including
the ones created during the kernel compilation. Some of the additional
programs in the prog/ subdirectory need Perl and GAWK to run, but you
don't need them to use this package. And you need a fully working compilation
environment, of course; the program should compile against both libc5
and glibc2. Like always, we recommend gcc-2.7.2.3 as the compiler for
kernel modules, but 2.8.1 and any non-buggy egcs version will very
probably work too. The modules in this package should work with any 2.0,
2.1 or 2.2 kernel.

Some interesting Makefile variables:

* SMP
  This must be set to 1 if your kernel was compiled with SMP set to 1. There
  is a sort of magic invocation which tries to check this; it will fail if
  you do not have the correct kernel tree in /usr/src/linux. If you set it,
  a `-D__SMP__' argument will be added to all module compiles.
* MODVER
  This must be set to 1 if your kernel was compiled with CONFIG_MODVERSIONS
  enabled. There is some magic which tries to retrieve this information
  from /usr/include/linux/config.h and /usr/include/linux/autoconf.h.
* I2C
  If you already have Simon Vogl's i2c package installed, you may not have
  to compile the version included in this package. In that case, check
  the file i2c/MODIFICATIONS in this package to see what versions are
  safe.
* WARN, DEBUG
  These options should only be needed if you are an active developer of
  this package.
* PREFIX (/usr/local)
  The prefix which is added to most directory locations below.
* MODDIR (/lib/modules/extra/misc)
  The directory where `make install' installs your modules.
* ETCDIR (/etc)
  The directory where `make install' installs the example configuration file
  if none is found there.
* LIBDIR ($(PREFIX)/lib)
  The directory where `make install' installs the shared and static libraries.
* BINDIR ($(PREFIX)/bin)
  The directory where `make install' installs all executables.
* SBINDIR ($(PREFIX)/sbin)
  The directory where `make install' installs all system programs (programs
  which can only be run by root).
* INCLUDEDIR ($(PREFIX)/include)
  The base directory where `make install' installs your include files.
  Actually, SYSINCLUDEDIR ($(INCLUDEDIR)/linux) is used for kernel header
  files, and LIBINCLUDEDIR ($(INCLUDEDIR)/sensors) is used for library
  header files.
* MANDIR ($(PREFIX)/man)
  The base directory where manual pages are installed. 
* MANOWN, MANGRP (root, root)
  Owner and group of installed manual pages

Warning! In 2.2 and newer 2.1 kernels, there is support for I2C. This support 
is NOT compatible with this module! Actually, Simon Vogl's modules package 
(which IS compatible) is scheduled to replace the current support. If you
actually use these modules, you have a problem; they can not coexist
with Simon's modules. Theoretically, you should be able to replace
the old modules in the kernel tree with the new stuff in our i2c directory,
recompile the kernel, and then compile our modules with I2C=0. If you try
this, please share the results with us! There have also been some rumors
about the peaceful coexistence of both sets of modules, but others found
some problems with it.

Please make sure that /usr/include/linux and /usr/include/asm are symlinks 
into the kernel tree which corresponds with the kernel version you are using
now (or more exactly, the kernel which you will use the compiled modules 
with). If the tree and the running kernel do not match, you will either
be unable to insert the modules at all, or you can expect strange 
behaviour (probably leading to crashes).

If you do a `make install', remember to do a `depmod -a' and a `ldconfig'
to make sure the new modules and shared libraries are recognized. If you
set PREFIX to anything different from `/' or `/usr' (it is `usr/local'
by default), check whether /etc/ld.so.conf contains the library directory
(like `/usr/local/lib') before you do the `ldconfig'.

Do no worry about the `No such file or directory' warnings when you compile
the package the first time. They are harmless.


TESTING AND RUNNING
===================

When you have compiled this package, you will be left with a lot of modules.
It can be tricky to know which modules you need to insert. For this reason,
I suggest you go the `modprobe' way, as described within doc/modules.

If you just want to run a test without installing them, try the following:
  insmod i2c/i2c-core.o
  insmod kernel/smbus.o
  insmod kernel/i2c-proc.o
  insmod kernel/i2c-dev.o
  insmod kernel/sensors.o
  insmod kernel/busses/i2c-isa.o
  insmod kernel/busses/i2c-piix4.o # Or whatever SMBus controller you have
  insmod kernel/chips/lm78.o   # Or whatever hardware monitoring chip you have
Now you should have new directories under /proc/sys/dev/sensors and some files
beginning with i2c in /proc/bus.

If you have installed the modules, as described within doc/modules, you can
do:
  modprobe i2c-isa && modprobe i2c-piix4 && modprobe lm78 && modprobe i2c-proc
(the last is optional) from any directory to reach the same situation.

But instead of doing any of the above things, please read doc/modules and
do a `make install'. After that, you can run `sensors-detect'. This Perl
program will detect all hardware available on your system, and tell you
what drivers you need to insert. First check whether you have /dev/i2c-*
files (at least 4 of them), and if not, create them by running `mkdev.sh'
in directory prog/mkdev.

Do not panic if some (or all) of the values in the /proc/sys/dev/sensors/*/*
files do not seem to correspond to anything in earlier versions. Starting
with lm_sensors version 2.1.0, these files will reflect the real chip
measurements, without any scaling or adjusting. This is most obvious for
the voltage files. You can specify the conversion factors in a configuration
file.  Use an application linked to libsensors to read these real values.

This package contains a library of functions which can be used to
access sensor data in a more programmer-friendly way. It will be built as
both a shared and a static library, and installed in your LIB directory
(normally /usr/local/lib). It needs a configuration file, which is usually
called `sensors.conf', and can be placed in /etc, /usr/lib/sensors,
/usr/local/lib/sensors, /usr/lib, or /usr/local/lib.

Note that if you already have a config file, it is NOT overwritten! You
may still want to do this by hand (`cp etc/sensors.conf.eg /etc/sensors.conf')
as the example config file may be updated.

Where version 1 of this package had the human-readable /proc/sensors file,
this version includes a user-space program which gathers all data
and displays it in a comparable format. This program is called `sensors'.
Everybody can use it to read sensors values; only root can use it to
set minimum and maximum values (using the `-s' switch).

If you want to run `sensors' without installing the package, you must
use the following command to make it able to find its shared library:
  (bash) export LD_LIBRARY_PATH=/WHEREVER/lm_sensors-2.X.Y/lib:$LD_LIBRARY_PATH
  (tcsh) setenv LD_LIBRARYPATH /WHEREVER/lm_sensors-2.X.Y/lib:$LD_LIBRARY_PATH
Replace /WHEREVER/lm_sensors-2.X.Y with the base directory of the package
source code.

Please examine the files in the doc subdirectory for more information, 
especially about individual drivers. You can always mail us at 
<lm78@stimpy.netroedge.com>. Alternatively, consider useing the (free)
support site at http://www.netroedge.com/~lm78/support.html. Good luck!


USEFUL PROGRAMS
===============

The prog subdirectory contains lots of useful programs, many of which are
not installed. doc/progs contains some documentation for each of them.
Most important are prog/mkdev/mkdev.sh, which creates /dev/i2c-* files,
and prog/detect/sensors-detect, which tries to detect what adapters are
present on your system.