summaryrefslogtreecommitdiffstats
path: root/share/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'share/hooks')
-rwxr-xr-xshare/hooks/post-start.chown-nvidia.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/hooks/post-start.chown-nvidia.sh b/share/hooks/post-start.chown-nvidia.sh
new file mode 100755
index 0000000..457b6e5
--- /dev/null
+++ b/share/hooks/post-start.chown-nvidia.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if grep -qs nvidia /var/lib/machines/"${NAME}"/etc/group
+then
+ chroot "/var/lib/machines/${NAME}" chown root:nvidia "/dev/nvidia*"
+fi