The files in this directory can be used to create a new patch set for a
specific version of FreeBSD. The shell scripts should work for any version
starting from 5.0-RELEASE, including Current. But as the source tree changes
sometimes, they may need modification or additional files.

First to define the meaning of "patchset" as used throughout this README: A
patchset contains patch files that must be applied to the FreeBSD source tree.
It is only used to modify existing files in the source tree. All new files will
be copied directly from their place in the c4b source tree.

To create a new patch set, You should run "./make-patches.sh" until it
delivers no error. Errors are reported, if at least one patch file cannot be
created. They result from the impossibility to automatically "edit" all
existing source files to include support for c4b. Some files must be edited
"by hand", using the "master-patch-*" files (see some later paragraph).

"./make-patches.sh" knows all files that must be modified for c4b support. It
will either modify the file itself (by using the "edit-*" files) or it will
only check if there is an original and a modified version of the file in
question. So to create a new patchset simply call "./make-patchset.sh", correct
the error (i.e. backup the original file to "*.org.c4b" and create a new
version under the original name) and run it again.

To help modifying source tree files that cannot be edited automatically, there
are some files called "master-patch-*". These may be used directly to create
the modified files. But be aware that not all of them are always needed. And
the FreeBSD source tree may change, so they may not work in all cases. But You
can use them as a hint for what to change.

When modifying a FreeBSD source file "by hand", first backup the original
version with ".org.c4b" appended. Then copy the file to its original name and
perform the necessary edit operations. After this run "./make-patches.sh"
again.

The next step for a new patch set after "./make-patches.sh" runs without any
error, is to collect all files needed into a new directory, e.g.
".../patches/FreeBSD-5.2-RELEASE" or ".../patches/FreeBSD-Current-040308". The
files needed are "patch-*" (created by the "./make-patches.sh" script),
"do-patches.sh" and "undo-patches.sh".

To apply a patch for a clean source tree, You simply run "./do-patches.sh" in
the directory that contains all needed "patch-*" files for the respective
operating system version. It should run without any error message.

To undo all patches and to revert to a clean source tree according to c4b, You
can run "./undo-patches.sh". It searches for all files with the suffix
".org.c4b" and renames these files to their original name, removing all
modified files. If the switch "-a" is specified, all newly created files and
directories for c4b are also removed.
