
+-----------------------------------------------------------------------+
| shadowfs is Copyright (C) 2003 - 2004 Clifford Wolf                   |
| shadowfs is Copyright (C) 2003 - 2004 LINBIT Information Technologies |
|                                                                       |
| This program is free software; you can redistribute it and/or modify  |
| it under the terms of the GNU General Public License as published by  |
| the Free Software Foundation; either version 2 of the License, or     |
| (at your option) any later version. A copy of the GNU General         |
| Public License can be found at COPYING.                               |
+-----------------------------------------------------------------------+


shadowfs - A collection of LD_PRELOAD filesystem wrappers
=========================================================

shadowfs is a collection of various LD_PRELOAD wrappers for adding fancy
filesystem features to a linux system.

The shadowfs libs can be built ans installed by typing "make" and "make
install" in the source directory. You might want to first adapt the
settings in the config.h file:

#define DEBUG 0
#define DEBUG_386 0
		Debug option. you usually don't want to enable them unless
		you are debugging the shadowfs libraries.

#define DLOPEN_LIBC 0
		There are two strategies for resolving the original
		function symbol of a wrapped function. Both turned out to
		bring up some problems on different libc versions. Try
		changing this option and recompile if you see some problems
		such as glibc asserts.

#define GLIBC_IS_UGLY 1
		Set this to 0 if you are not using glibc (but e.g.
		dietlibc).

When recompiling after a config change, you need first to clean up the old
binaries by typing "make clean".


cowfs - LD_PRELOAD wrapper for copy-on-write copies of read-only filesystems
----------------------------------------------------------------------------

cowfs is a LD_PRELOAD wrapper which wrapps the following libc functions:

	open, open64, fopen, fopen64, creat, creat64,
	mkdir, mknod, link, symlink, rename, utime, utimes

first, the read/write copy is initialized with symlinks to the files and
directories in the root of the read-only filesystem. whenever one of the
above system calls is used to open a file for writing or create a new file,
the symlink is automatically removed and a copy is created.

that way the read/write filesystem can be used as it would contain a full
copy of the read-only filesystem. But in fact only those files are copied
which are actually modified..

Configuration variables:

	COWFS_RO	The real path to read-only master
	COWFS_RW	The real path to read-write copy

The default values for this variables are /mnt/cowfs_ro and /mnt/cowfs_rw.
So it's also possible to use cowfs from /etc/ld.so.preload without having
any environment variables set.

Symlinks are followed until they end up in COWFS_RO or COWFS_RW. So
it is possible to have a setup such as

	/bin  -> /mnt/cowfs_rw/bin
	/sbin -> /mnt/cowfs_rw/sbin
	...

	/mnt/cowfs_rw/bin  -> /mnt/cowfs_ro/bin
	/mnt/cowfs_rw/sbin -> /mnt/cowfs_ro/sbin
	...

which can be used for most "Linux live CD" and "root NFS" systems.

The nfsroot.sh script is a nice example of how to use cowfs for
root NFS environments.


logfs - a filesystem activity logger
------------------------------------

The logfs wrapper has two configuration variables: $LOGFS_ROLOG and
$LOGFS_RWLOG. The first one is the logfile name for all read-only operations
and the 2nd one is the logfile for all read-write operations.

Note that both logfiles must exist already. They are not created by the logfs
wrapper.


megalomaniacfs - a filesystem wrapper for faking write access everywhere
------------------------------------------------------------------------

to be done.


Have fun,
 - clifford <www.clifford.at>

