From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev problem DVB-S/T Cards
Date: Wed, 02 May 2007 12:36:48 +0000 [thread overview]
Message-ID: <200705021436.48314.zzam@gentoo.org> (raw)
In-Reply-To: <000301c78982$db8615e0$929241a0$@com>
On Samstag, 28. April 2007, Razza wrote:
> All,
> I have been playing with udev as I need to pin specific identical DVB cards
> to specific nodes, mixing DVB-S and DVB-T is bad!
> I have found how to identify cards etc. but getting the rule right is
> confusing me. I am running Fedora Core 5 and have the following standard
> rule in "/etc/udev/rules.d/50-udev.rules" -
>
> SUBSYSTEM="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf
> dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660"
>
Some time ago I also tried this. But it will end up like persistent-net then.
You need good criteria to name the devices. Else it will only be chaos.
And most apps does not work with holes in the numbering as they just open
devices starting from 0, until open fails.
Example:
Having /dev/dvb0/ /dev/dvb1/ /dev/dvb2/ and then unplugging the device
formerly named dvb1. then you stay with devices dvb0 and dvb2.
The rule I would simply split into some more lines like:
SUBSYSTEM!="dvb", GOTO="dvb_end"
ACTION!="add", GOTO="dvb_end"
GROUP="video"
import{PROGRAM}="/bin/sh -c 'K=%k; K=$${K#dvb}; echo
ID_DVB_ADAPTER_KERNEL=$${K%%%%.*}; echo ID_DVB_DEVICE=$${K#*.}'"
IMPORT{program}="path_id %p"
#Here set ID_DVB_ADAPTER to be persistent
# example:
ENV{ID_PATH}="pci-0000:00:0b.0-", ENV{ID_DVB_ADAPTER}="0"
ENV{ID_PATH}="pci-0000:00:0a.0-", ENV{ID_DVB_ADAPTER}="1"
# fallback-number
ENV{ID_DVB_ADAPTER_KERNEL}="?*", ENV{ID_DVB_ADAPTER}!="?*",
ENV{ID_DVB_ADAPTER}="$env{ID_DVB_ADAPTER_KERNEL}"
# Create device
ENV{ID_DVB_ADAPTER}="?*", ENV{ID_DVB_DEVICE}="?*",
NAME="dvb/adapter$env{ID_DVB_ADAPTER}/$env{ID_DVB_DEVICE}"
LABEL="dvb_end"
But this is untested.
The same problem will appear with all other devices being just numbered, like
video and audio devices.
The simplest solution is to just blacklist the drivers from autoloading, and
then load them in predefined/known order.
Matthias
--
Matthias Schwarzott (zzam)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2007-05-02 12:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-28 10:49 udev problem DVB-S/T Cards Razza
2007-05-02 8:47 ` Razza
2007-05-02 11:08 ` Bryan Kadzban
2007-05-02 12:10 ` Razza
2007-05-02 12:36 ` Matthias Schwarzott [this message]
2007-05-02 13:31 ` Matthias Schwarzott
2007-05-02 21:38 ` Razza
2007-05-02 22:20 ` Bryan Kadzban
2007-05-02 23:48 ` Razza
2007-05-03 1:56 ` Bryan Kadzban
2007-05-03 9:10 ` Razza
2007-05-03 11:12 ` Bryan Kadzban
2007-05-03 11:54 ` Razza
2007-05-03 12:13 ` Matthias Schwarzott
2007-05-07 17:18 ` Razza
2007-05-09 17:49 ` Razza
2007-05-30 10:35 ` Razza
2007-07-12 9:05 ` Razza
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705021436.48314.zzam@gentoo.org \
--to=zzam@gentoo.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).