
ident $Id: README,v 1.3 2003/10/13 13:35:19 raven Exp $

This README describes the purpose of this kit and how to use it.

Ghosting
========

Ghosting of map directories allows you to see the directories in the
autofs map without mounting them. When they are accessed, such as when
a directory listing is requested the map entry is mounted so that it
is seen.

This feature has been implemented for file, nis and ldap maps.

For it to work an updated autofs4 kernel module is needed.

There are two ways to update the kernel module. One is to apply a
patch to your kernel source tree as described below. If you wish to
compile autofs4 into the kernel then you must use this method. It is
also possible to build and install an autofs4 module, that matches
your kernel without also building a new kernel. In order to do this
you must have the kernel headers for your running kernel installed.


Compile a Kernel Module Seperately
==================================

You must have a tree of kernel header files that match the running
kernel to use this method.

The required header files will be available as a package in most,
if not all distributions. For example in RedHat the kernel-source
package has the header files that correspond to the kernel package.
In Debian there is a kernel-headers package which has the headers
for the corresponding kernel-image package.

Of course, if you have compiled and installed a kernel then you 
has a matching set of header files.

Now.

Edit Makefile.conf and set the KERNELDIR to point to the base
directory of your kernel source (or headers) tree.

eg.

KERNELDIR = /usr/src/linux-2.4.20-8

Next, if you are running a RedHat packaged kernel for RedHat 9 or above 
then you need to set the REDHAT macro to yes because some of the patches
that RedHat apply change some internal data structures as well as some
Makefiles.

eg.

REDHAT = yes

Now.

make
make install

and you are done.

To revert to the original module (if there was one).

make uninstall

should do it.


Applying a Kernel Patch
=======================

Patches that can be applied to the autofs4 kernel module are located
in the patches directory. If you have installed from an rpm then they
can be found in the packages' doc directory after install. They
consist of one for kernel version 2.4.18 and below and another for
kernel version 2.4.19 and above. The 2.2 kernel patch, also present
is for the autofs-4.0.0 and does not provide the same functionality
as the 2.4 patches. If you are running RedHat 9 with a RedHat kernel
of 2.4.20 or above you will need to use the RedHat specific patch.

The patch naming convention is autofs4-2.4.nn-yyyymmdd.patch or
autofs4-2.4.mm-redhat-yyyymmdd.patch.

To apply one of these patches:

1) change to the root of your kernel source tree.
2) save a copy of include/linux/auto_fs* fs/autofs4/*
3) patch the kernel
4) make the kernel

If you are compiling autofs4 into the kernel you now install the
kernel and you are done.

If you are using autofs4 as a module there are a couple of extra
steps.

5) make modules
6) save a copy of /lib/modules/<kernel version>/kernel/fs/autofs4/autofs4.o
7) copy the updated kernel module.

Like this:

cd <source_tree_base_dir> 
tar cf <backup_tar_file> include/linux/auto_fs* fs/autofs4/*
patch -p1 < <path_to_patch_directory>/autofs4-2.4.nn-yyyymmdd.patch
make modules
cp /lib/modules/<kernel version>/kernel/fs/autofs4/autofs4.o <backup_location>
cp fs/autofs4/autofs4.o /lib/modules/<kernel version>/kernel/fs/autofs4

and away you go.

To revert to the original module (if there was one) simple copy the
original autofs4.o to its proper location in the module tree from the
backup copy you made.

Make sure autofs is not running and remove your current autofs4 module
(rmmod autofs4) if it is in use before starting autofs to get the new
one.

