[systemd-devel] udev: problem renaming deviceode for dvb-devices
Joachim Banzhaf
joachim.banzhaf at googlemail.com
Mon Jun 25 08:45:38 PDT 2012
Am 25.06.2012 14:58, schrieb Dr. Thomas Bastian:
> Am Samstag, den 23.06.2012, 14:41 +0200 schrieb Kay Sievers:
>> On Sat, Jun 23, 2012 at 2:17 PM, Dr. Thomas Bastian
<tbastian at gmx.net> wrote:
>>>> Udev cannot rename kernel-created device nodes. These nodes are not
>>>> created by udev, but by the kernel itself. Udev will not change them,
>>>> just set permissions and ownership.
>>>>
>>>> Udev can add additional symlinks pointing to the kernel-created nodes.
>>>> Just use SYMLINK+= instead of NAME=, like here:
>>>>
http://cgit.freedesktop.org/systemd/systemd/tree/rules/60-persistent-v4l.rules
>>>
>>> thanks for your prompt reply. I understand your suggestion. But this
>>> does not help me to bring 4 dvb-cards
>>> (/dev/dvb/adapter0.../dev/dvb/adapter3) into the order needed for
>>> adressing the proper hardware by different apps, because the necessary
>>> symlinks have the same names as the kernel-given nodes (just another
>>> order).
>>>
>>> Are there other possibilities to make the kernel establish the nodenames
>>> based on hardware attributes rather then in the order of plugging the
>>> hardware into the computer?
>>
>> Not really. Kernel names are not predictable in that manner. They are
>> simply unique numbers, no stability is guaranteed regarding
>> parallelism or discovery order.
>>
>> The tools which relay on a specific name should use the symlinks
>> directly instead of looking at the plain kernel names.
>>
>> Or they should be made aware to cope with different names at every
>> bootup, and select the devices on properties they find at the device,
>> instead of expecting the kernel's enumeration number to be stable.
>
> Thanks for the information. I think, I gonna create a small shell script
> that performs your suggested "name resolution".
I assume your apps require names like /dev/dvb/adapterN?
I once encountered a similar problem with netwok cards (kernel: eth0
eth1, config: eth8 eth9) where eth0 and eth1 were random, but eth8 and
eth9 fixed to the card.
eth8 and eth9 were used by the networking setup and were symlinks
created by udev rules based on the mac addr of eth0 and eth1. The rules
in a file in /etc/udev/rules.d were like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="5c:ff:35:00:7b:d1", ATTR{dev_id}=="0x0",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth8"
Maybe you can use udev rules to setup /dev/dvb/adapter[6-9] based e.g on
bus id or something similar, use these in your applications and ignore
adapter[0-3]?
HTH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120625/5f0f316c/attachment.html>
More information about the systemd-devel
mailing list