How to build from mercurial

From V4LWiki

(Redirected from How to build from CVS)
Jump to: navigation, search

First of all, you need quite recent kernel. The v4l-dvb tree is backwards compatable against recent vanilla kernels. Kernel version 2.6.10 or later is required to build the dvb modules, and version 2.6.12 or later is required to build support for hybrid devices. If you configured kernel manually, please note that some capabilites should be enabled like EVDEV. Stock kernel usually have everything required. You also need to install kernel-source package to have kernel headers.

Then you need to download latest snapshot, or pull tree from hg. V4L and DVB kernel modules are available via Mercurial. To acquire the latest sources, you must first have mercurial installed (which requires python 2.3).Some Linux distributions already include it. If yours doesn't, you can download a binary package or retrieve the source.

To retrieve the v4l-dvb source tree:

hg clone http://linuxtv.org/hg/v4l-dvb

To update the sources later on:

cd v4l-dvb
hg pull -u http://linuxtv.org/hg/v4l-dvb

To retrieve the dvb-apps source tree:

hg clone http://linuxtv.org/hg/dvb-apps

Ok, consider you've downloaded snapshot and unpacked it and you have kernel headers. Change into the v4l-dvb directory:

cd v4l-dvb

Build the modules:

make

Install the modules:

make install

The command above will copy *.ko module files into your /lib/modules kernel directories. However, you might end up with *.ko files and their older compressed version *.ko.gz in the same directory. In this case, the modprobe command might fail (example with the saa7134 module):

sudo modprobe saa7134
FATAL: Error inserting saa7134 (/lib/modules/2.6.17-8mdv/kernel/drivers/media/video/saa7134/saa7134.ko):\ 
Unknown symbol in module, or unknown parameter (see dmesg)

The dmesg then returns a list of 'unknown symbol' error messages because of compatiblity issues between the new *.ko module files and the old *.ko.gz ones:

Unknown symbol ir_codes_pinnacle_color
Unknown symbol ir_codes_encore_enltv
Unknown symbol ir_codes_proteus_2309
Unknown symbol ir_rc5_timer_keyup
Unknown symbol ir_codes_asus_pc39
Unknown symbol ir_rc5_timer_end
Unknown symbol ir_codes_pinnacle_grey

The conflicting *.ko.gz files must be removed. For the saa7134 device for example, move videodev.ko.gz, compat_ioctl32.ko.gz, v4l2_common.ko.gz, v4l1_compat.ko.gz, video_buf.ko.gz, ir_kbd_i2c.ko.gz and ir_common.ko.gz in another directory. Then unload their modules with 'rmmod', rebuid dependencies with 'depmod -a' and reinstall them with 'modprobe'. The saa7134 module should now load correctly.

At this point, check to see if your device is working. Usually, the make install will install the modules in the kernel module folder, which will autoload the drivers on boot. I ran the below commands and it locked up my box and caused problems. For example, do...

dmesg | grep -i saa
[   33.089365] saa7133[0]: subsystem: 17de:7350, board: Kworld ATSC110 [card=90,autodetected]

If this comes back with your card name to something other than "UNKNOWN", then you on on the right track and do not have to do what is listed below.


To remove (rmmod) all modules at once from the running kernel (in memory):

make unload

To insert (insmod) all modules at once into the running kernel, without the need to install them:

make load

To perform the two commands above in a single step:

make reload

Usually correctly installed modules will show some info in dmesg, errors will appear in dmesg also.

Comment April 06 A kernel 2.6.12 wouldn't build the modules but 2.6.16 worked well. I would suggest cd /usr/src/linux before retrieving the mercurial patches - the scripts couldn't find the kernel headers otherwise.

After following the steps above and getting down all needed sources I get the following output does this mean this driver does support 64bit kernels?

root@1[v4l-dvb]# make make -C /usr/local/src/v4l-dvb/v4l make[1]: Entering directory `/usr/local/src/v4l-dvb/v4l' scripts/make_makefile.pl No version yet. Updating/Creating .config File not found: /lib/modules/2.6.15-27-desktop64-smp/build/.config at ./scripts/make_kconfig.pl line 30. make[1]: Leaving directory `/usr/local/src/v4l-dvb/v4l' make[1]: Entering directory `/usr/local/src/v4l-dvb/v4l' Updating/Creating .config File not found: /lib/modules/2.6.15-27-desktop64-smp/build/.config at ./scripts/make_kconfig.pl line 30. make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'. Stop. make[1]: Leaving directory `/usr/local/src/v4l-dvb/v4l' make: *** [all] Error 2

or do I move my sources?