Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] DVB wiki Udev rules information suggestion



Hi I tried to find the ip address to new DVB wiki which is supposed to replace
the linux-tv.org server but I could not find it to check whether it already has
information for creating udev rules with the new dvb drivers.

If not, maybe the following text I have written might be helpful.

Be free to comment, correct and edit it...

Mika
---------------

Sysfs is a filesystem managed by a kernel that exports basic information about the devices
plugged into your Linux to /sys directory. When DVB drivers are loaded you can search
information from them by going in the directory /sys/class/dvb where you can find following
kind of subdirectories.

cd /sys/class/dvb
#$ cd /sys/class/dvb/
#$ ls -la
yhteensä 0
drwxr-xr-x 10 root root 0 tammi 14 01:20 ./
drwxr-xr-x 22 root root 0 tammi 14 01:20 ../
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.audio0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.ca0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.demux0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.dvr0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.frontend0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.net0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.osd0/
drwxr-xr-x 2 root root 0 tammi 14 01:20 dvb0.video0/

In here the 0 under every dvb*.* word means that this system has loaded one DVB device.

Udev can search information from sysfs to create device nodes under /dev directory.
As DVB applications expect to connect to DVB devices via
/dev/dvb/apaptern interface it is important that these nodes are created in a one way or another
after DVB device drivers are loaded.

One possible way is to use brute force and create them by running MAKEDEV-DVB.sh script which can
be downloaded within the dvb-drivers. (Note that the device node number created with this script must be 212,
older versions from DVB drivers and this script used number 250)

Another method is to create them dynamically when ever DVB drivers are loaded by adding proper udev rules.
Following udev are tested to work with the 2.6.10 kernel.

1) If you have udev installed then you can find node creation rules from the directory /etc/udev/rules.d
(Current Mandrake Linux cooker have them in /etc/udev/rules.d/00-mdk.rules)
2) Open some rules script and add following udev rules if they do not already exist

KERNEL="dvb[0-9].dvr*", NAME="dvb/adapter%n/dvr%n"
KERNEL="dvb[0-9].demux*", NAME="dvb/adapter%n/demux%n"
KERNEL="dvb[0-9].frontend*", NAME="dvb/adapter%n/frontend%n"
KERNEL="dvb[0-9].audio*", NAME="dvb/adapter%n/audio%n"
KERNEL="dvb[0-9].ca*", NAME="dvb/adapter%n/ca%n"
KERNEL="dvb[0-9].osd*", NAME="dvb/adapter%n/osd%n"
KERNEL="dvb[0-9].net*", NAME="dvb/adapter%n/net%n"
KERNEL="dvb[0-9].video*", NAME="dvb/adapter%n/video%n"

Here for example the rule KERNEL="dvb[0-9].dvr*", NAME="dvb/adapter%n/dvr%n"
can be interpreted in a following way: If somewhere to /sysfs appear information from the device which name
contains keyword dvbY.dvr then udev must create under /dev directory a node
called dvb/adapterY/dvrY where Y represents the device number. (These scripts will thus be able to
handle 10 different DVB devices from 0 to 9)

Default user and group permissions for the DVB device nodes created by udev rules to
/dev/dvb directory is root:root. If you want for example to change it so that the all users
belonging for example to group "video" has group permissions to devices under /dev/dvb/
that can be done by adding following rules to file /etc/udev/permissions.d/00-udev.permissions

dvb/*:$local:video:0660
dvb:$local:video:0660
dvb/adapter*:$local:video:0660






Home | Main Index | Thread Index