| 1 |
This file documents how the `mkpatch' program works. |
|---|
| 2 |
------------------------------------------------------------ |
|---|
| 3 |
|
|---|
| 4 |
QUICKSTART |
|---|
| 5 |
---------- |
|---|
| 6 |
mkpatch/mkpatch.pl . /usr/src/linux > /tmp/patch |
|---|
| 7 |
cd /usr/src/linux |
|---|
| 8 |
patch -p1 < /tmp/patch |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
USAGE |
|---|
| 12 |
----- |
|---|
| 13 |
|
|---|
| 14 |
mkpatch compares the newest lm_sensors sources with what is found in a kernel, |
|---|
| 15 |
and generates a set of diffs. These diffs can be applied to that kernel, |
|---|
| 16 |
after which the kernel is synchronized with the current lm_sensors sources. |
|---|
| 17 |
|
|---|
| 18 |
You should generally run mkpatch against a kernel tree that has been patched |
|---|
| 19 |
with the newest I2C sources. Check the lm_sensors "Download" page for |
|---|
| 20 |
information on dependencies between lm_sensors and i2c versions. |
|---|
| 21 |
|
|---|
| 22 |
mkpatch needs two arguments. The first is the root of the lm_sensors package, |
|---|
| 23 |
the second is the root of Linux kernel tree. For example: |
|---|
| 24 |
cd /tmp/lm_sensors-2.4.0 |
|---|
| 25 |
mkpatch/mkpatch . /usr/src/linux |
|---|
| 26 |
|
|---|
| 27 |
The patch file is written to stdout; any errors are written to stderr. |
|---|
| 28 |
So you will want to capture the output: |
|---|
| 29 |
mkpatch/mkpatch . /usr/src/linux > /tmp/lm_sensors-diffs |
|---|
| 30 |
|
|---|
| 31 |
Later on, you will want to apply the diffs: |
|---|
| 32 |
cd /usr/src/linux |
|---|
| 33 |
patch -p1 -E < /tmp/lm_sensors-diffs |
|---|
| 34 |
|
|---|
| 35 |
Of course, this can be combined: |
|---|
| 36 |
mkpatch/mkpatch . /usr/src/linux | patch -d /usr/src/linux -p1 -E |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
IMPLEMENTATION DETAILS |
|---|
| 40 |
---------------------- |
|---|
| 41 |
|
|---|
| 42 |
mkpatch uses several files in the mkpatch subdirectory. The location of |
|---|
| 43 |
these files is hardcoded in the program, but all other files used are |
|---|
| 44 |
specified in these files, and can easily be changed. Used files are: |
|---|
| 45 |
FILES |
|---|
| 46 |
A list of files that will be considered by mkpatch. Each line contains |
|---|
| 47 |
two filenames, separated by whitespace. The first is the name and |
|---|
| 48 |
location (relative to the lm_sensors package root) of the lm_sensors |
|---|
| 49 |
file, the second is the name and location (relative to the kernel root) of |
|---|
| 50 |
the kernel file. A diff will be created between these two files. |
|---|
| 51 |
INCLUDES |
|---|
| 52 |
A list of include file changes. Each line contains two strings that |
|---|
| 53 |
can be found after a `#include' statement. All occurences of the |
|---|
| 54 |
first string will be changed to the second, for all lm_sensors files in |
|---|
| 55 |
FILES, before the normal diff is generated. This allow us to use |
|---|
| 56 |
`#include "sensors.h"' when compiling in the package tree, and |
|---|
| 57 |
`#include <linux/sensors.h>' in the kernel tree. |
|---|
| 58 |
Makefile, Config.in |
|---|
| 59 |
These files are new and will be copied to the appropriate place as |
|---|
| 60 |
specified in FILES. |
|---|
| 61 |
|
|---|
| 62 |
mkpatch does several things: |
|---|
| 63 |
* For each file pair as specified in FILES, it creates a diff between |
|---|
| 64 |
them, but before that is done, it changes `#include' lines in the |
|---|
| 65 |
lm_sensors file as specified in INCLUDES |
|---|
| 66 |
* It handles several special files, that have to be scanned explicitly |
|---|
| 67 |
to generate diffs to for them |
|---|
| 68 |
|
|---|
| 69 |
The generated diffs have specific headers. It will seem as if the old |
|---|
| 70 |
kernel was contained in the `linux-old' directory, and the new patched |
|---|
| 71 |
kernel in the `linux' directory, regardless of where the kernel was |
|---|
| 72 |
actually located. |
|---|
| 73 |
|
|---|
| 74 |
Most intricate are the special files that are handled. These special |
|---|
| 75 |
files were already present in the kernel, but had to be patched. Because |
|---|
| 76 |
they can change between kernel versions, I had to scan them by hand to |
|---|
| 77 |
find where the new code should be inserted. Each file has documented |
|---|
| 78 |
what actually happens. |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
------------ |
|---|
| 82 |
This file is Copyright (c) 1999 by Frodo Looijaard |
|---|