drm: Create device entries with the "video" group
authorFrançois Tigeot <ftigeot@wolfpond.org>
Sat, 26 Dec 2015 08:16:27 +0000 (09:16 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Sat, 26 Dec 2015 08:17:01 +0000 (09:17 +0100)
* Add a new "video" group with id 44

* Make the drm subsystem create /dev/dri/card* devices with this
  new group

* FreeBSD and many Linux distributions already do the same thing

Suggested-by: Koop Mast
Partially-obtained-from: FreeBSD

UPDATING
etc/Makefile
etc/defaults/devfs.conf
etc/group
sys/dev/drm/include/drm/drmP.h

index 0f6aed6..9d3caff 100644 (file)
--- a/UPDATING
+++ b/UPDATING
@@ -8,6 +8,19 @@
 # If you discover any problem, please contact the bugs@lists.dragonflybsd.org
 # mailing list with the details.
 
++-----------------------------------------------------------------------+
++         UPGRADING DRAGONFLY FROM 4.4 TO LATER VERSIONS                +
++-----------------------------------------------------------------------+
+
+2015-12-26
+
+       The default group assigned to /dev/dri entries has been changed
+       from 'wheel' to 'video' with the id of '44'. If you want to have
+       access to the dri devices please add yourself to the video group
+       with:
+
+       # pw groupmod video -m $USER
+
 +-----------------------------------------------------------------------+
 +         UPGRADING DRAGONFLY FROM 4.2 TO LATER VERSIONS                +
 +-----------------------------------------------------------------------+
index 25e4fbb..4215f18 100644 (file)
@@ -110,6 +110,8 @@ preupgrade:
                pw -V ${DESTDIR}/etc useradd _dhcp -u 77 \
                   -c "DHCP programs" \
                   -d /var/empty -s /sbin/nologin
+       (pw -V ${DESTDIR}/etc groupshow video -q > /dev/null) || \
+               pw -V ${DESTDIR}/etc groupadd video -g 44
        (pw -V ${DESTDIR}/etc groupshow authpf -q > /dev/null) || \
                pw -V ${DESTDIR}/etc groupadd authpf -g 63
        (pw -V ${DESTDIR}/etc groupshow _pflogd -q > /dev/null) || \
index c2e3d17..49f9e59 100644 (file)
@@ -3,3 +3,5 @@
 
 #link  dsp0    dsp
 #link  mixer0  mixer
+
+perm   dri/card*       root:video      0660
index 3244149..623f776 100644 (file)
--- a/etc/group
+++ b/etc/group
@@ -17,6 +17,7 @@ sshd:*:22:
 smmsp:*:25:
 mailnull:*:26:
 guest:*:31:root
+video:*:44:
 bind:*:53:
 proxy:*:62:
 authpf:*:63:
index bd717fc..a2dd8e6 100644 (file)
@@ -228,9 +228,9 @@ SYSCTL_DECL(_hw_drm);
 
 #define __OS_HAS_AGP   1
 
-#define DRM_DEV_MODE   (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-#define DRM_DEV_UID    0
-#define DRM_DEV_GID    0
+#define DRM_DEV_MODE   (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
+#define DRM_DEV_UID    UID_ROOT
+#define DRM_DEV_GID    GID_ROOT
 
 #define DRM_CURPROC            curthread
 #define DRM_STRUCTPROC         struct thread