-
Notifications
You must be signed in to change notification settings - Fork 6
docs: Add guide on how to give Remoteproc Runtime permission to a user #6
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
Changes from 9 commits
be9b6e0
4279b0b
5e810e6
cbb713d
a62a827
2e567e9
594778d
4e1dfad
116573a
e93775a
dfdb83a
dc05a11
a3966fb
44a53f5
b160607
ee88104
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||
| # Permission setting for non-root users' usage of Remoteproc Runtime | ||||||
|
|
||||||
| For non-root users to use Remoteproc Runtime, the remoteproc driver and the container engine must be accessible for this user. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't checked the user id inside the container engine, but I didn't need to add the container engine's user directly to the remoteproc authorized group to make it work. The suspicion I have is the container spawned in either a root or the user that spawned |
||||||
|
|
||||||
| ## How to set remoteproc driver to be accessible by non-root users | ||||||
|
yejseo01 marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| Usually, remoteproc driver can only be accessible to root. To change this setting, follow the below instructions: | ||||||
|
yejseo01 marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| 1. Create a group and add your user: | ||||||
|
|
||||||
| ``` | ||||||
| sudo groupadd remoteproc | ||||||
| sudo usermod -aG remoteproc "$USER" | ||||||
| ``` | ||||||
|
|
||||||
| Log out and log back in to refresh group membership | ||||||
|
|
||||||
| 2. Use systemd-tmpfiles to set mode/owner on every boot (and re-apply easily): | ||||||
|
yejseo01 marked this conversation as resolved.
|
||||||
|
|
||||||
| Create /etc/tmpfiles.d/remoteproc.conf with following: | ||||||
|
yejseo01 marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ``` | ||||||
| f /sys/class/remoteproc/remoteproc0/state 0664 root remoteproc - - | ||||||
| f /sys/class/remoteproc/remoteproc0/firmware 0664 root remoteproc - - | ||||||
| f /sys/class/remoteproc/remoteproc0/name 0664 root remoteproc - - | ||||||
| ``` | ||||||
|
|
||||||
| Add similar lines for each additional remoteproc device (e.g., remoteproc1, remoteproc2, etc.) as needed. | ||||||
|
|
||||||
| 3. Apply the change in remoteproc.conf: | ||||||
| ``` | ||||||
| sudo systemd-tmpfiles --create /etc/tmpfiles.d/remoteproc.conf | ||||||
| ``` | ||||||
| 4. Log in as a user in the remoteproc group and try the following commands to make sure that you can access the remoteproc driver as this user: | ||||||
| ``` | ||||||
| # read state | ||||||
| cat /sys/class/remoteproc/remoteproc0/state | ||||||
| # start/stop | ||||||
| echo start | tee /sys/class/remoteproc/remoteproc0/state | ||||||
| echo stop | tee /sys/class/remoteproc/remoteproc0/state | ||||||
| ``` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a last step here noting that the container engine needs to be added to this new group?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't need to add the container engine to the new group to make this work without root. What would the user be in a spawned container?? |
||||||
|
|
||||||
| ## Ensure your container engine is accessible by the user | ||||||
|
|
||||||
| The user must be able to access the container engine. For example, if you are using Docker, you need to add the user to the `docker` group: | ||||||
|
|
||||||
| ``` | ||||||
| sudo usermod -aG docker "$USER" | ||||||
| ``` | ||||||
|
|
||||||
| After running the command above, log out and log in again to refresh group membership. | ||||||
|
yejseo01 marked this conversation as resolved.
Outdated
|
||||||
Uh oh!
There was an error while loading. Please reload this page.