!! IMPORTANT !!  If you are using a kernel old than 2.2.18 please read
the relevent section below.

The makefile in this directory will attempt to create an LVM patch for
your kernel.

This patch will be suitable for applying to a clean kernel from Linus.
The kernels supplied with popular distributions (eg, RedHat) are not
Linus kernels.

If you are not familiar with patching or building the kernel then
consider looking for pre-built binaries of LVM.


Creating the patch
------------------

o untar your clean Linus kernel

o run 'make distclean' in the directory above this one to clean up any
  previous configure information.  If you get an error that says
  "make: *** No rule to make target `distclean'.  Stop." it generally
  means your source tree is clean and you can ignore it.
  
o run configure in the directory above this one to produce 'Makefile', making
  sure to specify the '--with-kernel_dir=' flag if your kernel source is not
  in '/usr/src/linux'.

o check the following variables at the top of 'Makefile' in the PATCHES
  directory

  KERNEL_DIR should point to the kernel source that you wish to patch
  eg, KERNEL_DIR=/usr/src/linux

  LVM_VERSION the LVM version
  eg, LVM_VERSION=0.9.1_beta1

  KERNEL_VERSION the version of your kernel that is to be patched
  eg, KERNEL_VERSION=2.2.18

o Apply raw_io patch if you're using a 2.2 kernel (see below).

o type 'make', a file of the form lvm-<LVM_VERSION>-<KERNEL_VERSION>.patch
  should be built


Applying the patch to a 2.4 kernel
----------------------------------

linux-2.4 contains LVM already so the patch for these kernels does
little more than update the lvm source files.  You only need to apply
the one patch.

eg, 

cd /usr/src/linux
patch -p1 < /home/joe/develop/LVM/PATCHES/lvm-0.9.1_beta4-2.4.1.patch


Applying the patch to a 2.2 kernel
----------------------------------

LVM requires Stephen Tweedie's raw_io patch to work under linux-2.2,
we have included versions of this patch for various kernel releases
(linux-2.2.*-rawio.patch).  However we do not guarantee that this is
the most up to date version.

See ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/

This patch must be applied before you make the LVM patch.

eg,

cd /usr/src/linux
patch -p1 < /home/joe/develop/LVM/PATCHES/linux-2.2.18-rawio.patch
cd /home/joe/develop/LVM/PATCHES
make
cd /usr/src/linux
patch -p1 < /home/joe/develop/LVM/PATCHES/lvm-0.9.1_beta1-2.2.18.patch


Kernels older than 2.2.18
-------------------------

The patches have only been tested with kernels 2.2.18 and 2.4.0 at the
moment.

If you are using a kernel earlier than 2.2.18 you will not be able to
build the patch successfully.  Copying the 2.2.18 fragments file to a
file named after your kernel and trying again will produce a patch
that may work (almost certain for 2.2.17 less likely for 2.2.14).

eg, 
  
  cp fragments-2.2.18 fragments-2.2.16
  make

If you try this and manage to produce an acceptable patch please tell
us (linux-lvm@sistina.com or thornber@sistina.com) so we can update
this document.


Software RAID issues
--------------------

There appear to be two commonly used implementations of software raid,
the one in the kernel and the one found here:

ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches/

Which is used in many distributions.

We're only supporting the version in the stock kernel at the moment.
If you want support for new raid please mail thornber@sistina.com and
I'll try and get a patch to you (in return for a test report from
you).


Support
-------

If you have any problems please report them to the
linux-lvm@sistina.com mailing list.
