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

Revision 576, 12.4 kB (checked in by frodo, 9 years ago)

INSTALL file changes for last commit

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 These are the installation instruction for the lm_sensors package.
2
3 There are two ways in which you can compile and install this package. Each
4 has its own strong points. They are:
5  1. Complete separate from kernel compilation
6     This will generate a set of modules which can be inserted and removed
7     as needed; nothing will be written into the kernel tree;
8  2. Patching of the kernel
9     This will patch your kernel source tree. You must recompile your kernel
10     to take advantage of this. But it makes it possible to compile drivers
11     into the kernel itself, instead of having to add them as modules.
12     AFTER YOU COMPILED AND INSTALLED YOUR KERNEL, YOU WILL STILL HAVE TO
13     COMPILE THIS PACKAGE TO GET THE USERLAND UTILITIES!
14
15 Each of these ways will be described below in detail.
16
17 NOTE: OPTION 2 WILL CURRENTLY NOT WORK FOR 2.0 AND OLDER 2.1 KERNELS!
18
19 NOTE: IN EACH CASE, YOU WILL HAVE TO GET AND INSTALL THE I2C PACKAGE FIRST!
20
21 NOTE: PLEASE READ THE DOCUMENTATION IN THE DOC SUBDIRECTORY IF YOU GET STUCK!
22
23
24 Installing the i2c package
25 ==========================
26
27 As of version 2.4.0 of lm_sensors, all i2c components are distributed in
28 a separate package. There are install instructions in that package. If
29 you want to use compilation option 2 (patching the kernel) for lm_sensors,
30 you will have to use compilation option 3 (patching the kernel) for i2c
31 too. If you want to use compilation option 1 (compiling as modules) for
32 lm_sensors, you may use either compilation option 1 or 2 (compiling as
33 modules) or compilation option 3 (patching the kernel for i2c). See the
34 table below.
35
36                                           LM_SENSORS
37 I2C                      | option 1 (modules)      option 2 (patch kernel)
38 option 1 (modules)       |      YES                      NO
39 option 2 (modules)       |      YES                      YES
40 option 3 (patch kernel)  |      YES                      YES
41
42
43 If you use compilation option 1 (compiling as modules) for lm_sensors, you
44 will have to make very sure the correct i2c header files are found. If you
45 get weird compilation errors, this is almost certainly going wrong. The
46 i2c header files are in a i2c subdirectory of either /usr/local/include
47 (i2c compilation option 1) or /usr/src/linux*/include (i2c compilation
48 options 2 and 3). Especially if you have in the past placed the header
49 files in /usr/local/include, this will probably go wrong. See below on
50 how to fix this.
51
52
53 Having a proper kernel tree (compilation option 1)
54 ==================================================
55
56 Usually, if you compile a user-space application, you can get away with
57 having a different version of the kernel running than the version of the
58 kernel header files against which you compiled it. But a perfect match
59 is needed for the first two compilation options above.
60
61 Let's say you want to use the lm_sensors modules with the kernel 2.1.12 you
62 are running now. What you need, is the original tree in which you
63 compiled that 2.1.12 kernel. A freshly unpacked 2.1.12 kernel will not
64 cut it, because `make *config dep' creates some files that are needed.
65 And even then, you will run into trouble, because you may not have
66 selected the exact same configuration variables. Plain advise: if you
67 do not have your original kernel tree anymore, recompile your kernel
68 first.
69
70 Note that there is no need for a perfect match at compilation time, just
71 at run-time. This means you can cross-compile against a different kernel
72 version, and the Makefile does not check for this.
73
74 Usually problems if the match is imperfect, is that either this package
75 won't compile at all (because it was a freshly unpacked tree without
76 some files generated by `make *config dep'), or that you can't insert
77 modules because of either a `kernel-module version mismatch' or because
78 of `unresolved kernel symbols'. If you get either of these messages,
79 check your kernel tree!
80
81 Note that some distributions are notably bad at this. To offset this
82 somewhat, not the files in /usr/include/{linux,asm} are used, but instead
83 those in /usr/src/linux/include/{linux,asm}. It is also possible to
84 tell the Makefile the kernel is somewhere else than at /usr/src/linux.
85
86
87 Separate from kernel compilation (compilation option 1)
88 =======================================================
89
90 This will compile and install the complete i2c package. Though nothing is
91 written to your kernel tree, a proper tree is still needed for this. See
92 earlier for what a proper kernel tree is.
93
94 At the top of the Makefile are a couple of configuration variables that
95 you may want to change. As far as possible, the Makefile tries to figure
96 out by itself their settings, but it is possible to overrule them. A list
97 is found below. Most important are the variables that determine where
98 your kernel is located (LINUX=/usr/src/linux), where the i2c header files
99 are (I2C_HEADERS=/usr/local/include) and where you want to install
100 your modules (MODDIR=/lib/modules/KERNELVERSION/extra/misc) and
101 header files (LINUX_INCLUDE_DIR=/usr/local/include/linux). You can see
102 that the installation locations are choosen in such a way that they
103 are separate from the true kernel.
104
105 Compilation is done by `make all'; `make install' installs the package.
106 You will get a lot of warnings about files which are not found, all
107 ending on `.*d'. You can safely ignore this; they contain dependency
108 information, which is regenerated on the spot.
109
110 Please continue reading this file before you start compiling.
111
112
113 Makefile configuration variables (compilation option 1)
114 ==============================================================
115
116 SHELL (default: /bin/sh)
117   You may have to specify the full path to Bash here, if /bin/sh is some
118   other shell. There have been conflicting reports on whether this is
119   needed.
120 LINUX default: /usr/src/linux
121   The location of your kernel tree.
122 COMPILE_KERNEL
123   Determine whether you want to consider the kernel modules for compilation
124   at all. By default, compilation option 1 will only compile and install
125   those modules which are not built into the kernel.
126   If some modules are built into your kernel, and this package is much
127   newer, you may find you can not insert the newly compiled modules.
128   Sorry.
129   You may want to set this to 0 if you have just patched and compiled
130   your kernel using the same version of this package, and just want to
131   compile the user-space tools.
132 I2C_HEADERS default: /usr/local/include
133   This lists where the i2c headers are found. If you used compilation
134   option 1 for the i2c package, the default will be right. If you used
135   compilation options 2 or 3, it will not, and may actually cause
136   problems if you have the left-overs of a previous installation.
137   If you have weird compilation problems, try to change this to
138   $(LINUX_HEADERS).
139 SMP
140   This must be set to 1 for a SMP kernel. The magic invocation should
141   determine this automatically, so you should not have to bother with
142   this.
143 WARN default: 0
144   Generate additional compilation warnings; mainly interesting for
145   developers.
146 MODVER
147   This must be set to 1 if CONFIG_MODVERSIONS is defined. The magic
148   invocation should determine this automatically, so you should not
149   have to bother with this.
150 DEBUG default: 0
151   Some drivers will issue more debug information if you set this to
152   1. Don't do it, unless you are a developer or are instructed to do
153   so by the lm_sensors team.
154 PREFIX default: /usr/local
155   Prefix for almost all installation directories
156 MODDIR default: /lib/modules/KERNELVERSION/extra/misc)
157   The location where the kernel modules will be installed.
158 ETCDIR default: /etc
159   Installation location of the sensors.conf configuration file
160 LIBDIR default: $(PREFIX)/lib
161   Installation location of all static and shared libraries.
162 BINDIR default: $(PREFIX)/bin
163   Installation directory of programs useful for users
164 SBINDIR default: $(PREFIX)/sbin
165   Installation directory of system administrator-only programs
166 INCLUDEDIR default: $(PREFIX)/include
167   Base installation directory for include files (see next two vars)
168 SYSINCLUDEDIR default: $(INCLUDEDIR)/linux
169   Installation directory for system include files
170 LIBINCLUDEDIR default: $(INCLUDEDIR)/sensors
171   Installation directory for libsensors include files.
172 MANDIR default: $(PREFIX)/man
173   Base installation directory for manual pages
174 MANOWN default: root
175   Owner of manual pages
176 MANGRP default: root
177   Group of manual pages
178
179
180
181 Handling the modules (compilation option 1)
182 ===========================================
183
184 Once you have installed the kernel modules, you will have to make sure
185 they are found.
186
187 First, check whether your modutils will look in the right directory at
188 all. If you used build system 1, you will probably have to add lines
189 to /etc/conf.modules or /etc/modules.conf (use the one that exists, or
190 take your pick):
191   (modules-2.0.0):
192     path[misc]=/lib/modules/current/extra/misc
193   (modutils-2.1.x):
194     path=/lib/modules/current/extra
195 This assumes /lib/modules/current will always be linked to the correct
196 modules tree. If not, you will have to change it as appropriate for
197 your system.
198
199 Next, you will have to run `depmod -a' to have them recognised. Most
200 distributions run this command when you boot, so if you were cross-
201 compiling, you can skip this step.
202
203 See doc/modules for a more detailed treatment.
204
205
206 Patching the kernel (compilation option 2)
207 ==========================================
208
209 There is a special script which should be able to generate diffs against
210 any 2.0, 2.1, 2.2 and 2.3 kernel. Please report any problems to our
211 mailinglist. Note that it may fail, and probably silently, if you have
212 applied other patches to your kernel tree, or for very new kernels.
213 It *is* safe to run it if your kernel already has the lm_sensors drivers.
214 It will only work if you applied the i2c patches first.
215
216 The kernel diffs are generated by the program `mkpatch.pl' in the mkpatch
217 subdirectory. It needs two arguments: the first one is the root of the
218 i2c package, the second one is the root of the kernel tree against
219 which the diffs will be generated. For example:
220   cd /tmp/lm_sensors-2.4.0
221   mkpatch/mkpatch.pl . /usr/src/linux > /tmp/sensors-patch
222 You can apply the diffs as usual:
223   cd /usr/src/linux
224   patch -p1 -E < /tmp/sensors-patch
225 Genearation and application can easily be done in one step:
226   mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
227 The generated diffs are of course only valid for the kernel version
228 against which mkpatch.pl was run.
229
230 Once you have applied the patches, you can configure and compile your
231 kernel as usual. You will see the sensors configuration screen under the
232 `Character Devices' menu in menuconfig, but it will only be available
233 if you selected base I2C support.
234
235
236 Using the sensors package
237 =========================
238
239 You can now load the modules by using `modprobe'. For example,
240 `modprobe i2c-piix4' will load the i2c-piix4 module, and all i2c modules
241 on which it depends.
242
243 You can not use demand-loading; you will have to issue explicit modprobe
244 instructions.
245
246 If you have an older installation, you will probably have to create the
247 i2c device files in the /dev directory. They are called /dev/i2c-%d,
248 and are character devices with major device number 89 and minor device
249 number %d. The script prog/mkdev/mkdev.sh will create the files for you.
250
251 There is a special scanning program installed called sensors-detect. It
252 will scan all available I2C and SMBus adapters for all known devices,
253 and give you a list of what modules you need to insert. It is written in
254 Perl, and you will need at least Perl 5.004 to run it succesfully.
255
256 You can use the installed sensors program to get a report of all detected
257 sensor devices. There is also a manual page for this program. Calling
258 `sensors -s' will set the limits and other configuration settings
259 specified in /etc/sensors.conf. Again, read the manual pages for more
260 information.
261
262 There are many auxiliary programs not installed. You can find them under
263 the prog subdirectory. A list can be found in doc/progs.
264
265
266 Old and new I2C drivers
267 =======================
268
269 In the current 2.2 and 2.3 kernels, there are already I2C drivers, but
270 they are not the same ones as in this package. They are much older, and
271 have a very limited functionality compared with the drivers included
272 here. Fortunately, they can co-exist peacefully, so you should not worry
273 about it. Except for one thing: `#include <linux/i2c.h>' can cause the
274 wrong header file to be included. If you patched the kernel (compilation
275 option 3), you will have to use `#include <linux/i2c-old.h>' to include
276 the old ones; in all other cases, including the old ones will probably
277 be impossible without copying them explicitly to some place that will
278 be checked first.
Note: See TracBrowser for help on using the browser.