***********************************************************************
* Note: Exporting Unionfs over NFS does not work in this release.     *
***********************************************************************

To build Unionfs, there are two main components:

-  unionfs.o: the kernel module in 2.4 
or unionfs.ko: the kernel module in 2.6

-  unionctl: a user utility which allows you to add and remove branches

You should be able to just type "make" and Unionfs will build itself.
The Makefile will look for your running kernel sources in
/lib/modules/`uname -r`/build/include.  If your kernel sources are
located in a different directory, create a "fistdev.mk" file along the
lines of: TOPINC=-I/path/to/my/kernel/sources/linux-2.4.xx/include

There are two Makefile options related to extended attribute support,
which is turned off by default.  You should define UNIONFS_XATTR to turn
it on.  Vanilla kernels should work automatically, but if you (or your
vendor) has applied the ACL/EA patches you might need to define
FIST_SETXATTR_CONSTVOID to correct the setxattr operation's function
prototype.

Using fistdev.mk, you can also turn off the debugging print system,
which adds to the modules code size significantly.  Just add
"EXTRACFLAGS=-DNODEBUG" to fistdev.mk.

The doit.sh script included in the distribution will mount unionfs
with two branches (/branch0 and /branch1) by default.  You can use it
as an example and edit to your tastes.

To install unionfs run "make install".  This copies unionfs.o into
/lib/modules/`uname -r`/kernel/fs/; copies the utilities into
/usr/local/sbin; and copies man pages into /usr/local/man;

fistdev.mk summary:
UNIONFS_OPT_CFLAG	By default -O2.  If you want a different optimization
			level change this variable.
UNIONFS_DEBUG_CFLAG	By default -g.  If you want to remove debug, set
			this variable to nothing.  This will result in a
			smaller (but harder to debug) Unionfs.
EXTRACFLAGS		Additional stuff to pass to the compiler, this
			is useful when combined with the definitions below.
			(e.g., EXTRACFLAGS=-DNODEBUG to turn off debugging).
LINUXSRC		Where to find the kernel build directory.
TOPINC			Where to find the kernel headers.
PREFIX			Where to install Unionfs utilities.
			By default /usr/local.
MODPREFIX		What is the prefix to the root directory for modules,
			by default this is unset.  Your modules will end up
			in /lib/modules/`uname -r`/kernel/fs.  With
			MODPREFIX=/foo they end up in
			/foo/lib/modules/`uname -r`/kernel/fs.

Define options summary:
UNIONFS_XATTR		Enable extended attribute support
FIST_SETXATTR_CONSTVOID	Change prototypes of setxattr function for some
			vendor kernels
NODEBUG			Turn off debugging facility (reduces code size)
UNIONFS_UNSUPPORTED	Bypass kernel versions checks.

Known interactions with other kernel features/patches:
* File locking routines are not implemented correctly

* Selinux requires extended attributes (but has not been tested)

* Stacking on Reiserfs can cause problems

* If you want to export Unionfs over NFS, then you need to add
extra information to /etc/exports.  knfsd will not export Unionfs unless
you have an fsid option in /etc/exports.  This is because Unionfs has no
real device.  See man exports(5) for more information on fsid.

Other known limitations:
* The documentation needs to improve

* Extended attributes are not handled on copyup

* The object code is much larger than it could be

* If you restart an NFS server, you will get ESTALE errors on the client
  because Unionfs does not have persistent inode numbers.  You should also
  consider NFS over TCP, so lost packets don't cause readdir to get confused.
