All of lore.kernel.org
 help / color / mirror / Atom feed
From: star@gmx.li
To: "Arno Steffens" <star@gmx.li>
Cc: "pokyyoctoproject.org" <poky@yoctoproject.org>
Subject: Re: Give others users than "root" access to GPIO (or commands)
Date: Wed, 30 May 2018 12:36:01 +0200	[thread overview]
Message-ID: <trinity-73b027c2-91c3-4a99-8e50-bce065e4fdbc-1527676561060@3c-app-gmx-bs52> (raw)
In-Reply-To: <trinity-a02404fb-0f4a-4265-9053-ce0b93aa8797-1527674498967@3c-app-gmx-bs52>

> Gesendet: Mittwoch, 30. Mai 2018 um 12:01 Uhr
> Von: "Arno Steffens" <star@gmx.li>
> An: ChenQi <Qi.Chen@windriver.com>
> Cc: "pokyyoctoproject.org" <poky@yoctoproject.org>
> Betreff: Re: [poky] Give others users than "root" access to GPIO (or commands)
>
> 
> 
> > Gesendet: Mittwoch, 30. Mai 2018 um 08:03 Uhr
> > Von: ChenQi <Qi.Chen@windriver.com>
> > An: "Arno Steffens" <star@gmx.li>, "pokyyoctoproject.org" <poky@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
> 

Ok, got it.
Althoug ldd xxx shows my lib I couldn't use it. Adding this path /opt/lib to ld.so.conf solved this.


  parent reply	other threads:[~2018-05-30 10:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 10:41 Give others users than "root" access to GPIO (or commands) Arno Steffens
2018-05-30  6:03 ` ChenQi
2018-05-30 10:01   ` Arno Steffens
2018-05-30 10:18     ` Richard Purdie
2018-06-01 11:18       ` Arno Steffens
2018-05-30 10:36     ` star [this message]
2018-05-30  7:21 ` Richard Purdie
2018-05-30 10:20   ` Arno Steffens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-73b027c2-91c3-4a99-8e50-bce065e4fdbc-1527676561060@3c-app-gmx-bs52 \
    --to=star@gmx.li \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.