LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2009, 01:43 PM   #1
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Rep: Reputation: 0
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:
 
Old 12-12-2009, 02:03 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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.
 
Old 12-13-2009, 05:28 AM   #3
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 12-14-2009, 03:36 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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 .
 
1 members found this post helpful.
Old 12-17-2009, 04:36 AM   #5
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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 ?
 
Old 12-18-2009, 03:22 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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
 
Old 12-30-2009, 09:16 AM   #7
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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?
 
Old 12-31-2009, 03:29 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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
 
Old 01-02-2010, 03:13 AM   #9
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 01-02-2010, 03:57 AM   #10
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,013

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
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.
 
Old 01-14-2010, 05:31 AM   #11
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 01-15-2010, 04:14 AM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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?
 
Old 01-31-2010, 12:53 AM   #13
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
error while compiling kernel

Ni I havent updated anything, I am running RHAS4 enterprise version.
 
Old 01-31-2010, 04:40 AM   #14
mylvarab
LQ Newbie
 
Registered: Dec 2009
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 02-01-2010, 03:42 AM   #15
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,260

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
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.
 
  


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
Trying to Compile Software Package. C compiler cannot create executables * Error Msg* Ciik13 Programming 6 09-24-2009 11:38 PM
How do I compile a driver for my wireless network card. norm7b8 Linux - Newbie 12 06-16-2008 11:40 PM
How to compile a network driver? PaulFXH Linux - Software 2 02-18-2008 05:17 AM
Unable to compile network driver modules with FC6 - 2.6.18 DanThomas Fedora 4 01-31-2007 07:59 AM
How to compile a network driver. vsuresh25 Linux - General 1 08-31-2001 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration