| 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 | | |
| 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 |
| | 38 | You |
| 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 | | ================================================== |
| | 69 | |
| | 70 | Having a proper kernel tree |
| | 71 | =========================== |
| 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. |
| 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 | | |