
This text is cogent to Systems with an rpm package manager.
 
If kernel-source has been properly prepared, the command sequence:
        ./build_module
        ./ltinst2
        ./autoload
will make your modem installation functional, less dialout configuration.

Once you have confirmed functionality, a final
step is to properly register the software, to gaurantee easy
upgrade and/or removal with your particular Linux
distributions package management tools. 
A command with syntax:
        ./build_rpm -t YourProcessor kernel_version
with particular example is
        ./build_rpm -t i686 2.4.25-3mdk
will output an installer package with a filename:
        ltmodem-kv_2.4.25_3mdk-8.30a3-1.i686.rpm
where the 8.30a3 is the version within the ltmodem-8.30a3.tar.gz

The whole installation will then be redone with the command
        rpm -i ltmodem-2.4.0-5.78e-1.i386.rpm  
but this time, WITH Proper Registration in the RPM database.


Below is a record of a package assembly process. The part
	| tee rpm.txt
is not part of the build  process. Rather it writes a record to rpm.txt
=========================================================================

	./build_rpm -t i686 2.4.21-4.EL | tee rpm.txt


 This ./build_rpm first runs build_module and then assembles a driver Installer.rpm 
 If new to compiling, please first run:    utils/ksp.sh
 to set up your kernel-sources properly. A kernel-source package as installed
 does NOT in general match an installed kernel, but one of several alternative kernels.
 Thus with a niave usage, all procedues could be completed well technically.
 BUT the installed drivers might not be compatible with your kernel,
 of ever reside in the right /lib/modules/Kernel_Version/ tree

 DO run ./build_module which steps through informatively
 before a first use of ./build_rpm
 If ./build_module   completes without error, then run ./build_rpm


 A PREFERRED implementation of ./build_rpm is
                    ./build_rpm -t CPU
 where CPU is taken from the last section of your kernel-package name such as:
               kernel-2.4.25-marv1.i586.rpm
 in which case             CPU ==  i586   and the installer name will be like
    ltmodem-kv-2.4.25-marv1-8.30a3-1.i586.rpm
 without a CPU specification, the default will be your system CPU:  i686
as a Best Guess. The current setting is:
	ltmodem-kv-2.4.21-4.EL-8.30a3-i686.rpm


  Presumable the proper config file among:
-------------------------------------
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-athlon-smp.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-athlon.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i386-BOOT.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i386.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i586-smp.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i586.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i686-hugemem.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i686-smp.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-i686.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-ia64.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-ppc64.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-ppc64iseries.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-ppc64pseries.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-s390.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-s390x.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-x86_64-smp.config
/usr/src/linux-2.4.21-4.EL/configs/kernel-2.4.21-x86_64.config
-------------------------------------
 has been used to define and assembly the kernel-headers to be used in the compile,
     and in particular (hopefully the next line is not blank):
  kernel-2.4.21-i686.config
     If this is not the case, DO utilize utils/ksp.sh,
  to first assembly appropriate kernel-headers.
  If a forth coming release, this process will be automated.
 

 Advanced Usages
 ---------------
 To adjust to a  PC with a different processor, the nomemclature is
                    ./build_rpm -t CPU
 where CPU is one of the following (see the kernel-sources configure.help file):
   athlon-smp athlon i386-BOOT i386-smp i386 i586-smp i586 i686-bigmem
   i686-debug i686-smp i686-uml i686 x86_64-smp x86_64

 To use kernel-headers deliberately NOT matching the current kernel-2.4.25-marv1,
 use nomenclature such as
                    ./build_rpm -t CPU target_version
 with target_version the "uname -r" of the matching kernel-headers.
 Read build_rpm as a text file for more information on these usages. 

 Abort with Ctrl-C at any time, or  

The Linux distribution is:   debian, testing/unstable  
TARGET_VERSION=2.4.21-4.EL
	End of distribution check.

