forked from Ivasoft/docker-tvheadend
Compare commits
1 Commits
ebb09680-l
...
e1fb5c02-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70b794cabc |
@@ -279,6 +279,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
|
|||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
|
* **02.10.19:** - Improve permission fixing on render & dvb devices.
|
||||||
* **18.08.19:** - Add AMD drivers.
|
* **18.08.19:** - Add AMD drivers.
|
||||||
* **02.08.19:** - Attempt to automatically fix permissions on /dev/dri and /dev/dvb.
|
* **02.08.19:** - Attempt to automatically fix permissions on /dev/dri and /dev/dvb.
|
||||||
* **28.06.19:** - Rebasing to alpine 3.10.
|
* **28.06.19:** - Rebasing to alpine 3.10.
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ app_setup_block: |
|
|||||||
|
|
||||||
# changelog
|
# changelog
|
||||||
changelogs:
|
changelogs:
|
||||||
|
- { date: "02.10.19:", desc: "Improve permission fixing on render & dvb devices." }
|
||||||
- { date: "18.08.19:", desc: "Add AMD drivers." }
|
- { date: "18.08.19:", desc: "Add AMD drivers." }
|
||||||
- { date: "02.08.19:", desc: "Attempt to automatically fix permissions on /dev/dri and /dev/dvb." }
|
- { date: "02.08.19:", desc: "Attempt to automatically fix permissions on /dev/dri and /dev/dvb." }
|
||||||
- { date: "28.06.19:", desc: "Rebasing to alpine 3.10." }
|
- { date: "28.06.19:", desc: "Rebasing to alpine 3.10." }
|
||||||
|
|||||||
@@ -1,34 +1,26 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
# check for the existence of a video and/or tuner device
|
FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null)
|
||||||
if [ -e /dev/dri ] || [ -e /dev/dvb ]; then
|
|
||||||
if [ -e /dev/dri ]; then
|
for i in $FILES
|
||||||
VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1)
|
do
|
||||||
|
VIDEO_GID=$(stat -c '%g' "$i")
|
||||||
|
if id -G abc | grep -qw "$VIDEO_GID"; then
|
||||||
|
touch /groupadd
|
||||||
else
|
else
|
||||||
VIDEO_GID=$(stat -c '%g' /dev/dvb/* | grep -v '^0$' | head -n 1)
|
if [ ! "${VIDEO_GID}" == '0' ]; then
|
||||||
|
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
|
||||||
|
if [ -z "${VIDEO_NAME}" ]; then
|
||||||
|
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
|
||||||
|
groupadd "$VIDEO_NAME"
|
||||||
|
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
|
||||||
|
fi
|
||||||
|
usermod -a -G "$VIDEO_NAME" abc
|
||||||
|
touch /groupadd
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# just add abc to root if stuff in dri/dvb is root owned
|
done
|
||||||
if [ -z "${VIDEO_GID}" ]; then
|
|
||||||
usermod -a -G root abc
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if this GID matches the current abc user
|
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then
|
||||||
ABCGID=$(getent group abc | awk -F: '{print $3}')
|
usermod -a -G root abc
|
||||||
if [ "${ABCGID}" == "${VIDEO_GID}" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the GID is taken and swap to 65533
|
|
||||||
CURRENT=$(getent group ${VIDEO_GID} | awk -F: '{print $1}')
|
|
||||||
if [ -z "${CURRENT}" ] || [ "${CURRENT}" == 'video' ]; then
|
|
||||||
groupmod -g ${VIDEO_GID} video
|
|
||||||
usermod -a -G video abc
|
|
||||||
else
|
|
||||||
groupmod -g 65533 ${CURRENT}
|
|
||||||
groupmod -g ${VIDEO_GID} video
|
|
||||||
usermod -a -G video abc
|
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user