[PATCH] non-root access

juan.j.zhao at intel.com juan.j.zhao at intel.com
Wed Oct 12 00:36:32 PDT 2011


From: Juan Zhao <juan.j.zhao at intel.com>


 add udev rules for non-root access to graphics and input resources

---
 configure.ac                       |    3 ++-
 src/98-wayland-permission.rules.in |    6 ++++++
 src/Makefile.am                    |    3 +++
 3 files changed, 11 insertions(+), 1 deletions(-)
 create mode 100644 src/98-wayland-permission.rules.in

diff --git a/configure.ac b/configure.ac
index 3ea77e6..58ee9a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,5 +52,6 @@ AC_CONFIG_FILES([Makefile
 		 wayland-scanner.m4
 		 src/Makefile
 		 src/wayland-server.pc
-		 src/wayland-client.pc])
+		 src/wayland-client.pc
+		 src/98-wayland-permission.rules])
 AC_OUTPUT
diff --git a/src/98-wayland-permission.rules.in b/src/98-wayland-permission.rules.in
new file mode 100644
index 0000000..b2e4a2c
--- /dev/null
+++ b/src/98-wayland-permission.rules.in
@@ -0,0 +1,6 @@
+#give the permissions for non-root users
+KERNEL=="mouse*|mice|event*",        MODE="0660" GROUP="video"
+SUBSYSTEM=="graphics",        MODE="0666"  GROUP="video"
+SUBSYSTEM=="drm",             MODE="0666"  GROUP="video"
+KERNEL=="card[0-9]"          MODE="0666"   GROUP="video"
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 156ca2e..0d6b3ce 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,9 @@ libwayland_client_la_SOURCES =			\
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = wayland-client.pc wayland-server.pc
 
+udevrulesdir = /lib/udev/rules.d
+dist_udevrules_DATA = 98-wayland-permission.rules
+
 AM_CPPFLAGS = $(FFI_CFLAGS)
 AM_CFLAGS = $(GCC_CFLAGS)
 
-- 
1.7.1



More information about the wayland-devel mailing list