Re: More Elegant udev rules
Volker Kuhlmann <[email protected]> Wed, 23 Nov 2011 00:16:31 +1300
| Newsgroups | gmane.org.user-groups.linux.new-zealand.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue 22 Nov 2011 09:57:01 NZDT +1300, [email protected] wrote: I recently needed some rules to create constant names in /dev specific to particular FTDI USB/RS232 adapters. Your problem isn't quite the same but probably needs the same solution. The website I noted is this one: http://answers.ros.org/question/65/how-can-i-get-a-unique-device-path-for-my The udev manual is also handy. Points I noted in particular: # *) There have been some changes. Some websites with descriptions and howtos # are out-of-date and should be ignored. # *) You can't change the kernel-assigned device name (other than by changing # the kernel driver). You can only put a symlink, with the symlink name # remaining constant and its target adjusted to the same hardware piece. # *) The device information is in a tree structure. Use udevadm. You can match # to any node, but only to one(!) node. Messing that up results in a non-match. # *) I'm unsure whether long lines can be broken. After changes run /etc/init.d/boot.udev restart Contrary to specified behaviour reload didn't work reliably. Don't use stop and start. udevadm is very handy to find the attributes you can use to match on. Pay attention to the 1-node-only restriction or you will be sorry (read it won't work, and it fails silently). Turning write cache off on drives related to your new rules must be possible through udev's action mechanism but I don'tknow the details of that. HTH, Volker -- Volker Kuhlmann is list0570 with the domain in header. http://volker.dnsalias.net/ Please do not CC list postings to me. _______________________________________________ NZLUG mailing list [email protected] http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug