Device Mapper installation
==========================

1) Generate custom makefiles.

   Run the 'configure' script from the top directory.

   If your kernel source is not in /usr/src/linux give its location
   using --with-kernel-dir.

   Other flags let you change the installation & working directories.

   Example:  
   ./configure --with-kernel-dir=/usr/src/linux-2.4.19-rc1


2) Patch, configure and build a new kernel containing device-mapper.

   If there is already a patch for your kernel and you gave 'configure'
   appropriate parameters in step 1, you can just run 'make apply-patches' 
   from the top directory and go on to step 3.
   
   Configure, build and install your kernel in the normal way, selecting
   'Device mapper support' from the 'Multiple devices driver support' menu.

   If you are patching by hand, the patches are stored in the
   'patches' subdirectory.  The name of each patch contains the kernel
   version it was generated against and whether it is for the 'fs' or
   'ioctl' interface.  Current development effort is concentrated
   on the 'ioctl' interface.  (Use CVS to get the older 'fs' patches if
   you want.)  

   patches/common holds the constituent patches - see patches/common/README.

   Running 'make symlinks' from the 'kernel' subdirectory will put symbolic 
   links into your kernel tree pointing back at the source files.
   

3) Build and install the shared library (libdevmapper.so) that
   provides the API.

   Run 'make' from the top directory.

      Example:  make install

   The DESTDIR environment variable is supported (e.g. for packaging).


4) If you are using the ioctl interface but not devfs then install 
   scripts/devmap_mknod.sh to run either:

      Each time the kernel boots 
        e.g. add to /etc/rc*

      Or whenever the device-mapper is loaded (if you built it as a module)
        e.g. add the following line to /etc/modules.conf and run depmod -a
	     and use modprobe dm-mod to load the module
	post-install dm-mod /etc/init.d/devmap_mknod.sh
	
   The script creates the /dev/device-mapper/control device for the ioctl
   interface using the major and minor numbers that have been allocated
   dynamically.  It prints a message if it works or else it fails silently 
   with a non-zero status code (which you probably want to test for).

   If you want the block devices created by the device-mapper to have a 
   specific major number, then specify this when loading the module
      e.g. modprobe dm-mod major=123
   This major number is visible in /proc/devices.


5) You can now boot your new kernel and use 'dmsetup' to test the API.
   Read the dmsetup man page for more information.
   Or proceed to install a beta version of the new LVM2 tools.



Notes about the 'proof of concept' filesystem interface
=======================================================
The filesystem interface has not been updated for several months,
requires an old kernel, and is missing lots of features.

To experiment with it you should check out an old version from
CVS and then 'configure --with-interface=fs'.
You will need to mount dmfs.  e.g. mount -t dmfs dmfs /dmfs

