From 4e3944375779e7fb0fc960d6079d186b09540fca Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 1 Jul 2015 10:17:48 +1000 Subject: udev: make sure the udev callout path is valid for a test run udev requires callout binaries to sit in /lib/udev or otherwise provide an absolute path. The test suite should work without installing everything first, so create two rule files - one to install, one with the path to the $builddir/test Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- udev/.gitignore | 1 + udev/80-libinput-device-groups.rules | 8 -------- udev/80-libinput-device-groups.rules.in | 8 ++++++++ udev/90-libinput-model-quirks.rules | 28 ---------------------------- udev/90-libinput-model-quirks.rules.in | 28 ++++++++++++++++++++++++++++ udev/Makefile.am | 12 ++++++++++++ 6 files changed, 49 insertions(+), 36 deletions(-) delete mode 100644 udev/80-libinput-device-groups.rules create mode 100644 udev/80-libinput-device-groups.rules.in delete mode 100644 udev/90-libinput-model-quirks.rules create mode 100644 udev/90-libinput-model-quirks.rules.in (limited to 'udev') diff --git a/udev/.gitignore b/udev/.gitignore index d8e1456b..72c77a0f 100644 --- a/udev/.gitignore +++ b/udev/.gitignore @@ -1 +1,2 @@ libinput-device-group +*.rules diff --git a/udev/80-libinput-device-groups.rules b/udev/80-libinput-device-groups.rules deleted file mode 100644 index f826bec6..00000000 --- a/udev/80-libinput-device-groups.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION!="add|change", GOTO="libinput_device_group_end" -KERNEL!="event[0-9]*", GOTO="libinput_device_group_end" - -ATTRS{phys}=="?*", \ - PROGRAM="libinput-device-group %S%p", \ - ENV{LIBINPUT_DEVICE_GROUP}="%c" - -LABEL="libinput_device_group_end" diff --git a/udev/80-libinput-device-groups.rules.in b/udev/80-libinput-device-groups.rules.in new file mode 100644 index 00000000..c2af0ce7 --- /dev/null +++ b/udev/80-libinput-device-groups.rules.in @@ -0,0 +1,8 @@ +ACTION!="add|change", GOTO="libinput_device_group_end" +KERNEL!="event[0-9]*", GOTO="libinput_device_group_end" + +ATTRS{phys}=="?*", \ + PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \ + ENV{LIBINPUT_DEVICE_GROUP}="%c" + +LABEL="libinput_device_group_end" diff --git a/udev/90-libinput-model-quirks.rules b/udev/90-libinput-model-quirks.rules deleted file mode 100644 index 43674f55..00000000 --- a/udev/90-libinput-model-quirks.rules +++ /dev/null @@ -1,28 +0,0 @@ -# Do not edit this file, it will be overwritten on update -# -# This file contains lookup rules for libinput model-specific quirks. -# The contents of this file are a contract between libinput, udev rules and -# the hwdb. -# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME -# -# The hwdb database is in: -# 90-libinput-model-quirks.hwdb - -ACTION!="add|change", GOTO="libinput_model_quirks_end" -KERNEL!="event*", GOTO="libinput_model_quirks_end" - -# Matches below are exclusive, if one matches we skip the rest -# hwdb matches: -# -# libinput:touchpad: -ENV{ID_INPUT_TOUCHPAD}=="1", \ - IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:", \ - GOTO="libinput_model_quirks_end" - -# libinput:name::dmi: -KERNELS=="input*", \ - IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'", \ - GOTO="libinput_model_quirks_end" - - -LABEL="libinput_model_quirks_end" diff --git a/udev/90-libinput-model-quirks.rules.in b/udev/90-libinput-model-quirks.rules.in new file mode 100644 index 00000000..43674f55 --- /dev/null +++ b/udev/90-libinput-model-quirks.rules.in @@ -0,0 +1,28 @@ +# Do not edit this file, it will be overwritten on update +# +# This file contains lookup rules for libinput model-specific quirks. +# The contents of this file are a contract between libinput, udev rules and +# the hwdb. +# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME +# +# The hwdb database is in: +# 90-libinput-model-quirks.hwdb + +ACTION!="add|change", GOTO="libinput_model_quirks_end" +KERNEL!="event*", GOTO="libinput_model_quirks_end" + +# Matches below are exclusive, if one matches we skip the rest +# hwdb matches: +# +# libinput:touchpad: +ENV{ID_INPUT_TOUCHPAD}=="1", \ + IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:", \ + GOTO="libinput_model_quirks_end" + +# libinput:name::dmi: +KERNELS=="input*", \ + IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'", \ + GOTO="libinput_model_quirks_end" + + +LABEL="libinput_model_quirks_end" diff --git a/udev/Makefile.am b/udev/Makefile.am index 7d19809d..e5cf95c4 100644 --- a/udev/Makefile.am +++ b/udev/Makefile.am @@ -1,6 +1,10 @@ udevdir=$(UDEV_DIR) udev_PROGRAMS = libinput-device-group +litest_rules = 80-libinput-device-groups-litest.rules \ + 90-libinput-model-quirks-litest.rules +udev_SCRIPTS = $(litest_rules) + libinput_device_group_SOURCES = libinput-device-group.c libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS) libinput_device_group_LDADD = $(LIBUDEV_LIBS) @@ -13,3 +17,11 @@ dist_udev_rules_DATA = \ udev_hwdbdir=$(UDEV_DIR)/hwdb.d dist_udev_hwdb_DATA = \ 90-libinput-model-quirks.hwdb + +%-litest.rules: %.rules.in + $(SED) -e "s|\@UDEV_TEST_PATH\@|$(abs_builddir)/|" < $^ > $@ + +CLEANFILES = $(litest_rules) +DISTCLEANFILES = \ + 80-libinput-device-groups.rules \ + 90-libinput-model-quirks.rules -- cgit v1.2.3