From 9b27c5b585455ab31c9f888bf7e710846b4ae76f Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 1 Dec 2007 17:08:04 +0000
Subject: [PATCH] refactor hotplug2 rules, make sure that the default button
 rule is only used during the init (should fix #2772)

SVN-Revision: 9644
---
 .../files/etc/hotplug2-common.rules           | 35 ++++++++++++++++++
 .../base-files/files/etc/hotplug2-init.rules  | 36 +------------------
 package/hotplug2/files/hotplug2.rules         |  2 +-
 3 files changed, 37 insertions(+), 36 deletions(-)
 create mode 100644 package/base-files/files/etc/hotplug2-common.rules

diff --git a/package/base-files/files/etc/hotplug2-common.rules b/package/base-files/files/etc/hotplug2-common.rules
new file mode 100644
index 0000000000..ed785e3b1c
--- /dev/null
+++ b/package/base-files/files/etc/hotplug2-common.rules
@@ -0,0 +1,35 @@
+
+DEVICENAME ~~ (null|full|ptmx|tty|zero) {
+	nothrottle
+	makedev /dev/%DEVICENAME% 0666
+	next
+}
+
+DEVICENAME ~~ (tun|tap[0-9]) {
+	nothrottle
+	makedev /dev/net/%DEVICENAME% 0644
+	next
+}
+
+DEVICENAME ~~ (ppp) {
+	nothrottle
+	makedev /dev/%DEVICENAME% 0600
+	next
+}
+
+DEVICENAME ~~ (controlC[0-9]|pcmC0D0*|timer) {
+	nothrottle
+	makedev /dev/snd/%DEVICENAME% 0644
+	next
+}
+
+DEVPATH is set {
+	nothrottle
+	makedev /dev/%DEVICENAME% 0644
+}
+
+FIRMWARE is set {
+	nothrottle
+	exec /sbin/hotplug-call firmware;
+	next
+}
diff --git a/package/base-files/files/etc/hotplug2-init.rules b/package/base-files/files/etc/hotplug2-init.rules
index 385af19193..429cdbbe16 100644
--- a/package/base-files/files/etc/hotplug2-init.rules
+++ b/package/base-files/files/etc/hotplug2-init.rules
@@ -1,38 +1,4 @@
-
-DEVICENAME ~~ (null|full|ptmx|tty|zero) {
-	nothrottle
-	makedev /dev/%DEVICENAME% 0666
-	next
-}
-
-DEVICENAME ~~ (tun|tap[0-9]) {
-	nothrottle
-	makedev /dev/net/%DEVICENAME% 0644
-	next
-}
-
-DEVICENAME ~~ (ppp) {
-	nothrottle
-	makedev /dev/%DEVICENAME% 0600
-	next
-}
-
-DEVICENAME ~~ (controlC[0-9]|pcmC0D0*|timer) {
-	nothrottle
-	makedev /dev/snd/%DEVICENAME% 0644
-	next
-}
-
-DEVPATH is set {
-	nothrottle
-	makedev /dev/%DEVICENAME% 0644
-}
-
-FIRMWARE is set {
-	nothrottle
-	exec /sbin/hotplug-call firmware;
-	next
-}
+$include /etc/hotplug2-common.rules
 
 SUBSYSTEM ~~ button {
 	exec kill -USR1 1 ;
diff --git a/package/hotplug2/files/hotplug2.rules b/package/hotplug2/files/hotplug2.rules
index 8429857824..1f3a444151 100644
--- a/package/hotplug2/files/hotplug2.rules
+++ b/package/hotplug2/files/hotplug2.rules
@@ -1,4 +1,4 @@
-$include /etc/hotplug2-init.rules
+$include /etc/hotplug2-common.rules
 
 SUBSYSTEM ~~ (net|button|usb) {
 	exec /sbin/hotplug-call %SUBSYSTEM%;
-- 
GitLab