Bug 922267 - Unable to access usb progammers by default
Summary: Unable to access usb progammers by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: piklab
Version: 18
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Alain Portal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-15 21:26 UTC by Branko Grubić
Modified: 2013-04-05 23:03 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-04-02 11:39:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Branko Grubić 2013-03-15 21:26:32 UTC
Description of problem:
Piklab supports several usb and serial (or usb/serial) programmers for PIC microcontrolers, using default fedora installation and piklab doesn't allow you access on those usb devices (probably needed rw-). I did some "hack" before, adding additional udev rule for all USB devices to assign group to "usb" (or something similar I created on the system) and specific permissions for the device. It worked well for me, but someone told me it is not a way to do it on fedora (and most modern distros) so today I joined #fedora-devel channel and asked how to do it. Few people helped me (actually solved my problem (thanks kay, nirik, ...) 

So as kay told me to try adding additional udev rule (probably possible to merge with 026-microchip.rules?) 

SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="04d8", ATTR{idProduct}=="0032|0033|8000|8001", TAG+="uaccess"

using a command (reload udev rules)
# udevadm control --reload  
re-attach usb programmer and try ;-)

Checking access rights 
without additional rule
# getfacl /dev/icd2-3-1
 owner: root
 group: root
user::rwx
group::r-x
other:r-x

with additional rule 
# getfacl /dev/icd2-3-1
 owner: root
 group: root
user::rw-
user:<myusername>:rw-
group::rw-
mask::rw-
other::r--

At this point I only tested ICD2 connecting to my picdem2 demo board, and using it to read from (pic16f877), it was successful 

Version-Release number of selected component (if applicable):
piklab-0.16.1-2

How reproducible:


Steps to Reproduce:
1. Install fedora
2. install piklab
3. connect some usb programmer supported by piklab (I only tested this with ICD2) 
  
Actual results:
Permissions denied. 

Expected results:
USB programmer works

Additional info:

Comment 1 Kay Sievers 2013-03-15 21:58:46 UTC
Please move all udev rules to /usr/lib/udev/rules.d/ and never mark any
of them as %config.

RPM is not supposed to install such things in /etc, /etc is reserved for
the local machine admin.

Also admins/users are never supposed to "edit" udev rules, only to add
new rules files.

Comment 2 Branko Grubić 2013-03-16 08:03:50 UTC
I'm not a package maintainer (actually n00b), but I would like to "help" somehow. Is it ok to try to make changes, for udev rules, install dirs ... and test it locally using mockbuild and provide changed spec files/diffs here and ask for comments?

Comment 3 Kay Sievers 2013-03-17 16:35:08 UTC
Btw, the package private dirs, like where udev rules and systemd services
are stored, are always:
  %{_prefix}/lib/<pkg>
never any %{_libdir} stuff.

There is also:
  %_udevrulesdir
in the RPM macros which can be used.

Comment 4 Fedora Update System 2013-03-26 20:52:32 UTC
piklab-0.16.1-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/piklab-0.16.1-3.fc18

Comment 5 Fedora Update System 2013-03-27 20:35:19 UTC
Package piklab-0.16.1-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing piklab-0.16.1-3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4496/piklab-0.16.1-3.fc18
then log in and leave karma (feedback).

Comment 6 Branko Grubić 2013-04-02 11:39:19 UTC
piklab-0.16.1-3.fc18 works fine, problem solved.

Thank you! ;-)

Comment 7 Fedora Update System 2013-04-05 23:03:45 UTC
piklab-0.16.1-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.