[mythtv-users] UDEV rules
Roger Siddons
dizygotheca at ntlworld.com
Sat Jan 25 23:33:13 UTC 2014
On Sat, 25 Jan 2014 21:21:21 -0000, Daryl McDonald <darylangela at gmail.com>
wrote:
>
> OK so currently the two digital cards look like:
> lrwxrwxrwx 1 root root 15 Jan 25 13:43 dig1250 -> adapter0/demux0
> lrwxrwxrwx 1 root root 13 Jan 25 13:43 DigKW150 -> adapter1/net0
>
> and the corresponding rules are:
> SUBSYSTEM=="dvb",ATTRS{vendor}=="0x14f1",ATTRS{device}=="0x8852",SYMLINK+="dvb/dig1250",GROUP="video"
>
> SUBSYSTEM=="dvb",ATTRS{vendor}=="0x1131",ATTRS{device}=="0x7133",SYMLINK+="dvb/DigKW150",GROUP="video"
>
I looked up the rules for my Mythbuntu system which *do* show the symlinks
as alternative cards in mythtv-setup. Based on then I'd suggest:
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x14f1", ATTRS{device}=="0x8852",
PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/dig1250/%%s $${K#*.};
exit 0'", SYMLINK+="%c"
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7133",
PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/DigKW150/%%s $${K#*.};
exit 0'", SYMLINK+="%c"
No, I can't explain how it works - I copied it from somewhere years ago.
I've never had any permissions problems, even though I run mythtv-setup as
the user, so I believe the GROUP is unnecessary.
The reason mythtv-setup allows you to select these links is because the
rule mirrors the whole adapter directory rather than just creating the one
link to frontend0. For instance;
$ ls -l /dev/dvb/
total 0
drwxr-xr-x 2 root root 120 Jan 25 19:44 adapter0
drwxr-xr-x 2 root root 120 Jan 25 19:44 dig1250
$ ls -l /dev/dvb/adapter0
total 0
drwxr-xr-x 2 root root 120 Jan 25 19:44 ./
drwxr-xr-x 12 root root 240 Jan 25 19:44 ../
crw-rw----+ 1 root video 212, 0 Jan 25 19:44 demux0
crw-rw----+ 1 root video 212, 1 Jan 25 19:44 dvr0
crw-rw----+ 1 root video 212, 7 Jan 25 19:44 frontend0
crw-rw----+ 1 root video 212, 2 Jan 25 19:44 net0
$ ls -l /dev/dvb/dig1250/
total 0
lrwxrwxrwx 1 root root 18 Jan 25 19:44 demux0 -> ../adapter0/demux0
lrwxrwxrwx 1 root root 16 Jan 25 19:44 dvr0 -> ../adapter0/dvr0
lrwxrwxrwx 1 root root 21 Jan 25 19:44 frontend0 -> ../adapter0/frontend0
lrwxrwxrwx 1 root root 16 Jan 25 19:44 net0 -> ../adapter0/net0
I guess it will work for your analog cards as well if you replace the 3
'dvb' with 'video' (and amend the ATTR's) but I haven't tried it.
More information about the mythtv-users
mailing list