[arch-general] finding corresponding udev rule for device
hi all, i want to customize the udev rule, that assigns my garmin gps device with a device name. permissions need to be set different, so users have read/write access. the only problem is, that i dont know, which rule it is i have to customize. is there any way to determine, which standard udev rule applies for which device? thanks for suggestions. georg
hi all, i want to customize the udev rule, that assigns my garmin gps device with a device name. permissions need to be set different, so users have read/write access. the only problem is, that i dont know, which rule it is i have to customize. is there any way to determine, which standard udev rule applies for which device?
What you need to do is create your own rules file in /etc/udev/rules.d/ something with a big number, let's say 99-my-garmin.rules To find out how to make the rule (I suspect it's an usb device)... first run `udevadm monitor` then plug the device you will get the device path ... something like /devices/pci0000:00/0000:00:12.2/usb1/.../.../... Then run `udevadm info --attribute-walk --path=/devices/.../.../...` and you'll get a bunch of properties that you can match in your own rule file. -- damjan
Am 19.06.2013 23:04, schrieb Damjan Georgievski:
hi all, i want to customize the udev rule, that assigns my garmin gps device with a device name. permissions need to be set different, so users have read/write access. the only problem is, that i dont know, which rule it is i have to customize. is there any way to determine, which standard udev rule applies for which device? What you need to do is create your own rules file in /etc/udev/rules.d/ something with a big number, let's say 99-my-garmin.rules
To find out how to make the rule (I suspect it's an usb device)... first run `udevadm monitor` then plug the device you will get the device path ... something like /devices/pci0000:00/0000:00:12.2/usb1/.../.../...
Then run `udevadm info --attribute-walk --path=/devices/.../.../...` and you'll get a bunch of properties that you can match in your own rule file.
thanks for answering. its a serial device, which is connected via serial-to-usb-adapter. i created a file /etc/udev/rules.d/99-serial-to-usb-4-garmin.rules und tried a lot of rules, like DRIVERS=="ch341-uart",ATTRS{idVendor}=="1a86",NAME="usbserial" (see http://pastie.org/8061009 for 'udevadm info ...' output) then i reloaded udev rules with 'udevadm control --reload' and checked result with 'udevadm monitor' i always get ttyUSB0, but not usbserial as i expected. am i missing something?
On Thu, Jun 20, 2013 at 12:23 AM, G. Schlisio <g.schlisio@dukun.de> wrote:
Am 19.06.2013 23:04, schrieb Damjan Georgievski:
i want to customize the udev rule, that assigns my garmin gps device with a device name. permissions need to be set different, so users have read/write access. the only problem is, that i dont know, which rule it is i have to customize. is there any way to determine, which standard udev rule applies for which device?
What you need to do is create your own rules file in /etc/udev/rules.d/ something with a big number, let's say 99-my-garmin.rules
To find out how to make the rule (I suspect it's an usb device)... first run `udevadm monitor` then plug the device you will get the device path ... something like /devices/pci0000:00/0000:00:**12.2/usb1/.../.../...
Then run `udevadm info --attribute-walk --path=/devices/.../.../...` and you'll get a bunch of properties that you can match in your own rule file.
thanks for answering. its a serial device, which is connected via serial-to-usb-adapter. i created a file /etc/udev/rules.d/99-serial-**to-usb-4-garmin.rules und
hi all, tried a lot of rules, like DRIVERS=="ch341-uart",ATTRS{**idVendor}=="1a86",NAME="**usbserial" (see http://pastie.org/8061009 for 'udevadm info ...' output) then i reloaded udev rules with 'udevadm control --reload' and checked result with 'udevadm monitor' i always get ttyUSB0, but not usbserial as i expected. am i missing something?
IIRC, you cannot use the "*S" properties from different parents in the same rule. Use instead: ATTRS{**idVendor}=="1a86", ATTRS{**idProduct}=="7523", NAME="**usbserial" And see what happens... that should be enough. -- Rodrigo
Hi, Am 19.06.2013 15:51, schrieb G. Schlisio:
is there any way to determine, which standard udev rule applies for which device?
You'll find all the rules provided by the distribution within "/usr/lib/udev/rules.d". You can easily grep the files within this directory for some specific strings, e.g. the product ID and similar attributes. Best regards, Karol Babioch
Am 20.06.2013 01:17, schrieb Karol Babioch:
Hi,
is there any way to determine, which standard udev rule applies for which device? You'll find all the rules provided by the distribution within "/usr/lib/udev/rules.d". You can easily grep the files within this
Am 19.06.2013 15:51, schrieb G. Schlisio: directory for some specific strings, e.g. the product ID and similar attributes.
Best regards, Karol Babioch
thanks, i found it. but making a new own rule seems to help more in my case.
Hi, Am 20.06.2013 21:25, schrieb G. Schlisio:
but making a new own rule seems to help more in my case.
Yeah, changing files provided by distribution itself is basically always a bad idea. However you might take it as a template for your own file. Best regards, Karol Babioch
Am 21.06.2013 01:09, schrieb Karol Babioch:
Hi,
Am 20.06.2013 21:25, schrieb G. Schlisio:
but making a new own rule seems to help more in my case. Yeah, changing files provided by distribution itself is basically always a bad idea. However you might take it as a template for your own file.
Best regards, Karol Babioch
i copied that file to /etc/udev/rules.d/61-serial.rules and added MODE="0666" in some place. now it works as i expected. still i didnt get the full logic of that file, so i cant change the name. but for the moment thats secondary. thanks all for help
participants (4)
-
Damjan Georgievski
-
G. Schlisio
-
Karol Babioch
-
Rodrigo Rivas