You are not logged in.

#1 2012-05-04 19:04:56

koralgolek
Member
Registered: 2010-07-27
Posts: 23

[SOLVED] Udev - user access to usb (problem with permission)

Sometimes I need to program microcontroller by USB programator from user account. To do this I created appropriate file in /etc/udev/rules.d/ with:

BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="kcontrol_rules_end"
SYSFS{idProduct}=="0101", SYSFS{idVendor}=="1366", MODE="664", GROUP="plugdev"
LABEL="kcontrol_rules_end"

and created group plugdev and added user to this group

The problem is that after every reboot I need to do:

# chgrp -R plugdev /dev/bus/usb/

Is there any method to do above command instead of putting it in autostart?

###ADDED###

I noticed another problem. I suppose it regards to /dev/bus/usb permission. During booting I get:

udevd[149]: unknown key 'BUS' in /etc/udev/rules.d/45-jlink.rules:2
udevd[149]: invalid rule '/etc/udev/rules.d/45-jlink.rules:2'
udevd[149]: unknown key 'SYSFS{idVendor}' in /etc/udev/rules.d/45-jlink.rules:3
udevd[149]: invalid rule '/etc/udev/rules.d/45-jlink.rules:3'

I have no idea what to do with that.

Last edited by koralgolek (2012-05-05 10:30:40)

Offline

#2 2012-05-05 00:15:21

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: [SOLVED] Udev - user access to usb (problem with permission)

koralgolek wrote:

Sometimes I need to program microcontroller by USB programator from user account. To do this I created appropriate file in /etc/udev/rules.d/ with:

I noticed another problem. I suppose it regards to /dev/bus/usb permission. During booting I get:

udevd[149]: unknown key 'BUS' in /etc/udev/rules.d/45-jlink.rules:2
udevd[149]: invalid rule '/etc/udev/rules.d/45-jlink.rules:2'
udevd[149]: unknown key 'SYSFS{idVendor}' in /etc/udev/rules.d/45-jlink.rules:3
udevd[149]: invalid rule '/etc/udev/rules.d/45-jlink.rules:3'

I have no idea what to do with that.

It's said right there - those keys do not exist. How did you come up with these rules?

As from some random udev rules I just checked out I cannot see any BUS key or SYSFS key

My advice would be: get rid of the BUS key (SUBSYSTEM should be enough anyway) and change SYSFS for ATTR.

Don't ask me why though - it's just what I found in some already present rules.. you can look at them as well, they're mostly in /lib/udev/rules.d/

good luck!

-miky


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#3 2012-05-05 10:30:14

koralgolek
Member
Registered: 2010-07-27
Posts: 23

Re: [SOLVED] Udev - user access to usb (problem with permission)

mr.MikyMaus Thank You for advice

Now my udev rule looks like this:

ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="kcontrol_rules_end"
ATTRS{idProduct}=="0101", ATTRS{idVendor}=="1366", MODE="664", GROUP="plugdev"
LABEL="kcontrol_rules_end"

I got rid of BUS! and I changed SYSFS to ATTRS (ATTR is also acceptable)

Offline

Board footer

Powered by FluxBB