	INSTALLATION NOTES FOR THE CPCI RPM SRC PACKAGE

Prerequisites
-------------

1. Do not attempt to install this package if there is already a 
   ClassicPCI driver loaded.  Remove the old package first.

2. To build the cpci driver you must have first loaded the kernel
   source tree for your target kernel.  If you are running a prebuilt
   kernel from a packaged distribution, this typically involves loading the
   kernel sources from your distribution CD to /usr/src/linux, then:

       cd /usr/src/linux       Go to the kernel sources root directory 
       cp .config config.save  Save a copy of your current kernel configuration
                               file for your reference
       make mrproper           Clean up any old version files
       make oldconfig          Make a configuration file to match your
                               running kernel
       make menuconfig         To review the options set by "make oldconfig"
                               In particular, "make oldconfig" may not set
                               the SMP flag correctly for your setup.
       make dep                Create the dependency and version files

   Now you can load and build the cpci driver package.

3. In Redhat 7.0, you must install the kgcc RPM package before you
   attempt to install this driver.  The default compiler (gcc 2.96) is
   known to generate buggy code. If the kgcc package is not installed
   before you install this driver package the driver will be compiled
   with the default compiler.  Digi will NOT support this configuration,
   as it may operate unreliably, or could even crash your system.


For the truly impatient
-----------------------
Execute the following commands:
	1> rpm -ivv cpci-1.1.8-11.src.rpm	(prepare for installation)
	2> cd /usr/src/redhat/SPECS
	3> rpm -bi cpci-1.1.8.spec 			(perform make and install)


For the slightly less impatient
-------------------------------
The above commands make and install a working ClassicPCI driver.  However,
rpm does not recognize this as an installed package yet.  In order to
use the full capabilities of the rpm utilities, one needs to go a step
further and create an rpm binary package for their specific architecture,
and then install this package on their machine.  To do this, use instead
the following set of commands:

	1> rpm -ivv cpci-1.1.8-11.src.rpm	(prepare for installation)
	2> cd /usr/src/redhat/SPECS
	3> rpm -bb --target <arch> cpci-1.1.8.spec 		
			(perform make and install AND make binary rpm)
	4> cd /usr/src/redhat/RPMS/<arch>
	5> rpm -ivv cpci-1.1.8-11.<arch>.rpm		(install the package)

<arch> is the architecture of the installation machine (ie i386, i686,
alpha, etc).  NOTE: Older versions of rpm use --buildarch <arch> instead
of --target <arch>.

Note: on newer systems (e.g: RedHat 9), some of the functionality of rpm
has been moved to the rpmbuild utility.  On these systems, substitute
"rpmbuild" for "rpm" in step 3 above.



For those who want a more detailed explanation
----------------------------------------------
Most of the rpm commands allow for -v or -vv to turn on verbose and
double verbose output.

...About the package
--------------------
The file cpci-1.1.8-11.src.rpm is the Linux ClassicPCI
source code rpm package, to be built on any architecture.  You must have
the rpm (Red Hat Package Manager) facility installed on your machine.

...First things first
---------------------
	1> rpm -ivv cpci-1.1.8-11.src.rpm
The first command installs the source code in the SOURCES directory used by 
RPM (/usr/src/redhat/SOURCES).  The actual source code is distributed as a 
zipped tar file.  This command also copies the spec file to the SPEC directory.
/usr/src/redhat/SPECS/cpci-1.1.8.spec is just a text file with some 
script like commands, package information and file list.  

...Installing using the defaults
--------------------------------
You are now ready to build the ClassicPCI driver package.  If you want to
just use the default settings, the build is simple and can be performed
by issuing the commands:

	2> cd /usr/src/redhat/SPECS
	3> rpm -bb --target <arch> cpci-1.1.8.spec 		
			(perform make and install AND make binary rpm)

This will attempt to create an rpm binaries package.
If the build completes without error, you will see the message 
"Wrote:  /usr/src/redhat/RPMS/<arch>/cpci-1.1.8-11.<arch>.rpm"

Note: on newer systems (e.g: RedHat 9), some of the functionality of rpm
has been moved to the rpmbuild utility.  On these systems, substitute
"rpmbuild" for "rpm" in step 3 above.

	4> cd /usr/src/redhat/RPMS/<arch>
	5> rpm -ivv cpci-1.1.8-11.src.rpm		(install the package)

To check if all the files were installed correctly, use

	6> rpm -bl [-vv] cpci-1.1.8.spec

You now have your very own copy of the ClassicPCI Linux package
compiled for your specific architecture and kernel version!  It can
be found in /usr/src/redhat/RPMS/<arch>/cpci-1.1.8-11.rpm 
Next time you do an installation on a machine with the same 
configuration you need just do 
	
	> rpm -ivv cpci-1.1.8-11.<arch>.rpm


Custom installation
-------------------
If you need to customize the Makefiles to reflect your own configuration, 
or modify the source code, this will need to be done prior the build.
To access the Makefile, you have to first unpack the tgz file:

	2> cd /usr/src/redhat/SPECS
	3> rpm -bp cpci-1.1.8.spec

The "-bp" in the options specifies that only the prep section of the spec file
should be executed.  This will, among other things, create the 
/usr/src/redhat/BUILD/cpci-1.1.8 directory and unpack the tarfile
there.  

	4> cd ../BUILD/cpci-1.1.8

You may then make any necessary changes to the Makefile and source code.

WARNING:  you might want to now save the final version of your changes 
somewhere other than in the /usr/src/redhat tree for backup.

WARNING:  if you change the final location that any of the files in the 
package, you will also want to update the %file list in the spec file
/usr/src/redhat/SPECS/cpci-1.1.8.spec.  Otherwise, RPM will complain 
that the installation was incomplete, because some files were not found.
You can also document your changes in the %description section, if you
so desire.

There are several ways to install the driver package at this point, but the
following is the easiest, and safest way:

	5> cd /usr/src/redhat/BUILD 
	6> tar -cvzf ../SOURCES/cpci-1.1.8.tgz cpci-1.1.8/*
	(this will replace the original source code provided by the package)

You can now execute commands 2 through 6 from the section "installing using
the defaults" to install your customized rpm.

Verifying the package
---------------------
You can check if the ClassicPCI package is installed using the verfify (-V)
command line option:
	> rpm -V -vv cpci-1.1.8-11


Loading the driver
------------------

After installing the driver package, you must load the driver.  This is done
by loading the driver initialization script, using the command:

/etc/digicpci/rc.cpci load

This must be done after installing the ClassicPCI RPM package.

If you would like this driver to be loaded upon system boot, you can call
the script from any startup script your system supports.  For example, in
Redhat - the script you'd put the rc.cpci command in, is /etc/rc.local. 
However, this may vary per your linux distribution.

Removing ClassicPCI Linux
-----------------------
If you have built the rpm binaries package as indicated, then you can
use rpm to remove it.  Simply use the erase (-e) command line option:
	> rpm -e -vv cpci-1.1.8-11

Note: If you currently have your ClassicPCI driver loaded, you will have to
remove the module from your running kernel, with the command 'rmmod cpci'.
