Install-guide -- An installation guide.  

Written by Bas Laarhoven (sjl) & Kai Harrekilde-Petersen.
Last update: 30/06/94 by sjl, for ftape v1.13


WHAT YOU NEED:
--------------
1)	the floppy tape driver distribution file
        `ftape-1.13.tar.gz' (this file is a part of it).
2)	the kernel sources for Linux 0.99pl14t or later. If you know
        what you're doing you can use the driver with older kernel
        versions, but you have to hack the ftape and modules
        support in the kernel yourself!
3)      recent modules utilities: `modutils-0.99.14.tar.gz' (or later).

(Of course, you also need a tape drive installed and the appropriate
tools to compile the sources)


INSTALLATION STEPS:
-------------------
  Installation of the ftape driver consists of two main steps:

-	Reconfiguring the kernel for ftape support.
-	Compilation of the ftape driver proper.

  If it's the first time you install ftape, you'll need these
additional steps:

-	Compilation of the `modules' utilities.
-	Creation of the ftape devices.
-	Installation of syslog[dk] (not necessary, but rather useful).


1)      Reconfiguring the kernel for ftape support:
---------------------------------------------------
  If you don't have the proper kernel sources installed, do so now.
The ftape driver needs access to some kernel source-files and searches
the /usr/src/linux path. If you're sources are installed somewhere else
you'll have to patch the driver or set up a symbolic link.

  Since the both the `modules' and `ftape' support are included with
the standard kernel since 0.99pl14t, there is no longer a need for
patching the kernel.

        cd /usr/src/linux ; make config

  Be sure to answer yes to 'QIC-117 tape support', and 3 for the
NR_FTAPE_BUFFERS (unless you know what you're doing!).
It is *not* necessary to include QIC-02 support for proper functioning
(contrary to what has been said on the net).

	make dep; make clean ; make

  Take a nap, read the newspaper or drink some tea / coffee while the kernel
is being recompiled (this takes about 20 min on a 486DLC/33 box).

  Install the new kernel (keep the old one around, in case you can't boot with
the new one) and reboot.


  Assuming no errors occurred during the compile, we're now ready to compile
the modules utilities.

2)	Compilation of the `modules' utilities:
-----------------------------------------------
(You can skip this step if you have a recent set of modutils ready)

  The modules utilities are in a separate package (see above) that contains
the following three programs: lsmod, insmod and rmmod.
After unpacking the sources in `/usr/src/modules' build these utilities:

	cd /usr/src/modules ; make

  Test the utils by saying (as root) 'insmod drv_hello.o' This results in a
message like this (if you're running X, you wont see these messages):

	module `drv_hello' (1 pages @ 0x01023000) created
	initializing module `drv_hello', 140 (0x8c) bytes
	  init entry @ 0x01023034, cleanup entry @ 0x01023074
	drv_hello.c: init_module called
	hello, world

Then do a 'lsmod'. This will result in something like:

	Module:        #pages:
	drv_hello          1

  This means that everything worked out OK.  Now that drv_hello has served
it's purpose, remove it again:

	rmmod drv_hello

Install the *mod utilities somewhere handy, eg: in /sbin.

	cd *mod /sbin

NOTE: it may NOT be a good idea to install them on a NON-root partition, as
they may be needed in an emergency situation (restore after a system crash)

3)	Creation of the ftape devices:
--------------------------------------
(You can skip this step if you already have these devices)

