LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-28-2011, 04:36 PM   #1
columbiasts1
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian stable
Posts: 29

Rep: Reputation: 15
Post Building Realtek 8168B driver


Downloaded bz2 file from Realtek
http://www.realtek.com/downloads/dow...&GetDown=false

and I was trying to build a driver for Debian Squeeze AMD64. Extracted the file out and done cd into that directory. Noticed I don't have a configure file so I done dh_make but I do not have a ko file to insert as a module. Have I missed a step?

I have build-essential, dh-make and linux-source installed to help build the package. Using kernel 2.6.32-5 AMD64.
 
Old 07-28-2011, 04:44 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Is there documentation included in the archive? It's difficult to say if the behavior you are seeing is expected or not, as we don't have anything to go on.
 
Old 07-28-2011, 04:51 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Assume r8168-8.024.00.tar.bz2.

cd r8168-8.024.00/ ; su ; make
.
.
install -m 744 -c r8168.ko /lib/modules/2.6.3x.x/kernel/drivers/net/
make[1]: Leaving directory `/home/knudfl/x_pack/r8168-8.024.00/src'

.
 
Old 07-28-2011, 05:34 PM   #4
columbiasts1
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian stable
Posts: 29

Original Poster
Rep: Reputation: 15
When I cd into the directory and do su and run make, I get the following error:

root@test3:/home/earth/Downloads/r8168-8.024.00# make
make -C src/ clean
make[1]: Entering directory `/home/earth/Downloads/r8168-8.024.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers Module.markers *.order
make[1]: Leaving directory `/home/earth/Downloads/r8168-8.024.00/src'
make -C src/ modules
make[1]: Entering directory `/home/earth/Downloads/r8168-8.024.00/src'
make -C /lib/modules/2.6.32-5-686/build SUBDIRS=/home/earth/Downloads/r8168-8.024.00/src modules
make[2]: Entering directory `/lib/modules/2.6.32-5-686/build'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/lib/modules/2.6.32-5-686/build'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/earth/Downloads/r8168-8.024.00/src'
make: *** [modules] Error 2
root@test3:/home/earth/Downloads/r8168-8.024.00#


Did you edit a file?
 
Old 07-28-2011, 06:33 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Debian Squeeze, amd64 : No linux-source required. Installed is linux-headers-2.6.32-5-amd64.
Code:
root@debian:/home/knudfl/x_pack/r8168-8.024.00# make
make -C src/ clean
make[1]: Går til katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers Module.markers *.order
make[1]: Forlader katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
make -C src/ modules
make[1]: Går til katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
make -C /lib/modules/2.6.32-5-amd64/build SUBDIRS=/home/knudfl/x_pack/r8168-8.024.00/src modules
make[2]: Går til katalog '/usr/src/linux-headers-2.6.32-5-amd64'
  CC [M]  /home/knudfl/x_pack/r8168-8.024.00/src/r8168_n.o
  CC [M]  /home/knudfl/x_pack/r8168-8.024.00/src/r8168_asf.o
  CC [M]  /home/knudfl/x_pack/r8168-8.024.00/src/rtl_eeprom.o
  CC [M]  /home/knudfl/x_pack/r8168-8.024.00/src/rtltool.o
  LD [M]  /home/knudfl/x_pack/r8168-8.024.00/src/r8168.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/knudfl/x_pack/r8168-8.024.00/src/r8168.mod.o
  LD [M]  /home/knudfl/x_pack/r8168-8.024.00/src/r8168.ko
make[2]: Forlader katalog '/usr/src/linux-headers-2.6.32-5-amd64'
strip --strip-debug r8168.ko
make[1]: Forlader katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
make -C src/ install
make[1]: Går til katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
install -m 744 -c r8168.ko /lib/modules/2.6.32-5-amd64/kernel/drivers/net/
make[1]: Forlader katalog '/home/knudfl/x_pack/r8168-8.024.00/src'
Suggest : remove 'linux-source*' and install 'linux-headers-2.6.32-5-amd64'.
 
Old 07-28-2011, 06:42 PM   #6
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Why do you want to use the code from Realtek? Does the r8169.ko kernel module not work?
 
1 members found this post helpful.
Old 07-28-2011, 06:51 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
@Andrew Benton post 6 :

You are right, it's already there :

ls -l /lib/modules/2.6.32-5-amd64/kernel/drivers/net/r8169.ko
-rw-r--r-- 1 root root 57264 1 jun 2010 /lib/modules/2.6.32-5-amd64/kernel/drivers/net/r8169.ko

( 01 Jun 2010 : Was installed / created a year ago.)
 
Old 07-28-2011, 08:10 PM   #8
columbiasts1
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian stable
Posts: 29

Original Poster
Rep: Reputation: 15
The r8169.ko file is there but it does not work for some reason.

knudfl...I did as you said and I have the r8168.ko file created in the /usr/src/r8168-8.024.00/src directory. Do I have to do anything else or do I just switch to the /lib/modules/2.6.32-5-amd64/kernel/drivers/net directory and do a insmod to insert driver?


Everyone has been very helpful.

Also....how did you know that I needed to remove the linux-source and install the headers from that error message?

Last edited by columbiasts1; 07-28-2011 at 08:11 PM.
 
Old 07-28-2011, 09:35 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
The package 'linux-source-2.6.32' only has an exact match with the
running kernel when it has been patched to be a "linux-source-2.6.32-5",
(linux-patch-debian-2.6.32 (2.6.32-35)) I guess. Alone it doesn't match.
http://packages.debian.org/squeeze/l...-debian-2.6.32


I'd guess it can be created also with a command like
'apt-get -b source linux-headers-2.6.32-5-amd64=2.6.32-35'
Or : 'apt-get -b source linux-image-2.6.32-5-amd64=2.6.32-35'
which will also create some of the many other "kernel packages" :
http://packages.debian.org/source/squeeze/linux-2.6

..

Last edited by knudfl; 07-28-2011 at 09:50 PM.
 
Old 07-31-2011, 01:30 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Quote:
Do I have to do anything else or do I just switch to the
/lib/modules/2.6.32-5-amd64/kernel/drivers/net directory
and do a insmod to insert driver ?
Use modprobe. From any location. No 'cd'.

# modprobe r8168
 
Old 03-26-2013, 12:32 AM   #11
brianeray
LQ Newbie
 
Registered: Mar 2013
Distribution: Debian Squeeze
Posts: 10

Rep: Reputation: 0
This old thread helped get my 6.0.7 install working with a bare desktop with onboard RTL8111F. With one small change:

The Realtek /src/Makefile (not the root Makefile) was pointing to the wrong directory for the amd64 headers, at least on my workstation. The following change fixed things. This is a diff.

Code:
49c49,50
< 	KERNELDIR ?= $(BASEDIR)/build
---
> #       specify right kernel directory to troubleshoot make
> 	KERNELDIR ?= /usr/src/linux-headers-$(shell uname -r)
Maybe this can help somebody stuck in the same boat I was.

Last edited by brianeray; 03-26-2013 at 12:39 AM.
 
Old 03-26-2013, 01:58 AM   #12
nicksu
Member
 
Registered: Dec 2012
Posts: 35

Rep: Reputation: Disabled
Quote:
Originally Posted by columbiasts1 View Post
When I cd into the directory and do su and run make, I get the following error:

root@test3:/home/earth/Downloads/r8168-8.024.00# make
make -C src/ clean
make[1]: Entering directory `/home/earth/Downloads/r8168-8.024.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers Module.markers *.order
make[1]: Leaving directory `/home/earth/Downloads/r8168-8.024.00/src'
make -C src/ modules
make[1]: Entering directory `/home/earth/Downloads/r8168-8.024.00/src'
make -C /lib/modules/2.6.32-5-686/build SUBDIRS=/home/earth/Downloads/r8168-8.024.00/src modules
make[2]: Entering directory `/lib/modules/2.6.32-5-686/build'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/lib/modules/2.6.32-5-686/build'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/earth/Downloads/r8168-8.024.00/src'
make: *** [modules] Error 2
root@test3:/home/earth/Downloads/r8168-8.024.00#


Did you edit a file?
yeah.maybe something wrong with the sourace tarbal you download from offical page.I have come accross this when I compiling my RT5370,you can refer to below link

http://www.linuxquestions.org/questi...70-4175443351/
 
  


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
Realtek new Driver for RTL8111/8168B mrgreen Linux - Networking 0 05-29-2011 10:47 AM
[SOLVED] Realtek driver RTL8111/8168B jwater1968 Linux - Networking 3 11-10-2010 06:34 AM
Realtek RTL-8111 / 8168B LAN Chipset Problems. btbx Linux - Hardware 1 03-14-2009 02:47 PM
Realtek RTL8111/8168B IRQ clash with IDE driver? madbrad Linux - Hardware 23 04-15-2008 08:13 AM
Realtek RTL8111/8168B IRQ clash? Hardware errors with high activity madbrad Linux - Networking 10 02-23-2008 11:35 PM


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

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