[poky] Give others users than "root" access to GPIO (or commands)
Arno Steffens
star at gmx.li
Wed May 30 03:01:38 PDT 2018
> Gesendet: Mittwoch, 30. Mai 2018 um 08:03 Uhr
> Von: ChenQi <Qi.Chen at windriver.com>
> An: "Arno Steffens" <star at gmx.li>, "pokyyoctoproject.org" <poky at yoctoproject.org>
> Betreff: Re: [poky] Give others users than "root" access to GPIO (or commands)
>
> On 05/29/2018 06:41 PM, Arno Steffens wrote:
> > I have to add a user other than root to start a program which operates with i2c, spi, gpio.
> > For this I added an init-script /etc/rc5.d to make it /dev/* r/w for "others".
> > That works for i2c and spi but not for GPIO. As most of the files the user has to access will only created after the exporting the GPIOs (more or less doing echo xxx > /sys/class/gpio/export).
> > But this new created /sys/class/gpio/xxx is not writable by user.
> >
> > Maybe I am doing it completely wrong, but how can I achieve this to become possible?
> > I checked the mega-manual, but there is not much mentioned about groups (27.36. extrausers.bbclass).
> > Best regards
> > Arno
> >
> > Maybe I also have to give this user the permission to reboot, which is right now only possible for root
>
>
> Not sure about your environment. But if you want normal user to do some
> operation requiring root privilege, consider using a SETUID program.
>
> 1) Create a progrem to do the actual work that require root privilege.
> 2) If your only want your program to be run by some specific user, do
> the user checking in the program.
> 3) Install your program to be SETUID. `chmod +s xxx'
>
> You can check dbus-daemon-launch-helper in dbus for a reference.
>
> Best Regards,
> Chen Qi
Thanks Chen,
sounds easy but I get to my surprise a problem with a shared library (cannot open shared object file: No such file or directory) - althought the LD_LIBRARY_PATH is set (/opt/lib) and the file available?
Best regards
Arno
More information about the poky
mailing list