File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
268268
269269## Versions
270270
271+ * ** 02.08.19:** - Attempt to automatically fix permissions on /dev/dri and /dev/dvb.
271272* ** 28.06.19:** - Rebasing to alpine 3.10.
272273* ** 27.03.19:** - Rebase to Alpine 3.9, fix init logic to only chown once.
273274* ** 23.03.19:** - Switching to new Base images, shift to arm32v7 tag.
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ app_setup_block: |
125125
126126# changelog
127127changelogs :
128+ - { date: "02.08.19:", desc: "Attempt to automatically fix permissions on /dev/dri and /dev/dvb." }
128129 - { date: "28.06.19:", desc: "Rebasing to alpine 3.10." }
129130 - { date: "27.03.19:", desc: "Rebase to Alpine 3.9, fix init logic to only chown once." }
130131 - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." }
Original file line number Diff line number Diff line change 1+ #!/usr/bin/with-contenv bash
2+
3+ # check for the existence of a video and/or tuner device
4+ if [ -e /dev/dri ] || [ -e /dev/dvb ]; then
5+ if [ -e /dev/dri ]; then
6+ VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1)
7+ else
8+ VIDEO_GID=$(stat -c '%g' /dev/dvb/* | grep -v '^0$' | head -n 1)
9+ fi
10+ # just add abc to root if stuff in dri/dvb is root owned
11+ if [ -z "${VIDEO_GID}" ]; then
12+ usermod -a -G root abc
13+ exit 0
14+ fi
15+ else
16+ exit 0
17+ fi
18+
19+ # Check if this GID matches the current abc user
20+ ABCGID=$(getent group abc | awk -F: '{print $3}')
21+ if [ "${ABCGID}" == "${VIDEO_GID}" ]; then
22+ exit 0
23+ fi
24+
25+ # Check if the GID is taken and swap to 65533
26+ CURRENT=$(getent group ${VIDEO_GID} | awk -F: '{print $1}')
27+ if [ -z "${CURRENT}" ] || [ "${CURRENT}" == 'video' ]; then
28+ groupmod -g ${VIDEO_GID} video
29+ usermod -a -G video abc
30+ else
31+ groupmod -g 65533 ${CURRENT}
32+ groupmod -g ${VIDEO_GID} video
33+ usermod -a -G video abc
34+ fi
You can’t perform that action at this time.
0 commit comments