[tulip] Problem with trying to build netdrivers.rpm / Redhat 7 2.2.16-22 - solved

Reiner Wilhelms reiner@speech.mit.edu
Tue, 24 Oct 2000 23:53:49 -0400


Hi there,

I'm glad to report that i could solve the problem. It was ,as was
probably said by the experts hundreds of times before,
just a problem of getting the proper header files and netdrivers.2.0.3
compiles without any complains. I also would like to thank
Tom Kung for sending me an already modified version of the netdriver
package. Here's the story for any one who has a similar problem.
(one might say that they got to be very similar, since in the current
Linux jungle I don't see that any two machines have the same software).

I have a simple (standard installation of Redhat 7, that's the
installation that you get when you just through the CD rom in the
computer's drawer
and let it sit and stirr the disk for half an hour. I had specified to
please also include the kernel sources and so it did. Only it put in the
wong ones.
I can't really reconstruct if this was my mistake or that of the
oversimplified installation procedure.
If I type uname -r,  I get:  2.2.16-22. However, the file
/usr/include/linux/version.h says something like #define UTS_RELEASE
"2.4.0-0.26smp"
That should make you a bit nervous.  Donald Becker had already pointed
out that there isn't a version 2.4 of Linux, maybe next year. But there
are
headers for it. So at any rate, I have the nicer headers with some older
'scummy" version of linux. I had to get the compatible include files.

I finally found on one of the CD roms of the Redhat 7 distribution a
kernel source rpm (kernel-2.2.16-22.src.rpm) and just went ahead and
installed it and
then started the building process. This takes a long time (and when i
did it , it ended with an error termination). What matters is however
that
before it begins to build the kernel it installs all the proper include
files somewhere under /usr/src/redhat/BUILD/linux .... All I needed were
those
include files anyways.  Using the actual include files for the kernel
2.2.16-22 then made all the difference. All I had to do is alter the
Makefile in
the netdrivers distribution.

Below are the steps how to get the include files installed and to get
the netdrivers compiled and installed (for Redhat 7, or let's be careful
, for Redhat 7 on
my machine:-)

needed:  kernel-2.2.16-22.src.rpm

A) install sources:    rpm -ivh   kernel-2.2.16-22.src.rpm

Generates a whole bunch of files under /usr/src/redhat/SOURCES and in
/usr/src/redhat/SPECS is a file called  kernel-2.2.spec

B) build sources:        rpm  -bc  /usr/src/redhat/SPECS/kernel-2.2.spec

runs for half a century and generates in an early phase the include
files under /usr/src/redhat/BUILD/linux

Next one needs to compile netdriver-2.0-3.src.rpm.   I used a version
that Tom Tung sent me. In that one,
someone who he knows had already made a few changes, namely replacing
the gcc by kgcc for the compiler.
I think that the main issue is though to get the proper include files
and use kgcc instead of gcc, as was pointed out to me
by Donald Becker.  (BTW, also the kernel  is compiled using kgcc, while
there isn't even a man page for that on my computer).
To get to the Makefile, one has to extract it from the src.rpm file:

rpm -ivh  netdriver-2.0-3.src.rpm   generates a file netdriver.tgz under
/usr/src/redhat/SOURCES and a
file netdriver.spec under /usr/src/redhat/SPECS. To get to the Makefile
one can
extract the .tgz file using tar zxvf  netdriver.tgz.  In the Makefile
the symbols INCLUDE and
PCMCIA  must be redefined so they point into the proper include file
directories. (See point B above).

After that all that is needed is to compile the netdrivers (using make
in the /usr/src/redhat/BUILD/netdriver directory,
and finally copy the .o file to their proper locations in
/lib/modules/2.2.16-20/net.  A call of /sbin/depmod -a is
also required to find interdependencies in the modules, and finally the
file /etc/modules.conf must contain a statment
'alias eth0 tulip'  so the  tulip module is loaded at boot up time.

Now I am just faced with the new ugly hacking  task to set up a little
network consisting of two computers and a 56 k modem hooked to one of
them.

Much luck to everybody and to myself. I bet I'll be back with more silly
questions.