Re: Assigning an unique name to USB CDC device in /dev

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

 



Srinivas Ganji <srinivasganji.kernel@xxxxxxxxx> writes:

> I have created a file, named 11-ttyACM.rules, under /etc/udev/rules.d
> directory. The contents of the file as follows.
> KERNEL=="ttyAMC0", SUBSYSTEM=="tty", ATTRS{serial}=="__0X00124B000148CC78",
> SYMLINK+="mydev"

So this rule will create a symlink from /dev/mydev -> /dev/ttyAMC0 if
all these conditions are met:

 a) KERNEL=="ttyAMC0"
 b) SUBSYSTEM=="tty"
 c) ATTRS{serial}=="__0X00124B000148CC78"

I believe the a) condition is not exactly what you want.  Firstly, the
spelling makes it likely to never match...

Secondly, even if you correct it to ACM, you really want this rule to
match regardless of which ttyACMx device is assigned.  That way you can
ignore the device name and use the static /dev/mydev symlink.

So you'd want to do something like this instead:

 KERNEL=="ttyACM*", SUBSYSTEM=="tty", ATTRS{serial}=="__0X00124B000148CC78", SYMLINK+="mydev"

> I got the above information from the following command
> udevadm info -q all -n /dev/ttyACM0 --attribute-walk
>
> This is what I did. But, no luck. If I insert a different serial numbered
> device, then it is assigning ttyACM0 to that device.

Yes.  There is nothing in the rule controlling which name the kernel
assigns.  You cannot change this in any case.  It's already decided at
the point where the udev rule runs.



Bjørn

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies





[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux