next up previous
Next: Basic Device Creation Up: FUSD: A Linux Framework Previous: Why use FUSD?

Subsections

Installing FUSD

This section describes the installation procedure for FUSD. It assumes a good working knowledge of Linux system administration.

Prerequisites

Before installing FUSD, make sure you have all of the following packages installed and working correctly:

Compiling FUSD as a Kernel Module

Before compiling anything, take a look at the Makefile in FUSD's home directory. Adjust any constants that are not correct. In particular, make sure KERNEL_HOME correctly reflects the place where your kernel sources are installed, if they aren't in the default location of /usr/src/linux.

Then, type make. It should generate a directory whose name looks something like obj.i686-linux, or some variation depending on your architecture. Inside of that directory will be a number of files, including:

Compilation of the kernel module will fail if the dependencies described in the previous section are not satisfied. The module must be compiled again Linux kernel must be v2.4.0 or later, and the kernel must have devfs support enabled.

Testing and Troubleshooting

Once everything has been compiled, give it a try to see if it actually does something. First, use insmod to insert the FUSD kernel module, e.g. insmod obj.i686-linux/kfusd.o. A greeting message similar to ``fusd: starting, Revision: 1.50'' should appear in the kernel log (accessed using the dmesg command, or by typing cat /proc/kmsg). You can verify the module has been inserted by typing lsmod, or alternatively cat /proc/modules.

Once the module has been inserted successfully, trying running the helloworld example program. When run, the program should print a greeting message similar to /dev/hello-world should now exist - calling fusd_run. This means everything is working; the daemon is now blocked, waiting for requests to the new device. From another shell, type cat /dev/hello-world. You should see Hello, world! printed in response. Try killing the test program; the corresponding device file should disappear.

If nothing seems to be working, try looking at the kernel message log (type dmesg or cat /proc/kmsg) to see if there are any errors. If nothing seems obviously wrong, try turning on FUSD kernel module debugging by defining CONFIG_FUSD_DEBUG in kfusd.c, then recompiling and reinserting the module.

Installation

Typing make install will copy the FUSD library, header files, and man pages into /usr/local. The FUSD kernel module is not installed automatically because of variations among different Linux distributions in how this is accomplished. You may want to arrange to have the module start automatically on boot by (for example) copying it into /lib/modules/your-kernel-version, and adding it to /etc/modules.conf.

Making FUSD Part of the Kernel Proper

The earlier instructions, by default, create a FUSD kernel module. If desired, it's also very easy to build FUSD right into the kernel, instead:

  1. Unpack the 2.4 kernel sources and copy all the files in the include and kfusd directories into your kernel source tree, under drivers/char. For example, if FUSD is in your home directory, and your kernel is in /usr/src/linux:
            cp ~/fusd/kfusd/* ~/fusd/include/* /usr/src/linux/drivers/char
    

  2. Apply the patch found in FUSD's patches directory to your kernel source tree. For example:
            cd /usr/src/linux
            patch -p0 < ~/fusd/patches/fusd-inkernel.patch
    
    The FUSD in-kernel patch doesn't actually change any kernel sources proper; it just adds FUSD to the kernel configuration menu and Makefile.
  3. Using your kernel configurator of choice (e.g. make menuconfig), turn on the FUSD options. It will be under the ``Character devices'' menu.
  4. Build and install the kernel as usual.


next up previous
Next: Basic Device Creation Up: FUSD: A Linux Framework Previous: Why use FUSD?