LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-24-2003, 11:31 AM   #1
tungsten
Member
 
Registered: Jun 2003
Location: Orust, Sweden
Distribution: Slackware current
Posts: 95

Rep: Reputation: 15
Question Driver compile problem


Hi,

I have installed D-Link DFE-530TX network card on a machine with Windows 2000 and SuSe 8.1 Professional.

Windows 2000 take the card but not SuSe 8.1.

Tried to compile the card's driver source file in accordance with the manufacturers text file (linux.txt) the tricky part attached below:

" Compile the driver source files and it will generate rhinefet.o, and copy it to correct driver installation path (The installation directory is different in different kernel versions. In 2.4.x kernel, the path is /lib/modules/KERNEL_VERSION/ kernel/drivers/ net/, and in 2.2.x kernel, the path is /lib/modules/ KERNEL_VERSION/net/ , the KERNEL_VERSION (see above) means the kernel version of your Linux distribution. If you don't know your kernel version , please run 'uname -r' command in command line. The kernel version will look like '2.2.16', '2.4.2-2smp' etc.) : make install "

Have tried following command with no results:

' make install '

' ./configure --prefix=/lib/modules/ KERNEL_VERSION/kernel/drivers/net/ '

Do you have some advise?

Best regards
tungsten
 
Old 08-24-2003, 11:33 AM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
No results? That's very strange indeed.

Usually you will either succeed and install, or fail with error messages that actually mean something.

Post them.
 
Old 08-24-2003, 12:25 PM   #3
tungsten
Member
 
Registered: Jun 2003
Location: Orust, Sweden
Distribution: Slackware current
Posts: 95

Original Poster
Rep: Reputation: 15
Hi fancypiper,

I have done some more tests and the message comming up for

- ' make install ' is 'command not found'

- ' ./configure --prefix=/lib/modules/2.4.18-4GB/kernel/drivers/net/ ' is 'No such file or directory'

The text of the driver's make file are as attached.

/tungsten

VMNS = 1

OBJS := rhine_main.o rhine_proc.o
SRC = rhine_main.c rhine_proc.c
TARGET = rhinefet.o

KSP := /lib/modules/$(shell uname -r)/build \
/usr/src/linux-$(shell uname -r) \
/usr/src/linux-$(shell uname -r | sed 's/-.*//') \
/usr/src/kernel-headers-$(shell uname -r) \
/usr/src/kernel-source-$(shell uname -r) \
/usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
/usr/src/linux

ifeq ($(VMNS),1)
OBJS+=rhine_vmns.o
SRC+=rhine_vmns.c
endif

test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
KSP := $(foreach dir, $(KSP), $(test_dir))

KSRC := $(firstword $(KSP))
#KSRC :=/usr/src/ksrc/RedHat/7.2/linux-2.4.7-10alt-ent
ifeq (,$(KSRC))
$(error Linux kernel source not found)
endif

VERSION_FILE := $(KSRC)/include/linux/version.h
CONFIG_FILE := $(KSRC)/include/linux/config.h

ifeq (,$(wildcard $(VERSION_FILE)))
$(error Linux kernel source not configured - missing version.h)
endif

ifeq (,$(wildcard $(CONFIG_FILE)))
$(error Linux kernel source not configured - missing config.h)
endif

ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
CC := kgcc gcc cc
else
CC := gcc cc
endif

test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
CC := $(foreach cc, $(CC), $(test_cc))
CC := $(firstword $(CC))

CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
CFLAGS += -I$(KSRC)/include -I. -Wstrict-prototypes -fomit-frame-pointer
CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")

KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | grep UTS_RELEASE | \
awk '{ print $$3 }' | sed 's/\"//g')

KERVER2=$(shell uname -r | cut -d. -f2)

.SILENT: $(TARGET) clean

ifeq ($(TARGET), rhinefet.o)
ifneq ($(KVER),$(shell uname -r))
$(warning ***)
$(warning *** Warning: kernel source version ($(KVER)))
$(warning *** does not match running kernel ($(shell uname -r)))
$(warning *** Continuing with build,)
$(warning *** resulting driver may not be what you want)
$(warning ***)
endif
endif

INSTDIR := $(shell find /lib/modules/$(KVER) -name $(TARGET) -printf "%h\n" | sort | head -1)

ifeq (,$(INSTDIR))
ifeq (,$(KERVER2))
ifneq (,$(wildcard /lib/modules/$(KVER)/kernel))
INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net
else
INSTDIR := /lib/modules/$(KVER)/net
endif
else
ifneq ($(KERVER2),2)
INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net
else
INSTDIR := /lib/modules/$(KVER)/net
endif
endif
endif

# look for SMP in config.h
SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
grep CONFIG_SMP | awk '{ print $$3 }')
ifneq ($(SMP),1)
SMP := 0
endif

ifeq ($(VMNS), 1)
CFLAGS += -DVMNS
endif

ifeq ($(TARGET), rhinefet.o)
ifneq ($(SMP),$(shell uname -a | grep SMP > /dev/null 2>&1 && echo 1 || echo 0))
$(warning ***)
ifeq ($(SMP),1)
$(warning *** Warning: kernel source configuration (SMP))
$(warning *** does not match running kernel (UP))
else
$(warning *** Warning: kernel source configuration (UP))
$(warning *** does not match running kernel (SMP))
endif
$(warning *** Continuing with build,)
$(warning *** resulting driver may not be what you want)
$(warning ***)
endif
endif

