rpms/libdrm/devel libdrm-2.4.0-no-freaking-mknod.patch, NONE, 1.1 libdrm.spec, 1.29, 1.30 libdrm-2.3.0-default-mode.patch, 1.1, NONE

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Tue Nov 13 00:31:34 UTC 2007


Author: ajax

Update of /cvs/pkgs/rpms/libdrm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31923

Modified Files:
	libdrm.spec 
Added Files:
	libdrm-2.4.0-no-freaking-mknod.patch 
Removed Files:
	libdrm-2.3.0-default-mode.patch 
Log Message:
* Mon Nov 12 2007 Adam Jackson <ajax at redhat.com> 2.4.0-0.1
- libdrm-2.4.0-no-freaking-mknod.patch: Don't magically mknod the device
  file, that's what udev is for.


libdrm-2.4.0-no-freaking-mknod.patch:

--- NEW FILE libdrm-2.4.0-no-freaking-mknod.patch ---
diff -up libdrm-2.4.0/libdrm/xf86drm.c.mknod libdrm-2.4.0/libdrm/xf86drm.c
--- libdrm-2.4.0/libdrm/xf86drm.c.mknod	2007-10-30 20:10:10.000000000 -0400
+++ libdrm-2.4.0/libdrm/xf86drm.c	2007-11-12 19:26:12.000000000 -0500
@@ -266,64 +266,12 @@ static int drmMatchBusID(const char *id1
  */
 static int drmOpenDevice(long dev, int minor)
 {
-    stat_t          st;
     char            buf[64];
     int             fd;
-    mode_t          devmode = DRM_DEV_MODE, serv_mode;
-    int             isroot  = !geteuid();
-    uid_t           user    = DRM_DEV_UID;
-    gid_t           group   = DRM_DEV_GID, serv_group;
     
     sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, minor);
     drmMsg("drmOpenDevice: node name is %s\n", buf);
 
-    if (drm_server_info) {
-	drm_server_info->get_perms(&serv_group, &serv_mode);
-	devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
-	devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
-	group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
-    }
-
-    if (stat(DRM_DIR_NAME, &st)) {
-	if (!isroot)
-	    return DRM_ERR_NOT_ROOT;
-	mkdir(DRM_DIR_NAME, DRM_DEV_DIRMODE);
-	chown(DRM_DIR_NAME, 0, 0); /* root:root */
-	chmod(DRM_DIR_NAME, DRM_DEV_DIRMODE);
-    }
-
-    /* Check if the device node exists and create it if necessary. */
-    if (stat(buf, &st)) {
-	if (!isroot)
-	    return DRM_ERR_NOT_ROOT;
-	remove(buf);
-	mknod(buf, S_IFCHR | devmode, dev);
-    }
-
-    if (drm_server_info) {
-	chown(buf, user, group);
-	chmod(buf, devmode);
-    }
-
-    fd = open(buf, O_RDWR, 0);
-    drmMsg("drmOpenDevice: open result is %d, (%s)\n",
-		fd, fd < 0 ? strerror(errno) : "OK");
-    if (fd >= 0)
-	return fd;
-
-    /* Check if the device node is not what we expect it to be, and recreate it
-     * and try again if so.
-     */
-    if (st.st_rdev != dev) {
-	if (!isroot)
-	    return DRM_ERR_NOT_ROOT;
-	remove(buf);
-	mknod(buf, S_IFCHR | devmode, dev);
-	if (drm_server_info) {
-	    chown(buf, user, group);
-	    chmod(buf, devmode);
-	}
-    }
     fd = open(buf, O_RDWR, 0);
     drmMsg("drmOpenDevice: open result is %d, (%s)\n",
 		fd, fd < 0 ? strerror(errno) : "OK");
@@ -331,7 +279,6 @@ static int drmOpenDevice(long dev, int m
 	return fd;
 
     drmMsg("drmOpenDevice: Open failed\n");
-    remove(buf);
     return -errno;
 }
 
diff -up libdrm-2.4.0/libdrm/xf86drm.h.mknod libdrm-2.4.0/libdrm/xf86drm.h
--- libdrm-2.4.0/libdrm/xf86drm.h.mknod	2007-07-19 00:27:52.000000000 -0400
+++ libdrm-2.4.0/libdrm/xf86drm.h	2007-11-12 19:27:51.000000000 -0500
@@ -39,14 +39,6 @@
 #include <stdint.h>
 #include <drm.h>
 
-				/* Defaults, if nothing set in xf86config */
-#define DRM_DEV_UID	 0
-#define DRM_DEV_GID	 0
-/* Default /dev/dri directory permissions 0755 */
-#define DRM_DEV_DIRMODE	 	\
-	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
-#define DRM_DEV_MODE	 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
-
 #define DRM_DIR_NAME  "/dev/dri"
 #define DRM_DEV_NAME  "%s/card%d"
 #define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */


Index: libdrm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libdrm/devel/libdrm.spec,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- libdrm.spec	5 Nov 2007 21:01:39 -0000	1.29
+++ libdrm.spec	13 Nov 2007 00:31:01 -0000	1.30
@@ -1,7 +1,7 @@
 Summary: Direct Rendering Manager runtime library
 Name: libdrm
 Version: 2.4.0
-Release: 0%{?dist}
+Release: 0.1%{?dist}
 License: MIT
 Group: System Environment/Libraries
 URL: http://dri.sourceforge.net
@@ -10,7 +10,7 @@
 
 BuildRequires: pkgconfig automake autoconf libtool
 
-Patch1: libdrm-2.3.0-default-mode.patch
+Patch2: libdrm-2.4.0-no-freaking-mknod.patch
 
 %description
 Direct Rendering Manager runtime library
@@ -25,7 +25,7 @@
 
 %prep
 %setup -q 
-%patch1 -p1 -b .666
+%patch2 -p1 -b .mknod
 
 %build
 aclocal ; automake ; autoconf
@@ -76,6 +76,10 @@
 %{_libdir}/pkgconfig/libdrm.pc
 
 %changelog
+* Mon Nov 12 2007 Adam Jackson <ajax at redhat.com> 2.4.0-0.1
+- libdrm-2.4.0-no-freaking-mknod.patch: Don't magically mknod the device
+  file, that's what udev is for.
+
 * Thu Nov 01 2007 Dave Airlie <airlied at redhat.com> - 2.4.0-0
 - Import a snapshot of what will be 2.4 upstream
 


--- libdrm-2.3.0-default-mode.patch DELETED ---




More information about the fedora-extras-commits mailing list