[RFC vmmouse] Install support files to try and have the driver loaded automatically via udev.

Michel Dänzer michel at daenzer.net
Thu Apr 1 09:42:59 PDT 2010


From: Michel Dänzer <daenzer at vmware.com>

---
 Makefile.am                   |    2 +-
 configure.ac                  |   32 +++++++++++++++++++++++++++++++-
 udev/10-vmmouse.conf          |    7 +++++++
 udev/69-xorg-vmmouse.rules.in |    1 +
 udev/Makefile.am              |   39 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 udev/10-vmmouse.conf
 create mode 100644 udev/69-xorg-vmmouse.rules.in
 create mode 100644 udev/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index daf09d4..7af5803 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-SUBDIRS = shared src tools fdi man
+SUBDIRS = shared src tools fdi man udev
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 .PHONY: ChangeLog INSTALL
 
diff --git a/configure.ac b/configure.ac
index e39fcbb..b3d006f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,14 @@ AC_ARG_WITH(xorg-module-dir,
 inputdir=${moduledir}/input
 AC_SUBST(inputdir)
 
+AC_ARG_WITH(xorg-conf-dir,
+            AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+                           [Default xorg.conf.d directory [[default=$libdir/X11/xorg.conf.d]]]),
+            [xorgconfdir="$withval"],
+            [xorgconfdir="$libdir/X11/xorg.conf.d"])
+XORG_CONF_DIR=${xorgconfdir}
+AC_SUBST(XORG_CONF_DIR)
+
 AC_ARG_WITH(hal-bin-dir,
 	    AC_HELP_STRING([--with-hal-bin-dir=DIR],
 			   [Directory where HAL binaries where installed [[default=$bindir]]]),
@@ -85,6 +93,28 @@ AC_ARG_WITH(hal-fdi-dir,
 HAL_FDI_DIR=${halfdidir}
 AC_SUBST(HAL_FDI_DIR)
 
+case $host_os in
+  linux*)
+    IS_LINUX="yes"
+esac
+AM_CONDITIONAL(LINUX, [test "x$IS_LINUX" = xyes])
+
+if test "x$prefix" = "xNONE" -o "x$prefix" = "x/usr" -o "x$prefix" = "x/usr/local" ; then
+  slashlibdir=/lib
+else
+  slashlibdir=$prefix/lib
+fi
+AC_SUBST(slashlibdir)
+
+AC_ARG_WITH(udev-rules-dir,
+	    AC_HELP_STRING([--with-udev-rules-dir=DIR],
+			   [Default udev rules.d directory
+			    [[default=$slashlibdir/udev/rules.d]]]),
+	    [udevrulesdir="$withval"],
+	    [udevrulesdir="$slashlibdir/udev/rules.d"])
+UDEV_RULES_DIR=${udevrulesdir}
+AC_SUBST(UDEV_RULES_DIR)
+
 # Checks for extensions
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
@@ -115,4 +145,4 @@ AC_SUBST([CFLAGS])
 # Checks for header files.
 AC_HEADER_STDC
 
-AC_OUTPUT([Makefile shared/Makefile src/Makefile tools/Makefile fdi/Makefile man/Makefile])
+AC_OUTPUT([Makefile shared/Makefile src/Makefile tools/Makefile fdi/Makefile man/Makefile udev/Makefile])
diff --git a/udev/10-vmmouse.conf b/udev/10-vmmouse.conf
new file mode 100644
index 0000000..35c438e
--- /dev/null
+++ b/udev/10-vmmouse.conf
@@ -0,0 +1,7 @@
+Section "InputClass"
+	Identifier	"vmmouse"
+	MatchIsPointer	"on"
+	MatchTag	"vmmouse"
+	Driver		"vmmouse"
+EndSection
+
diff --git a/udev/69-xorg-vmmouse.rules.in b/udev/69-xorg-vmmouse.rules.in
new file mode 100644
index 0000000..0d7f028
--- /dev/null
+++ b/udev/69-xorg-vmmouse.rules.in
@@ -0,0 +1 @@
+ACTION=="add|change", ENV{ID_INPUT_MOUSE}=="?*", ATTRS{description}=="i8042 AUX port", PROGRAM="__BIN_PREFIX__/vmmouse_detect", ENV{ID_INPUT.tags}="vmmouse"
diff --git a/udev/Makefile.am b/udev/Makefile.am
new file mode 100644
index 0000000..39f1653
--- /dev/null
+++ b/udev/Makefile.am
@@ -0,0 +1,39 @@
+#  Copyright 2010 VMware, Inc.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  VMWARE, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+confdir=$(XORG_CONF_DIR)
+conf_DATA = 10-vmmouse.conf
+
+EXTRA_DIST = $(conf_DATA)
+
+if LINUX
+
+udevdir=$(UDEV_RULES_DIR)
+udev_DATA = 69-xorg-vmmouse.rules
+
+$(udev_DATA):
+	sed -e 's|__BIN_PREFIX__|$(bindir)|g' \
+	    < $(srcdir)/$@.in > $@
+
+EXTRA_DIST += $(conf_DATA) $(udev_DATA).in
+
+CLEANFILES = $(udev_DATA)
+
+endif # LINUX
-- 
1.7.0.3



More information about the xorg-devel mailing list