[mythtv-users] Udev rules get mixed-up
Yianni
yiannividalis at hotmail.com
Wed Sep 17 16:46:38 UTC 2014
Hi,
I have a dual dvb-s TS-6981 card which works great, but I've realised that my udev rules that keep persistent names don't work, or to be more presise, they get mixed up. I even tried the rules from the "Zero Byte Recordings" thread (http://www.gossamer-threads.com/lists/mythtv/users/575782#575782) but the result is similar.
The modified rule is:
SUBSYSTEM=="dvb", ATTRS{device}=="0x8852", ATTRS{subsystem_vendor}=="0x6981", PROGRAM="/bin/sh -c ' K=%k; K=$${K#dvb}; N=$${K#*.}; if [ ! -e /dev/dvb/adapter_t1/$N ] ; then printf dvb/adapter_t1/%%s $${K#*.}; else printf dvb/adapter_t2/%%s $${K#*.}; fi ; exit 0'", SYMLINK+="%c"
Upon rebooting or running udevadm trigger --subsystem-match="dvb", the adapter_t[12] folders are created but their contents are mixed up or incomplete:
(adapter5 is a usb dvb-T card for digital aerial tv, and I set it to "5" with a modprobe rule.)
al2kpro:~ # la /dev/dvb
total 0
drwxr-xr-x 7 root root 140 Sep 17 18:26 .
drwxr-xr-x 21 root root 4,3K Sep 17 16:38 ..
drwxr-xr-x 2 root root 120 Sep 17 16:38 adapter0
drwxr-xr-x 2 root root 120 Sep 17 16:38 adapter1
drwxr-xr-x 2 root root 100 Sep 17 16:56 adapter5
drwxr-xr-x 2 root root 120 Sep 17 18:26 adapter_t1
drwxr-xr-x 2 root root 100 Sep 17 18:26 adapter_t2
al2kpro:~ # la /dev/dvb/adapter_t[12]
/dev/dvb/adapter_t1:
total 0
drwxr-xr-x 2 root root 120 Sep 17 18:26 .
drwxr-xr-x 7 root root 140 Sep 17 18:26 ..
lrwxrwxrwx 1 root root 18 Sep 17 18:26 demux0 -> ../adapter1/demux0
lrwxrwxrwx 1 root root 16 Sep 17 18:26 dvr0 -> ../adapter0/dvr0
lrwxrwxrwx 1 root root 21 Sep 17 18:26 frontend0 -> ../adapter0/frontend0
lrwxrwxrwx 1 root root 16 Sep 17 18:26 net0 -> ../adapter0/net0
/dev/dvb/adapter_t2:
total 0
drwxr-xr-x 2 root root 100 Sep 17 18:26 .
drwxr-xr-x 7 root root 140 Sep 17 18:26 ..
lrwxrwxrwx 1 root root 18 Sep 17 18:26 demux0 -> ../adapter0/demux0
lrwxrwxrwx 1 root root 21 Sep 17 18:26 frontend0 -> ../adapter1/frontend0
lrwxrwxrwx 1 root root 16 Sep 17 18:26 net0 -> ../adapter1/net0
Subsequent runs of the udefadm --trigger command produce different results.
al2kpro:~ # udevadm trigger --subsystem-match="dvb" -vv
/sys/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2.2/dvb/dvb5.demux0
/sys/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2.2/dvb/dvb5.dvr0
/sys/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2.2/dvb/dvb5.frontend0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb0.demux0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb0.dvr0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb0.frontend0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb0.net0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb1.demux0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb1.dvr0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb1.frontend0
/sys/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb1.net0
al2kpro:~ # la /dev/dvb/adapter_t[12]
/dev/dvb/adapter_t1:
total 0
drwxr-xr-x 2 root root 80 Sep 17 19:35 .
drwxr-xr-x 7 root root 140 Sep 17 19:35 ..
lrwxrwxrwx 1 root root 21 Sep 17 19:35 frontend0 -> ../adapter1/frontend0
lrwxrwxrwx 1 root root 16 Sep 17 19:35 net0 -> ../adapter1/net0
/dev/dvb/adapter_t2:
total 0
drwxr-xr-x 2 root root 120 Sep 17 19:35 .
drwxr-xr-x 7 root root 140 Sep 17 19:35 ..
lrwxrwxrwx 1 root root 18 Sep 17 19:35 demux0 -> ../adapter1/demux0
lrwxrwxrwx 1 root root 16 Sep 17 19:35 dvr0 -> ../adapter1/dvr0
lrwxrwxrwx 1 root root 21 Sep 17 19:35 frontend0 -> ../adapter0/frontend0
lrwxrwxrwx 1 root root 16 Sep 17 19:35 net0 -> ../adapter0/net0
Can someone help me solve this little problem?
The system is openSuSE Tumbleweed,
# uname -r
3.14.4-31.g0de0f93-desktop
# rpm -q udev
udev-208-19.1.x86_64
# udevadm info -a -p $(udevadm info -q path -n /dev/dvb/adapter0/frontend0)
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:0c.0/0000:02:00.0/dvb/dvb0.frontend0':
KERNEL=="dvb0.frontend0"
SUBSYSTEM=="dvb"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:0c.0/0000:02:00.0':
KERNELS=="0000:02:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="cx23885"
ATTRS{irq}=="16"
ATTRS{subsystem_vendor}=="0x6981"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x040000"
ATTRS{enabled}=="1"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003"
ATTRS{device}=="0x8852"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-1"
ATTRS{vendor}=="0x14f1"
ATTRS{subsystem_device}=="0x8888"
ATTRS{numa_node}=="0"
ATTRS{d3cold_allowed}=="1"
looking at parent device '/devices/pci0000:00/0000:00:0c.0':
KERNELS=="0000:00:0c.0"
SUBSYSTEMS=="pci"
DRIVERS=="pcieport"
ATTRS{irq}=="40"
ATTRS{subsystem_vendor}=="0x10de"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x060400"
ATTRS{enabled}=="1"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003"
ATTRS{device}=="0x045a"
ATTRS{msi_bus}=="1"
ATTRS{local_cpulist}=="0-1"
ATTRS{vendor}=="0x10de"
ATTRS{subsystem_device}=="0x0000"
ATTRS{numa_node}=="0"
ATTRS{d3cold_allowed}=="0"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Thanks,
Yianni.
More information about the mythtv-users
mailing list