-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rootless access to gpiomem? #1225
Comments
This is really a distribution question rather than a kernel question. On Jessie there is a udev rule:
which you may be able to manually add. |
@sinadogru has your issue been resolved? If so, please close this issue. Thanks. |
I am sorry, yes with Jessie it is solved. Thanks for helping! |
I am a bit lost now. I just dist-upgraded my PI to Jessie to get /dev/gpiomem. However the permissions on /dev/gpiomem were incorrect. The 99-com rules have a different contents from the contents showed by popcornmix. |
Can you post the contents of the non-working |
Hi popcornmix,
Now there could be also a problem in the naming of the folders in /sys/devices/virtual/. As you see in the udev rules, the rules expect the directory /sys/devices/virtual/gpio. But that directory does not exist. This is the (partial contents of the folder:
In the udev rules that you posted you correctly refer to the directory bcm2835-gpiomem. If it makes any difference, I did a dist-upgrade from Wheezy to Jessie on the PI, not a fresh Jessie install. Update: Before submitting the post I checked the 99-com.rules on a Wheezy installation. That file is identical to the contents I posted above. So it seems this file is not updated during the dist-upgrade. Maybe it is as simple as that. The thought that this could be happening did not even cross my mind as Wheezy did not have /dev/gpiomen yet. |
I'm afraid updating wheezy to jessie isn't really supported. See here |
When upgrading, did dpkg ask you whether you wanted to keep the old file or install the new one? |
@popcornmix: OK. This was maybe not the smartest thing to do. The reason for Jessie was to get the non-root /dev/gpiomem. And the reason for dist-upgrade was to see if a dist-upgrade could succesfully be done. And some lazyness as my system is somewhat customized with cron scripts and startup scripts. @XECDesign: I have kept all the configurations as per default choice of dpkg. Either I have overlooked the question for udev, or I have assumed that the rules files would have been updated as well. Let me see if I have another memory card around so I can do a fresh Jessie install. And see if the rules file is correct. |
Files in /etc/ are considered user-configurable conffiles. dpkg avoids modifying any conffiles that have been modified by the user. At some point in the past, that file was not managed by a package at all and was added in the image creation process. It's likely that even if you have not touched the file, dpkg considered it a modified file because it was there before the package which installs it was added. |
@jlinkels you seem to have a comment character |
The comment character is my fault. It is not in the Wheezy file. I commented the line before pasting in your line. I corrected it in the post. |
A fresh installation of Jessie is correct and sets the correct permissions on gpiomem. I hope other users benefit from this thread.
|
According to issue #1112, I suppose to access gpiomem without root access. But when I open(2) it returns -1 and perror prints, "Permission denied". Also,
pi@raspberrypi ~ $ ls -l /dev/gpiomem
crw------- 1 root root 244, 0 Jan 1 1970 /dev/gpiomem
pi@raspberrypi ~ $ ls -l /dev/mem
crw-r----T 1 root kmem 1, 1 Jan 1 1970 /dev/mem
I use recently updated Rasbian-Wheezy on Rpi 2 model B,
Here is some information,
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 4.1.14-v7+ #828 SMP PREEMPT Thu Dec 10 13:22:08 GMT 2015 armv7l GNU/Linux
The text was updated successfully, but these errors were encountered: