LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error while trying to compile realtek8168 network driver package (https://www.linuxquestions.org/questions/linux-newbie-8/error-while-trying-to-compile-realtek8168-network-driver-package-775195/)

mylvarab 12-12-2009 01:43 PM

error while trying to compile realtek8168 network driver package
 
I am trying to install the driver for realtek network 8111c chip on Linux kernel2.6.9-34ELsmp. I downloaded the package, unpacked the distribution and tried to compile but run into this error when I do a make all.

makefile details below.........


make -C src/ clean
make[1]: Entering directory `/root/r8168-8.008.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
make[1]: Leaving directory `/root/r8168-8.008.00/src'
make -C src/ modules
make[1]: Entering directory `/root/r8168-8.008.00/src'
make -C SUBDIRS=/root/r8168-8.008.00/src modules
make: *** SUBDIRS=/root/r8168-8.008.00/src: No such file or directory. Stop.
make: Entering an unknown directorymake: Leaving an unknown directorymake[1]: *** [modules] Error 2
make[1]: Leaving directory `/root/r8168-8.008.00/src'
make: *** [modules] Error 2

[root@localhost r8168-8.008.00]# ls
Makefile readme release_note.txt src

Top level makefile

################################################################################
all: clean modules install

modules:
$(MAKE) -C src/ modules

clean:
$(MAKE) -C src/ clean

install:
$(MAKE) -C src/ install


[root@localhost r8168-8.008.00]# cd src
[root@localhost src]# ls
Makefile Makefile_linux24x r8168.h r8168_n.c
[root@localhost src]#

Makefile


################################################################################

KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
KMISC := /lib/modules/$(KVER)/kernel/drivers/net/
KEXT := $(shell echo $(KVER) | sed -ne 's/^2\.[567]\..*/k/p')o
KFLAG := 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x

modules:
ifeq ($(KFLAG),24x)
$(MAKE) -f Makefile_linux24x
else
$(MAKE) -C SUBDIRS=$(PWD)/src modules
strip --strip-debug r8168.$(KEXT)
endif

clean:

business_kid 12-12-2009 02:03 PM

Hmmm. I would first try
cd /root/r8168-8.008.00
make modules

The '-C' makes it do a cd there before building. It seems to be attempting to cd into the src directory when it is already there. I am taking it the Makefile is in /root/r8168-8.008.00, and the .c and .h files in /root/r8168-8.008.00/src/
As a side point, it's safer not to build as root; build as a luser, install as root.

mylvarab 12-13-2009 05:28 AM

unable to compile realtek 8168 package on kernel 2.6.9-34.ELsmp
 
Has anybody tried to compile the realtek 8168 driver package on linux kernel 2.6.9-34.ELsmp. make tried to cd into lib/modules/2.6.9-34.ELsmp/build....this build directory does not exist. I am not sure what the contents are in the build directory but when I cd lib/modules/2.6.9-34.ELsmp I dont see a build directory there.

Any ideas..


[root@localhost r8168-8.011.00]# make
make -C src/ clean
make[1]: Entering directory `/home/mylvarab/r8168-8.011.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
make[1]: Leaving directory `/home/mylvarab/r8168-8.011.00/src'
make -C src/ modules
make[1]: Entering directory `/home/mylvarab/r8168-8.011.00/src'
make -C /lib/modules/2.6.9-34.ELsmp/build SUBDIRS=/home/mylvarab/r8168-8.011.00/src modules
make: *** /lib/modules/2.6.9-34.ELsmp/build: No such file or directory. Stop.
make: Entering an unknown directorymake: Leaving an unknown directorymake[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/mylvarab/r8168-8.011.00/src'
make: *** [modules] Error 2

business_kid 12-14-2009 03:36 AM

I presume you have modules for that kernel in /lib/modules/<version>.
Make sure you are running on that kernel, as the package will use uname to detect the correct kernel
/lib/modules/u.6.34whatever/build should point to the kernel source in /usr/src/linux-<version>

ln -sf /usr/src/linux-2.6.9-34.ELsmp /lib/modules/2.6.9-34.ELsmp/build

should accomplish that. Then we'll move on to the next error :).

mylvarab 12-17-2009 04:36 AM

or while trying to compile realtek8168 network driver package
 
I dont have the kernel in /usr/src. It is empty.

This is what I have in /usr/lib/modules/2.6.9-34.Elsmp

[root@localhost 2.6.9-34.ELsmp]# pwd
/lib/modules/2.6.9-34.ELsmp
[root@localhost 2.6.9-34.ELsmp]# ls
kernel modules.dep modules.isapnpmap modules.usbmap
modules.alias modules.ieee1394map modules.pcimap
modules.ccwmap modules.inputmap modules.symbols


I dont find a build directory. Do I have to change build to kernel in the makefile ?

business_kid 12-18-2009 03:22 AM

OK. So you have to install the kernel source. It's linux-something or kernel-something and has the word source in it. You can use the distro package, I used the tarball from kernel.org. 642Megs is the built kernel. It would shrink by 200 megs if I ran 'make clean'

bash-3.1$ du -sh linux*
642M linux-2.6.30.5
57M linux-2.6.30.5.tar.bz2

mylvarab 12-30-2009 09:16 AM

Okay I have installed the source for linux-2.6.32.1, so I have to compile this first.

Then I have to go into realtek directory and then compile from their so it gets compiled with the kernel.

Then I have to restart the system with the new kernel, How do I do that?

business_kid 12-31-2009 03:29 AM

No, you start in the top source directory
cd /usr/src/linux-2.6.32

To save myself typing, this is good
http://www.linuxfromscratch.org/lfs/...08/kernel.html

mylvarab 01-02-2010 03:13 AM

error while trying to compile kernel source tree
 
I am trying to compile the linux kernel 2.6.32.1 and it fails with this error.

Any ideas


[root@localhost linux-2.6.32.1]# make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
CC kernel/rcutree.o
kernel/rcutree.c: In function `__rcu_init':
kernel/rcutree.h:301: sorry, unimplemented: inlining failed in call to 'rcu_bootup_announce': function body not available
kernel/rcutree.c:1740: sorry, unimplemented: called from here
make[1]: *** [kernel/rcutree.o] Error 1
make: *** [kernel] Error 2

AwesomeMachine 01-02-2010 03:57 AM

You need to update the system. If you're using Red Hat: yum update. If you're using Debian: apt-get update and then apt-get upgrade. If you're using a stock kernel, all the network device modules would ordinarily be compiled.

mylvarab 01-14-2010 05:31 AM

am trying to compile the linux kernel 2.6.32.1 and it fails with this error.

Any ideas


[root@localhost linux-2.6.32.1]# make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
CC kernel/rcutree.o
kernel/rcutree.c: In function `__rcu_init':
kernel/rcutree.h:301: sorry, unimplemented: inlining failed in call to 'rcu_bootup_announce': function body not available
kernel/rcutree.c:1740: sorry, unimplemented: called from here
make[1]: *** [kernel/rcutree.o] Error 1
make: *** [kernel] Error 2

business_kid 01-15-2010 04:14 AM

To me, this looks like a versions issue. This box, for example, runs slackware-12.0. I am shy of updating it because it has an old Nvidia card, and I _can't_ update the driver for that. I recently threw in alsa-utils-1.0.18 in place of 1.0.14, and alsactl wouldn't work, throwing up a similar message

Have you recently updated something?

mylvarab 01-31-2010 12:53 AM

error while compiling kernel
 
Ni I havent updated anything, I am running RHAS4 enterprise version.

mylvarab 01-31-2010 04:40 AM

error compiling r8168 driver on linux
 
Okay: Let me start I have downloaded the r8168 package and unpacked in tie root directory.

Pls take a look at these two makefiles.

[root@prashanth r8168-8.008.00]# ls
Makefile readme release_note.txt src


all: clean modules install

modules:
$(MAKE) -C src/ modules

clean:
$(MAKE) -C src/ clean

install:

[root@prashanth r8168-8.008.00]# cd src
[root@prashanth src]# ls
Makefile Makefile~ Makefile_linux24x r8168.h r8168_n.c


KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
KMISC := /lib/modules/$(KVER)/kernel/drivers/net/
KEXT := $(shell echo $(KVER) | sed -ne 's/^2\.[567]\..*/k/p')o
KFLAG := 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x

modules:
ifeq ($(KFLAG),24x)
$(MAKE) -f Makefile_linux24x
else
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD)/src modules
strip --strip-debug r8168.$(KEXT)
endif

clean:
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order


install:
install -m 744 -c r8168.$(KEXT) $(KMISC)

ifneq ($(KFLAG),24x)
r8168-objs := r8168_n.o
obj-m += r8168.o
endif#($(KFLAG),24x)

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

Below is the the structure of my /lib/modules. Initially the /lib/modules/build was empty. I made a symbolic link from /usr/src/redhat/BUILD/kernel-2.6.9 to this location. I compiled the kernel and it successfully compiled. I then tried to run make modules from /root/r8168-8.008.00 but I run into this error.

[root@prashanth r8168-8.008.00]# make modules
make -C src/ modules
make[1]: Entering directory `/root/r8168-8.008.00/src'
make -C /lib/modules/2.6.9-34.ELsmp/build SUBDIRS=/root/r8168-8.008.00/src modules
make[2]: Entering directory `/lib/modules/2.6.9-34.ELsmp/build'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/lib/modules/2.6.9-34.ELsmp/build'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/root/r8168-8.008.00/src'
make: *** [modules] Error 2



[root@prashanth 2.6.9-34.ELsmp]# pwd
/lib/modules/2.6.9-34.ELsmp
[root@prashanth 2.6.9-34.ELsmp]# ls
build modules.ccwmap modules.inputmap modules.symbols
kernel modules.dep modules.isapnpmap modules.usbmap
modules.alias modules.ieee1394map modules.pcimap


contents of /lib/modules/build after making the symbolic link
[root@prashanth linux-2.6.9]# ls
arch Documentation ipc mm scripts vmlinux
configs drivers kernel Module.symvers security
COPYING fs lib net sound
CREDITS include MAINTAINERS README System.map
crypto init Makefile REPORTING-BUGS usr

business_kid 02-01-2010 03:42 AM

I always get a headache grokking this stuff. Any programmer reading this, you are wanted!

Out of that build thing, this is the key line
make -C /lib/modules/2.6.9-34.ELsmp/build SUBDIRS=/root/r8168-8.008.00/src modules

I take it you are in /root/r8168-8.008.00/ and there is a Makefile there. The make command will start reading that, after doing a cd to /lib/modules/2.6.9-34.ELsmp/build which should be your kernel top source. What I think is happening is that it then looks for a src directory in the kernel source. So give it one in /lib/modules/2.6.9-34.ELsmp/build.
ln -s /root/r8168-8.008.00/src src
If it throws an error looking for a src/src directory, change that symlink to /root/r8168-8.008.00/

Is the kernel version your box is running on exactly the same as the kernel version you are building? It has to be.


All times are GMT -5. The time now is 04:21 AM.