# Make builds modules using wrong kernel libs (SOLVED)

## blop

When I'm trying to build modules for usb-dvb adapter the process goes well but the modules are build for wrong version of kernel. I have no idea where make looks for the kernel libs and verision so I don't know what to change. Here is the output of make:

make -C /home/.../driver/v4l-dvb/v4l

make[1]: Entering directory `/home/.../driver/v4l-dvb/v4l'

creating symbolic links...

make -C /lib/modules/2.6.17-gentoo-r8/build SUBDIRS=/home/.../driver/v4l-dvb/v4l  modules

make[2]: Entering directory `/usr/src/linux-2.6.17-gentoo-r8'

  CC [M]  /home/.../driver/v4l-dvb/v4l/videodev.o

I'm currently using 2.6.21-gentoo-r4 kernel.

I couldn't find anything about the issue so hopefully someone can help me here!Last edited by blop on Fri Aug 31, 2007 12:42 pm; edited 1 time in total

----------

## didymos

Why are you building external modules for this anyway?  That stuff is in 2.6.21.  Is this a driver you got from the manufacturer or something?

[edit] Oh, and check the output of this:

```

ls -ld /usr/src/linux

```

It should point to linux-2.6.21-gentoo-r4.  If it doesn't then do this:

```

ln -snf /usr/src/linux-2.6.21-gentoo-r4 /usr/src/linux

```

----------

## blop

I haven't figured out how to make this pinnacle e70 (?) work with the kernel drivers. This device probably isn't supported by the kernel drivers so I am using the steps from http://www.2nrds.com/digital-tv-in-linux-with-em28xx-devices. The driver is for em2880 dvb modulator I think?

The link from /usr/src/linux points to linux-2.6.21-gentoo-r4 so this shouldn't be a problem.

Any other ideas?

----------

## didymos

OK, I'll check it out. So you still have a "linux-2.6.17-gentoo-r8" source tree; is that because of this driver?

----------

## NeddySeagoon

blop,

You are either running a different kernel to the one you think you are or your /usr/src/linux symbolic link points to a different kernel that the one in use.

```
uname -a
```

will tell abour your running kernel, the date and time shown are its build date and time

```
readlink /usr/src/linux
```

shows where your /usr/src/linux symlink points.

Are you running the kernel pointed to by the symlink (thats the one you are building modules for)? 

Iis the version build and build date of the running kernel what you expected it to be ?

----------

## blop

I had a link in /usr/src/linux that pointed to /usr/src/linux. This seemed to have something to do with it because after I once again went through the steps from the before mentioned site, there was something in the output about *.h and the link pointing to wrong place. I closed the tty and lost the output but after deleting the link the make process went fine.

There was also one other message in gentoo forums about this issue: https://forums.gentoo.org/viewtopic-t-576641.html

Thanks for help every one. I hope I can be of help sometime.

----------

## blop

Still one thing though. Is it true that the pinnacle pctv e70 is not supported by the official kernel drivers? I didn't get it to work and the site http://www.2nrds.com/digital-tv-in-linux-with-em28xx-devices had the solution. So I figured this is the only way. PCTV e70 has the em2880 with ZL10353 tuner.

Thanks again.

----------

## NeddySeagoon

blop,

Tell us the Vendor and Device IDs for your device. lsusb will show you. emerge usbutils, if needed.

You can also find the information in /proc/bus/usb/devices but its a really user hostile file

----------

## blop

lsusb gives the following:

Bus 001 Device 003: ID eb1a:2870 eMPIA Technology, Inc.

In proc/bus/usb/devices there is:

T:  Bus=01 Lev=01 Prnt=01 Port=05 Cnt=01 Dev#=  3 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=eb1a ProdID=2870 Rev= 1.00

S:  Product=USB 2870 Device

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=em28xx

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=128ms

E:  Ad=82(I) Atr=01(Isoc) MxPS=   0 Ivl=125us

E:  Ad=84(I) Atr=01(Isoc) MxPS=   0 Ivl=125us

I:  If#= 0 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=em28xx

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=128ms

E:  Ad=82(I) Atr=01(Isoc) MxPS=   0 Ivl=125us

E:  Ad=84(I) Atr=01(Isoc) MxPS= 564 Ivl=125us

I:  If#= 0 Alt= 2 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=em28xx

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=128ms

E:  Ad=82(I) Atr=01(Isoc) MxPS=1448 Ivl=125us

E:  Ad=84(I) Atr=01(Isoc) MxPS= 564 Ivl=125us

I:  If#= 0 Alt= 3 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=em28xx

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=128ms

E:  Ad=82(I) Atr=01(Isoc) MxPS=2048 Ivl=125us

E:  Ad=84(I) Atr=01(Isoc) MxPS= 564 Ivl=125us

I:  If#= 0 Alt= 4 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=em28xx

----------

## NeddySeagoon

blop,

Grepping the 2.6.22-r5 code shows that your Vendor ID is known 

```
/usr/src/linux $ grep -iR eb1a ./*

./Documentation/video4linux/CARDLIST.em28xx:  0 -> Unknown EM2800 video grabber             (em2800)        [eb1a:2800]

./Documentation/video4linux/CARDLIST.em28xx:  5 -> MSI VOX USB 2.0                          (em2820/em2840) [eb1a:2820]

./drivers/atm/pca200e_ecd.data::150930008A033190A792DF42FECCF4C379E3167106B1EBAEB1A5

./drivers/media/dvb/dvb-usb/dvb-usb-ids.h:#define USB_VID_EMPIA                         0xeb1a

./drivers/media/video/em28xx/em28xx-cards.c:    { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },

./drivers/media/video/em28xx/em28xx-cards.c:    { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },

./drivers/media/video/em28xx/em28xx.h:  u32 id;                 /* 0x9567eb1a */
```

but there is no match for both Vendor and Device (2870)

Therefore none of the in kernel drivers will bind with your device.

----------

## blop

Ok. Thanks once again. I'll go with the Marcus' instructions. They have worked fine for me especially now that I can remove the old kernel.

----------

