Browse Source

procd: hotplug.json: allow passing hotplug events from all subsystems

There are time that programs need to be notified of events from
subsystems that are not enumerated in the .json definition, e.g. QEMU
guest agent by default requires /dev/virtio-ports/org.qemu.guest_agent.0
which is a symlink to /dev/vportMpN from virtio-ports subsystem.

Signed-off-by: Yousong Zhou <[email protected]>

SVN-Revision: 48799
John Crispin 10 years ago
parent
commit
4f3c1e7793
1 changed files with 6 additions and 12 deletions
  1. 6 12
      package/system/procd/files/hotplug.json

+ 6 - 12
package/system/procd/files/hotplug.json

@@ -57,10 +57,6 @@
 			]
 		]
 	} ],
-	[ "if",
-		[ "eq", "SUBSYSTEM", "platform" ],
-		[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
-	],
 	[ "if",
 		[ "and",
 			[ "has", "BUTTON" ],
@@ -68,19 +64,17 @@
 		],
 		[ "button", "/etc/rc.button/%BUTTON%" ]
 	],
-	[ "if",
-		[ "eq", "SUBSYSTEM",
-			[ "net", "input", "usb", "usbmisc", "ieee1394", "block", "atm", "zaptel", "tty", "button", "sound" ]
-		],
-		[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
-	],
 	[ "if",
 		[ "and",
 			[ "eq", "SUBSYSTEM", "usb-serial" ],
 			[ "regex", "DEVNAME",
 				[ "^ttyUSB", "^ttyACM" ]
-			],
+			]
 		],
-		[ "exec", "/sbin/hotplug-call", "tty" ]
+		[ "exec", "/sbin/hotplug-call", "tty" ],
+		[ "if",
+			[ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
+			[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
+		]
 	],
 ]