From 2dc0521c2c610f6ecf4b4a87af357af240ab4b2c Mon Sep 17 00:00:00 2001 From: aptalca Date: Wed, 10 Jul 2019 16:47:54 -0400 Subject: [PATCH] fix permissions for /dev/dvb --- README.md | 1 + readme-vars.yml | 1 + root/etc/cont-init.d/50-gid-video | 12 ++++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b9bf231..2edebc6 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **10.07.19:** - Fix permissions for tuner (/dev/dvb) devices. * **20.05.19:** - Bugfix do not allow Root group for Intel QuickSync ownership rules. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **22.03.19:** - Fix update logic for `VERSION=public`. diff --git a/readme-vars.yml b/readme-vars.yml index d03622f..de87cb0 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -82,6 +82,7 @@ app_setup_block: | # changelog changelogs: + - { date: "10.07.19:", desc: "Fix permissions for tuner (/dev/dvb) devices." } - { date: "20.05.19:", desc: "Bugfix do not allow Root group for Intel QuickSync ownership rules." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "22.03.19:", desc: "Fix update logic for `VERSION=public`." } diff --git a/root/etc/cont-init.d/50-gid-video b/root/etc/cont-init.d/50-gid-video index a0f9d2b..b643dc2 100755 --- a/root/etc/cont-init.d/50-gid-video +++ b/root/etc/cont-init.d/50-gid-video @@ -1,9 +1,13 @@ #!/usr/bin/with-contenv bash -# check for the existence of a video device -if [ -e /dev/dri ]; then - VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1) - # just add abc to root if stuff in dri is root owned +# check for the existence of a video and/or tuner device +if [ -e /dev/dri ] || [ -e /dev/dvb ]; then + if [ -e /dev/dri ]; then + VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1) + else + VIDEO_GID=$(stat -c '%g' /dev/dvb/* | grep -v '^0$' | head -n 1) + fi + # just add abc to root if stuff in dri/dvb is root owned if [ -z "${VIDEO_GID}" ]; then usermod -a -G root abc exit 0