Add script to set appropriate permissions on /dev/dri/* devices #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been investigating how to enable hardware acceleration and found that it requires the www-data user to have permission on /dev/dri/* devices. A lot of people seem to be happy to just set the permissions to 666 on /dev/dri*, however that doesn't seem like a great solution.
In the end, I found a really elegant solution to the permissions issue that the guys over at linuxserver used for their Plex image.
The script is a direct clone of their version, I have just added some echos to show what is going on and changed the user to the www-data one we use for ZoneMinder.
It adds the www-data user to the appropriate group(s) if they already exist or creates new groups as required.
This has the benefit of meaning that you don't have to mess with the permissions of the /dev/dri/* devices on the host.
Hope this makes sense.
FYI, this is my first PR to an open source project, so apologies if I missed any steps or etiquette.