Removing old makings and expanding a clean source.tar.gz 
Setting BLDrecord.txt link within source/ folder.
lrwxr-xr-x    1 root     root           16 Apr 29 15:24 BLDrecord.txt -> ../BLDrecord.txt
Setting ./tmpfile link within source/ folder.
lrwxr-xr-x    1 root     root           12 Apr 29 15:24 ./tmpfile -> .././tmpfile
Searching for a kernel-headers-2.4.21-4.EL resource.
KERNEL_HEAD_ALT= /usr/src/linux /usr/src/kernel-headers-2.4.21-4.EL /usr/src/kernel-header+2.4.21-4.EL /usr/src/linux-2.4.21-4.EL /lib/modules/2.4.21-4.EL/build
  ... in /usr/src/linux: nope
  ... in /usr/src/kernel-headers-2.4.21-4.EL: nope
  ... in /usr/src/kernel-header+2.4.21-4.EL: nope
  ... in /usr/src/linux-2.4.21-4.EL: Kernel headers found in /usr/src/linux-2.4.21-4.EL
  ... in /lib/modules/2.4.21-4.EL/build: nope
  using /usr/src/linux-2.4.21-4.EL
Found kernel-headers-2.4.21-4.EL for compiling drivers.

Your running kernel is version-2.4.25-marv1,
  but the modem drivers will be compiled for a 2.4.21-4.EL kernel.

Performing a configure trial and capturing the report to ../conf-report.txt.
Parsing the report:
	No evident problems.

creating cache ./config.cache
Checking OS
Checking machine type
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
Checking gcc major version 3
Checking for rpm build... rpmbuild
checking for a BSD compatible install... /usr/bin/install -c
checking for make... yes
checking for ld... yes
Checking for kernel headers
  using /usr/src/linux-2.4.21-4.EL
Checking kernel header version
  kernel headers are version 2.4.21-4.EL
Version of kernel sources (2.4.21-4.EL) does not match the version
of the running kernel (2.4.25-marv1)
Version mismatch, using force (building for 2.4.21-4.EL)...
System has rpm. Checking for standard installed kernel packages
No kernel package, test for package that provides the kernel (SuSe)
RPM will require no package provides kernel = 2.4.21-4.EL
The installer will be for KERNEL_VERSION 2.4.21-4.EL
  has irq_spinlock in async_struct 1
updating cache ./config.cache
creating ./config.status
creating Makefile
creating autoload
creating cleanup
creating ltmodem.spec

The check for compilation tools and general resources was successful.
Within DOCs/ there is an annotated conf-report.txt
The Makefile and down steam installation scripts have been created.

Next checking for the the needed header file:	modversions.h
Found: /usr/src/linux-2.4.21-4.EL/include/linux/modversions.h

Next checking utilty versions,
           Version_min 
 Utility    or range for kernels   
   name     2.2.16       2.4.18          Actual_version   
-------------------------------------------------------------------
Gnu C      2.7.2.3      2.95.3-2.9.99   3.3.3
Gnu make   3.77         3.79.1          
binutils   2.8.1.0.23   2.9.1.0.25      2.14.90.0.4

-------------------------------------------------------------------

  The gcc compiler resources available are:
 ----------------------------
 lrwxr-xr-x    1 root     root           16 Apr 13 22:42 /usr/bin/gcc -> /usr/bin/gcc-3.3
-rwxr-xr-x    1 root     root        74088 Mar 17  2003 /usr/bin/gcc-2.95
-rwxr-xr-x    1 root     root        80812 Apr 16  2003 /usr/bin/gcc-3.2
-rwxr-xr-x    1 root     root        84780 Feb 16 07:33 /usr/bin/gcc-3.3
lrwxrwxrwx    1 root     root           10 Nov  7 10:59 /usr/bin/gccbug -> gccbug-3.3
-rwxr-xr-x    1 root     root        15934 Apr 15  2003 /usr/bin/gccbug-3.2
-rwxr-xr-x    1 root     root        15986 Feb 16 07:24 /usr/bin/gccbug-3.3
 ----------------------------
 with your System currently using version 3.3.3
 Do NOT mix the major versions of compilers for the kernel and modem drivers
 or your System will crash! The following releases are using gcc version 3.2.x :
    Mandrake 9, Redhat 8 and SuSE 8.1 in November 2002.


