root/lm-sensors/tags/V2-8-4/INSTALL

Revision 2145, 15.8 kB (checked in by mds, 5 years ago)

doc update 2 (2.4 and bttv)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 =============================================================================
2
3 DETAILED INSTALLATION INSTRUCTIONS
4 See QUICKSTART for the simple version.
5
6 The driver modules in this package are ONLY for 2.4 kernels 2.4.9 or later !!!
7
8 This package REQUIRES i2c-2.8.1 or later!!!
9
10 FOR 2.5/2.6 KERNELS, do not attempt to compile this package.
11     Use the drivers already in the 2.5/2.6 kernel tree.
12     If you are running a 2.5/2.6 kernel, the ONLY thing you need to
13     do is 'make user' and 'make user_install'. Do NOT follow the rest
14     of these instructions.
15
16 IF YOU REQUIRE  BTTV AND RELATED MODULES,
17     See the information in README.
18     Do NOT follow the rest of these instructions.
19
20
21 =============================================================================
22 These are the installation instruction for the lm_sensors package.
23
24 There are two ways in which you can compile and install this package.
25 Option 1 is much easier and is recommended.
26
27  1. Complete separate from kernel compilation
28     (only for 2.4 kernels 2.4.9 or later)
29     This will generate a set of modules which can be inserted and removed
30     as needed; nothing will be written into the kernel tree;
31
32  2. Patching of the kernel
33     (only for 2.4 kernels 2.4.13 or later)
34     This will patch your kernel source tree. You must recompile your kernel
35     to take advantage of this. But it makes it possible to compile drivers
36     into the kernel itself, instead of having to add them as modules.
37     ** AFTER YOU COMPILED AND INSTALLED YOUR KERNEL, YOU WILL STILL HAVE TO
38     ** COMPILE THIS PACKAGE TO GET THE USERLAND UTILITIES!
39     ** NOT ALL MODULES ARE PATCHED INTO THE KERNEL. SEE BELOW.
40
41
42
43 Each of these ways will be described below in detail.
44
45 NOTE: MAKE SURE YOU HAVE THE I2C-ALGO-BIT DRIVER (PART OF THE I2C PACKAGE)
46       COMPILED INTO YOUR KERNEL OR AVAILABLE AS A MODULE; SOME SENSORS
47       DRIVERS DEPEND ON IT!
48
49 NOTE: IN EACH CASE, YOU WILL HAVE TO GET AND INSTALL THE I2C PACKAGE FIRST!
50       SET COMPILE_KERNEL TO 0 IN THE MAIN MAKEFILE FOR OPTION 2, UNLESS
51       YOU NEED ALPHA OR BETA DRIVERS (SEE BELOW)
52
53 NOTE: PLEASE READ THE DOCUMENTATION IN THE DOC SUBDIRECTORY IF YOU GET STUCK!
54
55
56 Installing the i2c package
57 ==========================
58
59 This lm_sensors release REQUIRES i2c-2.8.0 or later,
60 which is not in kernels through (at least) 2.4.22.
61 Therefore, you must download and install the i2c package with
62 the same version number or higher as this lm_sensors package.
63
64 All i2c components are distributed in
65 a separate package. There are install instructions in that package. If
66 you want to use compilation option 2 (patching the kernel) for lm_sensors,
67 you will have to use compilation option 3 (patching the kernel) for i2c
68 too. If you want to use compilation option 1 (compiling as modules) for
69 lm_sensors, you may use either compilation option 1 or 2 (compiling as
70 modules) or compilation option 3 (patching the kernel for i2c). See the
71 table below.
72
73                                           LM_SENSORS
74 I2C                      | option 1 (modules)      option 2 (patch kernel)
75 -------------------------+------------------------------------------------
76 option 1 (modules)       |      YES                      NO
77 option 2 (modules)       |      YES                      YES
78 option 3 (patch kernel)  |      YES                      YES
79
80
81 If you use compilation option 1 (compiling as modules) for lm_sensors, you
82 will have to make very sure the correct i2c header files are found. If you
83 get weird compilation errors, this is almost certainly going wrong. The
84 i2c header files are in a i2c subdirectory of either /usr/local/include
85 (i2c compilation option 1) or /usr/src/linux*/include (i2c compilation
86 options 2 and 3). Especially if you have in the past placed the header
87 files in /usr/local/include, this will probably go wrong. See below on
88 how to fix this.
89
90 NOTE: option 3 only works with 2.4 kernels 2.4.13 or later;
91       option 1 and 2 only work with 2.4 kernels 2.4.9 or later.
92
93
94 Mixing old and new, and using beta drivers (compilation option 1)
95 =================================================================
96
97 It is possible that you are running a previously patched kernel, or
98 a very new kernel which already has limited or full i2c or lm_sensors
99 support, but you want to use newer versions of the drivers. This is
100 possible, but there are some pitfalls.
101
102 If had compiled all i2c and lm_sensors drivers as modules, you are
103 in luck. You can simply compile the newest versions of i2c and
104 lm_sensors and install them. Just make sure the right modules are
105 loaded (best bet: remove the old ones first).
106
107 If you have a certain driver compiled into your kernel, you may
108 encounter bad problems. We do not guarantee to keep internal kernel
109 interfaces unchanged. In plain language, this means that an older driver
110 may not work together with a newer driver, and your kernel may crash.
111 On the other hand, if you know what you are doing, compilation will
112 be smart. Drivers that are compiled right into your kernel will not
113 be compiled as a module again.  You could do nothing with them anyway.
114
115 Sometimes, you want to patch your kernel, but find that certain alpha
116 or beta drivers are not included in the patch. This is on purpose: we
117 do not want to polute the kernel tree with things of which we are not
118 confident they work. In this case, patch the kernel, compile it, and
119 then compile lm_sensors with COMPILE_KERNEL set to 1.
120
121
122 Having a proper kernel tree (compilation option 1)
123 ==================================================
124
125 Usually, if you compile a user-space application, you can get away with
126 having a different version of the kernel running than the version of the
127 kernel header files against which you compiled it. But a perfect match
128 is needed for the first two compilation options above.
129
130 Let's say you want to use the lm_sensors modules with the kernel 2.1.12 you
131 are running now. What you need, is the original tree in which you
132 compiled that 2.1.12 kernel. A freshly unpacked 2.1.12 kernel will not
133 cut it, because `make *config dep' creates some files that are needed.
134 And even then, you will run into trouble, because you may not have
135 selected the exact same configuration variables. Plain advise: if you
136 do not have your original kernel tree anymore, recompile your kernel
137 first.
138
139 Note that there is no need for a perfect match at compilation time, just
140 at run-time. This means you can cross-compile against a different kernel
141 version, and the Makefile does not check for this.
142
143 Usually problems if the match is imperfect, is that either this package
144 won't compile at all (because it was a freshly unpacked tree without
145 some files generated by `make *config dep'), or that you can't insert
146 modules because of either a `kernel-module version mismatch' or because
147 of `unresolved kernel symbols'. If you get either of these messages,
148 check your kernel tree!
149
150 Note that some distributions are notably bad at this. To offset this
151 somewhat, not the files in /usr/include/{linux,asm} are used, but instead
152 those in /usr/src/linux/include/{linux,asm}. It is also possible to
153 tell the Makefile the kernel is somewhere else than at /usr/src/linux.
154
155 To keep problems to a minimum, please use a 'vanilla' kernel tree,
156 as distributed on ftp://ftp.kernel/org/pub/linux/kernel, and not one
157 patched by your distribution.
158
159
160 Separate from kernel compilation (compilation option 1)
161 =======================================================
162
163 This will compile and install the complete lm_sensors package. Though
164 nothing is written to your kernel tree, a proper tree is still needed
165 for this. See earlier for what a proper kernel tree is.
166
167 At the top of the Makefile are a couple of configuration variables that
168 you may want to change. As far as possible, the Makefile tries to figure
169 out by itself their settings, but it is possible to overrule them. A list
170 is found below. Most important are the variables that determine where
171 your kernel is located (LINUX=/lib/modules/KERNELVERSION/build, usually
172 links to /usr/src/linux or something similar), where the i2c header files
173 are (I2C_HEADERS=/usr/local/include) and where you want to install
174 your modules (MODDIR=/lib/modules/KERNELVERSION) and header files
175 (LINUX_INCLUDE_DIR=/usr/local/include/linux). You can see that the
176 installation locations are choosen in such a way that they are separate
177 from the true kernel.
178
179 Compilation is done by `make all'; `make install' installs the package.
180 You will get a lot of warnings about files which are not found, all
181 ending on `.*d'. You can safely ignore this; they contain dependency
182 information, which is regenerated on the spot.
183
184 Please continue reading this file before you start compiling.
185
186
187 Makefile configuration variables (compilation option 1)
188 ==============================================================
189
190 SHELL (default: /bin/sh)
191   You may have to specify the full path to Bash here, if /bin/sh is some
192   other shell. There have been conflicting reports on whether this is
193   needed.
194 KERNELVERSION
195   The version of the currently running kernel.
196 LINUX (default: /lib/modules/$(KERNELVERSION)/build)
197   The location of your kernel tree.
198 COMPILE_KERNEL
199   Determine whether you want to consider the kernel modules for compilation
200   at all. By default, compilation option 1 will only compile and install
201   those modules which are not built into the kernel.
202   If some modules are built into your kernel, and this package is much
203   newer, you may find you can not insert the newly compiled modules.
204   Sorry.
205   You may want to set this to 0 if you have just patched and compiled
206   your kernel using the same version of this package, and just want to
207   compile the user-space tools.
208 I2C_HEADERS (default: /usr/local/include)
209   This lists where the i2c headers are found. If you used compilation
210   option 1 for the i2c package, the default will be right. If you used
211   compilation options 2 or 3, it will not, and may actually cause
212   problems if you have the left-overs of a previous installation.
213   If you have weird compilation problems, try to change this to
214   $(LINUX_HEADERS).
215 SMP
216   This must be set to 1 for a SMP kernel. The magic invocation should
217   determine this automatically, so you should not have to bother with
218   this.
219 MODVER
220   This must be set to 1 if CONFIG_MODVERSIONS is defined. The magic
221   invocation should determine this automatically, so you should not
222   have to bother with this.
223 WARN (default: 0)
224   Generate additional compilation warnings; mainly interesting for
225   developers.
226 DEBUG (default: 0)
227   Some drivers will issue more debug information if you set this to
228   1. Don't do it, unless you are a developer or are instructed to do
229   so by the lm_sensors team.
230 PREFIX (default: /usr/local)
231   Prefix for almost all installation directories.
232 MODPREF (default: /lib/modules/$(KERNELVERSION))
233   The location where the kernel modules will be installed.
234 ETCDIR (default: /etc)
235   Installation location of the sensors.conf configuration file.
236 LIBDIR (default: $(PREFIX)/lib)
237   Installation location of all static and shared libraries.
238 BINDIR (default: $(PREFIX)/bin)
239   Installation directory of programs useful for users.
240 SBINDIR (default: $(PREFIX)/sbin)
241   Installation directory of system administrator-only programs.
242 INCLUDEDIR (default: $(PREFIX)/include)
243   Base installation directory for include files (see next two vars).
244 SYSINCLUDEDIR (default: $(INCLUDEDIR)/linux)
245   Installation directory for system include files.
246 LIBINCLUDEDIR (default: $(INCLUDEDIR)/sensors)
247   Installation directory for libsensors include files.
248 MANDIR (default: $(PREFIX)/man)
249   Base installation directory for manual pages.
250 MANOWN (default: root)
251   Owner of manual pages.
252 MANGRP (default: root)
253   Group of manual pages.
254
255
256
257 Handling the modules (compilation option 1)
258 ===========================================
259
260 Run the command `depmod -a' to have the new modules recognised. Most
261 distributions run this command when you boot, so if you were cross-
262 compiling, you can skip this step.
263
264 See doc/modules for a more detailed treatment.
265
266
267 Patching the kernel (compilation option 2)
268 ==========================================
269
270 There is a special script which should be able to generate diffs against
271 any 2.2 or 2.4 kernel (2.4.0 or later). Note that 2.3 kernels are no
272 longer supported for this compilation option (choose option 1 instead).
273 Please report any problems to our mailinglist. Note that it may fail,
274 and probably silently, if you have applied other patches to your kernel \
275 tree, or for very new kernels.  It *is* safe to run it if your kernel
276 already has the lm_sensors drivers.  It will only work if you applied the
277 i2c patches first.
278
279 ** Only a subset of the modules in lm_sensors are patched into the        **
280 ** kernel by the script. See the file mkpatch/FILES to see if the         **
281 ** modules you need are included. If a module you need is NOT listed      **
282 ** in mkpatch/FILES, it will not be patched, and you MUST use option 1.   **
283 ** If you are not sure what modules you need, run `sensors-detect' first. **
284
285 The kernel diffs are generated by the program `mkpatch.pl' in the mkpatch
286 subdirectory. It needs two arguments: the first one is the root of the
287 lm_sensors package, the second one is the root of the kernel tree against
288 which the diffs will be generated. For example:
289   cd /tmp/lm_sensors-2.4.0
290   mkpatch/mkpatch.pl . /usr/src/linux > /tmp/sensors-patch
291 You can apply the diffs as usual:
292   cd /usr/src/linux
293   patch -p1 -E < /tmp/sensors-patch
294 Genearation and application can easily be done in one step:
295   mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
296 The generated diffs are of course only valid for the kernel version
297 against which mkpatch.pl was run.
298
299 Once you have applied the patches, you can configure and compile your
300 kernel as usual. You will see the sensors configuration screen under the
301 `Character Devices' menu in menuconfig, but it will only be available
302 if you selected base I2C support.
303
304
305 Using the sensors package
306 =========================
307
308 You can now load the modules by using `modprobe'. For example,
309 `modprobe i2c-piix4' will load the i2c-piix4 module, and all i2c modules
310 on which it depends.
311
312 You can not use demand-loading; you will have to issue explicit modprobe
313 instructions.
314
315 If you have an older installation, you will probably have to create the
316 i2c device files in the /dev directory. They are called /dev/i2c-%d,
317 and are character devices with major device number 89 and minor device
318 number %d. The script prog/mkdev/mkdev.sh will create the files for you.
319
320 There is a special scanning program installed called sensors-detect. It
321 will scan all available I2C and SMBus adapters for all known devices,
322 and give you a list of what modules you need to insert. It is written in
323 Perl, and you will need at least Perl 5.004 to run it succesfully.
324
325 If `sensors' returns some error message about not being able to load
326 libsensors, you have to add the directory in which it is installed
327 (by default /usr/local/lib) to /etc/ld.so.conf and run `ldconfig'.
328
329 You can use the installed sensors program to get a report of all detected
330 sensor devices. There is also a manual page for this program. Calling
331 `sensors -s' will set the limits and other configuration settings
332 specified in /etc/sensors.conf. Again, read the manual pages for more
333 information.
334
335 There are many auxiliary programs not installed. You can find them under
336 the prog subdirectory. A list can be found in doc/progs.
337
338
339 Old and new I2C drivers
340 =======================
341
342 In the current 2.2 and 2.3 kernels, there are already I2C drivers, but
343 they are not the same ones as in this package. They are much older, and
344 have a very limited functionality compared with the drivers included
345 here. Fortunately, they can co-exist peacefully, so you should not worry
346 about it. Except for one thing: `#include <linux/i2c.h>' can cause the
347 wrong header file to be included. If you patched the kernel (compilation
348 option 3), you will have to use `#include <linux/i2c-old.h>' to include
349 the old ones; in all other cases, including the old ones will probably
350 be impossible without copying them explicitly to some place that will
351 be checked first.
Note: See TracBrowser for help on using the browser.