Difference between revisions of "Talk:Map Custom Device Entries with udev"

From ArchWiki
Jump to: navigation, search
Line 1: Line 1:
Hi there, I often thought about changing this, but I'm not sure yet. This article suggests two rules for a task which only requires one rule. There has also been confusion about this on the forums. Example:
# Symlink multi-part device
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd?", NAME="%k", SYMLINK+="usbdisk", GROUP="storage"
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd?[1-9]", NAME="%k", SYMLINK+="usbdisk%n", GROUP="storage"
This can be done by one single rule (it works here, at least), like this:
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd*", NAME="%k", SYMLINK+="usbdisk%n", GROUP="storage"
Also, for simplicity, you can omit the GROUP and NAME statements, because they are already set in udev.rules, so the rule would be
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd*", SYMLINK+="usbdisk%n"
This rule will create usbdisk, usbdisk1, usbdisk2 etc. and it will leave NAME and GROUP to the defaults set in udev.rules.
Is there a reason that the wiki page suggests 2 rules here and adds redundancy to GROUP and NAME statements? Does anyone know a case where this doesn't work? [[User:Brain0|brain0]] 09:49, 19 December 2005 (EST)
I'm reading the wiki as someone new to building and maintaining a linux system, and I'm going to record my impressions in order to maybe improve the wiki at the end.
First point: the udevinfo invocations use undocumented switches. They are short versions of what is documented in the man pages. For a user that reads the wiki alongside with running the commands this is confusing. Also a wiki should almost always use long switches for clarities sake.
current wiki:
  udevinfo -a -p `udevinfo -q path -n /dev/sda`
long version:
  udevinfo --path==`udevinfo --query=path --name=/dev/sda` --attribute-walk
Also, what is the reason for not using the more direct
  udevinfo --name=/dev/sda --attribute-walk
Isn't that equivalent?

Revision as of 12:03, 31 October 2009

Tango-edit-cut.pngThis section is being considered for removal.Tango-edit-cut.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Map Custom Device Entries with udev#)