Using KCFLAGS for gcc version 3.x
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-4.EL/include -Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -DMODULE -DLT_VERSION=8.30a3 -DLINUX -DNO_EEPROM -DLT_SERIAL_MODULE=lt_serial -DHAS_IRQSPINLOCK -c -o ltmodem.a ltmodem.c
objcopy -W x_input ltmdmobj.o ./xxx.o
ld -r -defsym x_input_orig=x_input -o ./xxx1.o ./xxx.o
ld -r -o lt_modem.o ltmodem.a ./xxx1.o
rm -f ./xxx.o
rm -f ./xxx1.o
#ld -r -o lt_modem.o ltmodem.a ltmdmobj.o
Using KCFLAGS for gcc version 3.x
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-4.EL/include -Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -DMODULE -DLT_VERSION=8.30a3 -DLINUX -DNO_EEPROM -DLT_SERIAL_MODULE=lt_serial -DHAS_IRQSPINLOCK -c -o serial-lt-2.4.a serial-lt-2.4.c
ld -r -o lt_serial.o serial-lt-2.4.a

Checking for driver products:
-rw-r--r--    1 root     root       549199 Apr 29 15:24 lt_modem.o
-rw-r--r--    1 root     root        29066 Apr 29 15:24 lt_serial.o

  Only one driver pair can be compiled 
    when kernel-headers and the running kernel are not version matched.

Skipping depmod tests because drivers and kernel
   are deliberately not version matched.


===========================================================================

Copying newly compiled drivers to folder ../drivers-2.4.21-4.EL as a backup,
  as the source/ folder will be deleted during next run of:  build_rpm
total 576
-rw-r--r--    1 root     root       549199 Apr 29 15:24 lt_modem.o
-rw-r--r--    1 root     root        29066 Apr 29 15:24 lt_serial.o

Removing installation links if necessary:
which should NOT be used when the modem drivers
are Not version or flavor matched with the current kernel-2.4.25-marv1
or after assembly of Debian or RPM installer packages.
Removed symbolic link: ltuninst2

Two steps in the complete installation procedure are not implemented
when a forced versioning is implemented : FORCED=--with-force=yes --with-kernel=/usr/src/linux-2.4.21-4.EL
is implemnted:
First, the modem device nodes are not made;
Second autoloading of the drivers are not provided for.
Do browse the files in DOCs/ should you wish to proceed thus By Hand.


rm -rf rpmball
mkdir rpmball
cp -f lt_modem.o lt_serial.o rpmball
cp -af 1ST-READ CHANGELOG UPDATES-BUGS DOCs utils rpmball
cp -f ltmodem.spec rpmball
tar czf rpmball.tar.gz rpmball
rpmbuild -tb --clean --target i686 rpmball.tar.gz
Building target platforms: i686
Building for target i686
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.43825
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.43825
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.43825
Processing files: ltmodem-kv_2.4.21_4.EL-8.30a3-1
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.72091
Finding  Provides: (using /usr/lib/rpm/find-provides)...
Finding  Requires: (using /usr/lib/rpm/find-requires)...
PreReq: /bin/sh /bin/sh rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Requires(post): /bin/sh
Requires(preun): /bin/sh
Requires: kernel = 2.4.21-4.EL /bin/bash /bin/sh
Wrote: /usr/src/rpm/RPMS/i686/ltmodem-kv_2.4.21_4.EL-8.30a3-1.i686.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.2381
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.2381
rm -rf rpmball rpmball.tar.gz

Install the generated rpm with the command

rpm -i ltmodem-kv_2.4.21_4.EL-8.30a3-1.i686.rpm

or

rpm -Uvh ltmodem-kv_2.4.21_4.EL-8.30a3-1.i686.rpm


