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