Check that you have the correct ftape devices:

	ls -lF /dev/*rft*

crw-rw-rw-   1 root      27,   4 Feb 20 13:01 /dev/nrft0
crw-rw-rw-   1 root      27,   5 Feb 20 13:01 /dev/nrft1
crw-rw-rw-   1 root      27,   6 Feb 20 13:01 /dev/nrft2
crw-rw-rw-   1 root      27,   7 Feb 20 13:01 /dev/nrft3
crw-rw-rw-   1 root      27,   0 Feb 20 13:01 /dev/rft0
crw-rw-rw-   1 root      27,   1 Feb 20 13:01 /dev/rft1
crw-rw-rw-   1 root      27,   2 Feb 20 13:01 /dev/rft2
crw-rw-rw-   1 root      27,   3 Feb 20 13:01 /dev/rft3

If not, make them thus:

	mknod -m 666 /dev/rft0 c 27 0
	mknod -m 666 /dev/rft1 c 27 1
	mknod -m 666 /dev/rft2 c 27 2
	mknod -m 666 /dev/rft3 c 27 3
	mknod -m 666 /dev/nrft0 c 27 4
	mknod -m 666 /dev/nrft1 c 27 5
	mknod -m 666 /dev/nrft2 c 27 6
	mknod -m 666 /dev/nrft3 c 27 7

  These are the raw floppy tape devices and non-rewinding raw floppy
tape devices for drive selection methods A:,B:,C: and D:

  People used to the old naming convention may want to set up
some symbolic links once the drive select is known:

lrwxrwxrwx   1 root            9 Feb 20 13:03 /dev/ftape -> /dev/rft0
lrwxrwxrwx   1 root           10 Feb 20 13:03 /dev/nftape -> /dev/nrft0


4)	Compilation of the ftape driver proper:
-----------------------------------------------

  Unpack the driver sources, enter the directory where they reside
and create the driver by:

	make clean ; make dep ; make

  Look in the Makefile for options with their description. If you're using
gcc 2.4.5 you'll *NEED* to set GCC_2_4_5_BUG, else the driver will fail !

  Kernel version 1.1.24 and up allows the ftape driver to share the
interrupt with the floppy controller without causing havoc when both
are used at the same time. To enable this feature, remove the -DFLOPPY_HACK
from the FTAPE_OPT line in the Makefile. This is only supported by kernel
version 1.1.24 and up, it will hang the driver on earlier kernels !!!

  The `ftape.o' module will only run with the kernel version it's compiled
on, if you get an error message saying that the kernel_version doesn't
match the current kernel, remove the file kernel-version.h (or do a `make
clean') and run `make dep ; make' again.

  There should be *NO* warnings. *ALL* compiler warnings / errors should be
investigated and reported. Unless you're running as root, you'll get a
message about 'Operation not permitted', when trying to insert/remove the
driver.

Insert the compiled ftape driver:

        su
	insmod ftape.o

  This results in a similar message as when you installed the drv_hello.o
module.  You'd probably like to catch the messages that ftape generates with a
syslog daemon.  See (5) below for more.

  If you get any messages of the type `multiple definition of symbol ...'
or `undefined symbol ...' something is wrong with either kernel sources or
modules utilities. *** The kernel 1.1.0 is broken: get a later version ! ***

NOTE: You have to reload the driver *every* time you boot the system (Just as
----- with the modules utilities, it's a good idea to have ftape.o on the root
partition. The filesystem standard suggests somewhere under /boot).
Instead of doing it by hand, you could include the following line in your
/etc/rc.local:

	/sbin/insmod /boot/xxx/ftape.o

  Put a tape in the drive and wait for the drive to stop making noise. Now
type:

	mt -f /dev/rft0 rewind

  This will try to open the device. No tape motion will follow if the tape
is already rewound.
  Because initially `tracing' is set to some value greater than zero, some
debugging output (printk) is generated on the console.

  The messages generated when opening the device can start with some "timeout
on Acknowledge" lines.  This depends on the trace-level, and is normal as long
as the driver is probing for a tape drive.  If they keep appearing after the
device is opened something is wrong.

  If all goes well, messages will appear saying something about "drive-wakeup
compatible with <name>" and "ftape drive is <name>". If not, "unknown drive
type, no response" says that the driver cannot activate the drive.  In this
you can try the other devices (rft1-rft3). In case they all fail the driver
will not work with your drive.

  If some message appears with "unknown vendor id", follow the instructions in
the message so I can include this information with a new release.  In the
meantime the driver will function correctly if it is compatible with one of
the known types.

  Now it's time to setup the symbolic link to the appropriate device or
otherwise substitute the correct device for the /dev/ftape used below:

  Now for some action:

	mt -f /dev/ftape reten

  The tape should wind completely to the end once and back to the beginning
again.

  To see if the driver can read the tape:

        mt -f /dev/ftape fsf 0

  This causes the driver to read the header segment and display the bad
sector and file mark lists.

  Well, that's it! Play around with tar, dd, cpio etc. If anything fails,
make a logfile with `tracing' set to 7 and try to find out what's going wrong.

  How do I set the tracing level ? Either change the var `tracing' in
tracing.c and recompile or do `mt -f /dev/ftape fsr <tracelevel>' (The
latter is a hack, and may disappear with time).

  Before using tar to backup to tape you must erase the tape with
`mt -f /dev/ftape erase'.

  The drive may be put `offline' by the mt commands `rewoffl' and `offline'.
You'll have to reload the driver or insert a new tape to get the drive
online again. While the drive is offline all commands will fail.

5)	Installation of syslog[dk] (not necessary, but rather useful)
---------------------------------------------------------------------
  You'll want to capture the messages that ftape issues with syslogk or
syslogd (NET-2 version).  If you don't have a syslog daemon running add the
following to your rc.local file:

        if [ -x /etc/syslogk ] ; then
                syslogk on 2>&1 >>/var/log/kernel &
        fi

This will append the kernel messages to the file `/var/log/kernel'.  (Make
sure this file exists - do `touch /var/log/kernel' as root)

----------------------- end of the Install-guide -----------------------
