freefish
Posts: 21
Joined: Mon Apr 01, 2013 2:02 am

Who can help me to compile this driver in kernel 3.6.11+

Fri Dec 13, 2013 1:42 am

First : I'm a newbie at C && Linux
Rcentely I met a problem.When I compile a device kernel module driver,It can't be insert,It promapt:
[email protected]:/home/pi/dvbdriver# insmod dvb-usb/dvb3221.ko
Error: could not insert module dvb-usb/dvb3221.ko: Invalid module format

I compiled the driver follow this steps:

Code: Select all

wget --no-check-certificate https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz 
tar zxvf rpi-3.6.y.tar.gz
mv linux-rpi-3.6.y /usr/src
ln -s /usr/src/linux-rpi-3.6.y /lib/modules/3.6.11+/build
cd /lib/modules/3.6.11+/build
make mrproper
zcat /proc/config.gz > .config
make modules_prepare
wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers

cd /home/pi/dvbdriver/
make

[email protected]:/home/pi/dvbdriver# modinfo dvb-usb/dvb3221.ko
...
depends:        dvb-usb
vermagic:       3.6.11 preempt mod_unload modversions ARMv6
......

raspberrypi:/home/pi/dvbdriver# uname -a
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
when i check the .config file

Code: Select all

CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
What's wrong ?
How can i add Symbol "+" in the kernel module driver version?
The driver's source code here..
https://www.dropbox.com/s/zvrhhvdwuahb1 ... rce.tar.gz

azemr
Posts: 6
Joined: Wed Dec 11, 2013 8:20 pm

Re: Who can help me to compile this driver in kernel 3.6.11+

Fri Dec 13, 2013 4:42 pm

Most probably your Module.symvers is not for your kernel...

To be sure that you use the correct one, build a new kernel and its modules :
make && make modules
make headers_install
make modules_install

Install the new kernel; Your Module.symvers should now be up to date.

You can now build your module.

freefish
Posts: 21
Joined: Mon Apr 01, 2013 2:02 am

Re: Who can help me to compile this driver in kernel 3.6.11+

Sun Dec 15, 2013 2:59 pm

非常感谢,azemr 我最终通过交叉编译解决了这个问题。真奇怪,直接编译反而不行。

Return to “C/C++”