bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: compiling module

Thu Mar 21, 2013 6:13 pm

Hello

I did not get "compiling the module only" to work yet. I tried a few more things but i did not see anything meaningful and I moved to another project.

As noted above i was able update/patch gspca_main by recompiling the whole kernal again.

I'm still interested (stubborn) enough to try some new ideas as I learned a few things on the way.

My thinking (warning !) is that gspca is pretty deeply embedded into the kernal with lots of dependecies so recompiling the whole kernal is the only solution. I have no proof for that so don't take that as an expert opinion.

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: compiling module

Thu Mar 21, 2013 6:18 pm

BTW

Thanks to everyone that help me get as far asi did.

Cheers

User avatar
blackdot
Posts: 7
Joined: Sat May 12, 2012 8:48 pm

Re: compiling module

Fri Mar 22, 2013 4:15 pm

I was finally successful :D
Basically I followed your guide:

Code: Select all

cd /usr/src
wget https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz
tar xvfz rpi-3.6.y.tar.gz
mv linux-rpi-3.6.y linux
ln -s /usr/src/linux /lib/modules/3.6.11+/build
cd /lib/modules/3.6.11+/build
make mrproper
gzip -dc /proc/config.gz > .config
make modules_prepare
wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
then, I proceed with compilation of new drivers...

Code: Select all

cd /usr/src/
wget http://moinejf.free.fr/gspca-2.15.18.tar.gz
tar xvfz gspca-2.15.18.tar.gz
cd gspca-2.15.18
make
make install
and after reboot, (or depmod and modprobe) my webcam came back online :-)

Code: Select all

[    7.879301] Linux video capture interface: v2.00
[    8.055274] gspca_main: [b]v2.15.18[/b] registered
[    8.439714] gspca_main: pac207-2.15.18 probing 093a:2468
[    8.723530] gspca_pac207: Pixart Sensor ID 0x27 Chips ID 0x00
[    8.729311] gspca_pac207: Pixart PAC207BCA Image Processor and Control Chip detected (vid/pid 0x093A:0x2468)<6>
[    9.006612] input: pac207 as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/input/input0
[    9.143152] gspca_main: video0 created
I didn't found a right purpose of file Module.symvers, but I guess, this file needs to be "compatible" with currently running kernel. Last week when I compiled my kernel (or downloaded Module.symvers from git), my modules didn't work. (I didn't apply whole compiled kernel, only my modules)

But 4 days ago, new kernel on git was compiled and released (2012-03-18 17:34), so after next rpi-update, Module.symvers (probably) became compatible with new kernel and my modules after compilation started to work :-D

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: compiling module

Fri Mar 22, 2013 5:57 pm

Good news, well done.

User avatar
hexelpdkk
Posts: 177
Joined: Fri Feb 24, 2012 4:40 pm

Re: compiling module

Fri Mar 22, 2013 7:21 pm

blackdot wrote:I was finally successful :D
Congratulations! I only started the blog because I keep forgetting things like this. Really pleased it has helped someone out.

bullwinkle
Posts: 117
Joined: Wed Jan 09, 2013 12:14 pm

Re: compiling module

Wed Apr 10, 2013 4:16 am

Hello

well I managed to sort this one out. As hexelpdkk pointed out earlier, the problem was with my Make command.
The one I was using was provided by the vendor of the camera to rebuild/make after their patch was installed. As it turns out using this command

Code: Select all

make drivers/media/video/gspca/gspca/gspca_main.ko
overwrites the Module.symvers. It was with the example from blackdot that I was able to narrow down and solve my problem. Apparently the M= option retains the original Module.symvers

In the end this is what I used

Code: Select all

make -C /lib/modules/3.6.11+/build M=/usr/src/linux/drivers/media/video/gspca modules
install -c -m 0644 drivers/media/video/gspca/*.ko /lib/modules/3.6.11+/kernel/drivers/media/video/gspca
depmod -a
while investigating this one, I also set up a cross-compiling environment which is not as painful as it sounds. In fact, it was very easy and I should have done it long ago. On a 3 year old PC with a very modest spec, the kernal compiles in 30 minutes and transferring images/files between the 2 platforms is straightforward. This page is a little old, but it still worked for me http://mitchtech.net/raspberry-pi-kernel-compile/

I've not mastered this subject, but I think I'm a little further along now. Once again thanks for the help on this one everyone. :)

Return to “Raspbian”