From c7d9df20a908dc47ef103d739821b8f825fdcbb9 Mon Sep 17 00:00:00 2001 From: thelamer Date: Sat, 22 Jun 2019 10:56:16 -0700 Subject: [PATCH] fall back to root if no group is found --- root/etc/cont-init.d/50-gid-video | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/50-gid-video b/root/etc/cont-init.d/50-gid-video index e7ef21a..a0f9d2b 100755 --- a/root/etc/cont-init.d/50-gid-video +++ b/root/etc/cont-init.d/50-gid-video @@ -1,8 +1,13 @@ #!/usr/bin/with-contenv bash -# Check for the existence of the Intel video device +# 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 + if [ -z "${VIDEO_GID}" ]; then + usermod -a -G root abc + exit 0 + fi else exit 0 fi