2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-10-17 14:46:06 +00:00
Files
lm-sensors/doc/mkpatch
Frodo Looijaard daf8ee4263 Update in the mkpatch documentation
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@551 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-09-10 18:54:12 +00:00

67 lines
3.3 KiB
Plaintext

This file tries to document how the `mkpatch' program works.
The file in copyright (c) 1999 by Frodo Looijaard
mkpatch compares the newest lm_sensors sources with what is found in a kernel,
and generates a set of diffs. These diffs can be amplied to that kernel,
after which the kernel is synchronised with the current lm_sensors sources.
You should always run mkpatch against a kernel tree that has been patched
for the newest I2C sources.
mkpatch needs two arguments. The first is the root of the lm_sensors package,
the second is the root of Linux kernel tree. For example:
cd /tmp/lm_sensors-2.4.0
mkpatch/mkpatch . /usr/src/linux
The patch file is written to stdout; any errors are written to stderr.
So you will want to capture the output:
mkpatch/mkpatch . /usr/src/linux > /tmp/lm_sensors-diffs
Later on, you will want to apply the diffs:
cd /usr/src/linuc
patch -p1 -E < /tmp/lm_sensors-diffs
Of course, this can be combined:
mkpatch/mkpatch . /usr/src/linux | patch -d /usr/src/linux -p1 -E
mkpatch uses several files in the mkpatch subdirectory. The location of
these files is hardcoded in the program, but all other files used are
specified in these files, and can easily be changed. Used files are:
FILES
a list of files that will be considered by mkpatch. Each line contains
two filenames, separated by whitespace. The first is the name and
location (relative to the lm_sensors package root) of the lm_sensors
file, the second is the name and location (relative to the kernel root) of
the kernel file. A diff will be created between these two files.
INCLUDES
A list of include file changes. Each line contains two strings that
can be found after a `#include' statement. All occurences of the
first string will be changed to the second, for all lm_sensors files in
FILES, before the normal diff is generated. This allow us to use
`#include "sensors.h"' when compiling in the package tree, and
`#include <linux/sensors.h>' in the kernel tree.
Makefile, Config.in
These files are new and will be copied to the appropriate place as
specified in FILES.
mkpatch does several things:
* For each file pair as specified in FILES, it creates a diff between
them, but before that is done, it changes `#include' lines in the
lm_sensors file as specified in INCLUDES
* It handles several special files, that have to be scanned explicitely
to generate diffs to for them
The generated diffs have specific headers. It will seem as if the old
kernel was contained in the `linux-old' directory, and the new patched
kernel in the `linux' directory, regardless of where the kernel was
actually located.
Most intricate are the special files that are handled. These special
files were already present in the kernel, but had to be patched. Because
they can change between kernel versions, I had to scan them by hand to
find where the new code should be inserted. Each file has documented
what actually happens.
One special other thing is done for each of the files specified in FILES.
The include-file `compat.h' is removed from each source file, and explicit
compatibility statements are added. The files are scanned for that, to
see what compatibility statements are needed. In a future version, you
will be able to specify which of those you want.