Blob Blame History Raw
From 027496b5552edc8200f07764971266d43688d5f1 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 12 Jan 2017 08:54:39 +0100
Subject: [PATCH] udev: split the uaccess rule into a separate file

The seat tag for uaccess devices is added in 71-seat.rules; the 80-* rule is
too late for that.

Also, this makes it easy for distributions to exclude the rule that is
not relevant to them; still both being installed at the same time
doesn't cause any trouble.
---
 Makefile                      | 2 ++
 udev/rules.d/60-minipro.rules | 1 +
 udev/rules.d/80-minipro.rules | 1 -
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 udev/rules.d/60-minipro.rules

diff --git a/Makefile b/Makefile
index 06cbfca..4ed8fb3 100644
--- a/Makefile
+++ b/Makefile
@@ -119,6 +119,7 @@ install:
 	cp man/minipro.1 $(MAN_INSTDIR)/
 	if [ -n "$(UDEV_DIR)" ]; then \
 		mkdir -p $(UDEV_RULES_INSTDIR); \
+		cp udev/rules.d/60-minipro.rules $(UDEV_RULES_INSTDIR)/; \
 		cp udev/rules.d/80-minipro.rules $(UDEV_RULES_INSTDIR)/; \
 	fi
 	if [ -n "$(COMPLETIONS_DIR)" ]; then \
@@ -130,6 +131,7 @@ uninstall:
 	rm -f $(BIN_INSTDIR)/$(MINIPRO)
 	rm -f $(BIN_INSTDIR)/$(MINIPROHEX)
 	rm -f $(MAN_INSTDIR)/minipro.1
+	if [ -n "$(UDEV_DIR)" ]; then rm -f $(UDEV_RULES_INSTDIR)/60-minipro.rules; fi
 	if [ -n "$(UDEV_DIR)" ]; then rm -f $(UDEV_RULES_INSTDIR)/80-minipro.rules; fi
 	if [ -n "$(COMPLETIONS_DIR)" ]; then rm -f $(COMPLETIONS_INSTDIR)/minipro; fi
 
diff --git a/udev/rules.d/60-minipro.rules b/udev/rules.d/60-minipro.rules
new file mode 100644
index 0000000..4b69fb4
--- /dev/null
+++ b/udev/rules.d/60-minipro.rules
@@ -0,0 +1 @@
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="e11c", TAG+="uaccess"
diff --git a/udev/rules.d/80-minipro.rules b/udev/rules.d/80-minipro.rules
index 3715d1e..ca3939b 100644
--- a/udev/rules.d/80-minipro.rules
+++ b/udev/rules.d/80-minipro.rules
@@ -1,5 +1,4 @@
 # TL866A/CS rules
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="e11c", TAG+="uaccess"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="e11c", MODE="0660", GROUP="plugdev"
 
 # TL866II+ rules
-- 
2.21.0