LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Building Realtek 8168B driver (https://www.linuxquestions.org/questions/linux-newbie-8/building-realtek-8168b-driver-894362/)

columbiasts1 07-28-2011 03:36 PM

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.

MS3FGX 07-28-2011 03:44 PM

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.

knudfl 07-28-2011 03:51 PM

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'

.

columbiasts1 07-28-2011 04:34 PM

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?

knudfl 07-28-2011 05:33 PM

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'.

Andrew Benton 07-28-2011 05:42 PM

Why do you want to use the code from Realtek? Does the r8169.ko kernel module not work?

knudfl 07-28-2011 05:51 PM

@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.)

columbiasts1 07-28-2011 07:10 PM

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?

knudfl 07-28-2011 08:35 PM

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

..

knudfl 07-31-2011 12:30 AM

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

brianeray 03-25-2013 11:32 PM

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.

nicksu 03-26-2013 12:58 AM

Quote:

Originally Posted by columbiasts1 (Post 4427981)
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/


All times are GMT -5. The time now is 06:01 AM.