ifeq ($(SMP), 1)
CFLAGS += -D__SMP__
endif

$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
$(LD) -r $^ -o $@
echo; echo
echo "**************************************************"
echo "Build options:"
echo " VERSION $(KVER)"
echo -n " SMP "
if [ "$(SMP)" = "1" ]; \
then echo "Enabled"; else echo "Disabled"; fi
echo -n " VMNS "
if [ "$(VMNS)" = "1" ]; \
then echo "Enabled"; else echo "Disabled"; fi
echo "***************************************************"

install: clean $(TARGET)
mkdir -p $(MOD_ROOT)$(INSTDIR)
install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
@if [ -f $(MOD_ROOT)$(INSTDIR)/via-rhine.o ] ; then \
echo "***** Move official driver via-rhine.o to via-rhine.o.backup" ; \
echo "mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup";\
mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup ; \
echo ;\
fi ;
@if [ -f $(MOD_ROOT)$(INSTDIR)/linuxfet.o ] ; then \
echo "***** Move previous driver linuxfet.o to linuxfet.o.backup" ; \
echo "mv $(MOD_ROOT)$(INSTDIR)/linuxfet.o $(MOD_ROOT)$(INSTDIR)/linuxfet.o.backup";\
mv $(MOD_ROOT)$(INSTDIR)/linuxfet.o $(MOD_ROOT)$(INSTDIR)/linuxfet.o.backup ; \
echo ;\
fi ;

ifeq (,$(MOD_ROOT))
/sbin/depmod -a || true
else
/sbin/depmod -b $(MOD_ROOT) -a || true
endif

uninstall:
rm -f $(INSTDIR)/$(TARGET)
@if [ -f $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup ] ; then \
echo "***** Restore official driver vai-rhine.o from $(MOD_ROOT)$(INSTDIR)".; \
echo "mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup $(MOD_ROOT)$(INSTDIR)/via-rhine.o";\
mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup $(MOD_ROOT)$(INSTDIR)/via-rhine.o ;\
fi
/sbin/depmod -a


clean:
rm -f $(TARGET) $(SRC:.c=.o) *~

-include .depend.mak
 
Old 08-24-2003, 12:45 PM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
You need to install the developmental packages and apparently your kernel-sources isn't installed either. You will have to install those first.

# Guides to software management
LNAG - How do I install a program I downloaded from the Internet?
Rute Guide's software explanation
You might want to check out CheckInstall to manage source code installations/uninstallation

# Compiling/installing kernel modules
You will need to have installed:
1. The developmental packages (compiler)
2. The kernel source code that matches your running kernel
3. The module source or install code

Check out your system and look under the hood and see if you installed the stuff you need to do the job. Open an x terminal and type in this sequence of commands to see what kernel we are running and see if you have the kernel source installed:
Code:
[fancy@tinwhistle fancy]$ su -
Password: 
[root@tinwhistle root]# uname -r
2.4.18-3
I am running kernel version 2.4.18-3. Do I have the proper source code?
Code:
[root@tinwhistle root]# cd /usr/src
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          136 Jun 12 14:53 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.18-3
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
I do have the same kernel version source code installed in the directory /usr/src/linux-2.4.18-3 and there is a symbolic link named linux-2.4 pointing to it.

If you don't see something similiar to this (but in color), you will need to install the kernel source.

NOTE: I noticed that Red Hat didn't make the symbolic link /usr/src/linux that all of the INSTALL files that I have read mentioned that I need, so I may as well make one now to save editing the files in the source code to install.So, I'll make it just now:
Code:
[root@tinwhistle src]# ln -s linux-2.4.18-3 linux         
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          160 Jun 12 15:46 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun 12 15:46 linux -> linux-2.4.18-3
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.18-3
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
Ah, there it is, so that's done.

Next, did I install the compiler?
Code:
[root@tinwhistle src]# gcc -v          
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[root@tinwhistle src]#
Yes, I have a compiler installed.

If you don't have those two things installed, you have to install them first off your install CD.

If they are installed, download the source and happy comiling. Make sure you carefully read the README and INSTALL files after extracting and before compiling/installing.

Last edited by fancypiper; 08-24-2003 at 12:46 PM.
 
Old 08-24-2003, 02:12 PM   #5
tungsten
Member
 
Registered: Jun 2003
Location: Orust, Sweden
Distribution: Slackware current
Posts: 95

Original Poster
Rep: Reputation: 15
Thumbs up Thanks for the help fancypiper

Hi fancypiper,

Thanks for your help, it explains a lot of things for me.

Yours faithfully
tungsten
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Berlios WLAN driver compile problem roastario Linux - Hardware 1 06-14-2005 01:39 PM
spca5xx driver compile problem zappos Mandriva 10 03-05-2005 05:50 AM
D-Link DFE-528TX driver compile problem. Mee Linux - Networking 2 01-07-2005 06:19 PM
PowerVR (KyroII) driver compile problem on 2.6.0 popey Linux - General 0 01-09-2004 03:15 PM
modem driver compile problem junks Linux - Software 5 01-13-2003 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration