4f3c1e7793
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 <yszhou4tech@gmail.com> SVN-Revision: 48799
81 lines
1.4 KiB
JSON
81 lines
1.4 KiB
JSON
[
|
|
[ "case", "ACTION", {
|
|
"add": [
|
|
[ "if",
|
|
[ "and",
|
|
[ "has", "MAJOR" ],
|
|
[ "has", "MINOR" ],
|
|
],
|
|
[
|
|
[ "if",
|
|
[ "or",
|
|
[ "eq", "DEVNAME",
|
|
[ "null", "full", "ptmx", "zero" ],
|
|
],
|
|
[ "regex", "DEVNAME",
|
|
[ "^gpio", "^hvc" ],
|
|
],
|
|
],
|
|
[
|
|
[ "makedev", "/dev/%DEVNAME%", "0666" ],
|
|
[ "return" ],
|
|
]
|
|
],
|
|
[ "if",
|
|
[ "or",
|
|
[ "eq", "DEVNAME", "mapper/control" ],
|
|
[ "regex", "DEVPATH", "^ppp" ],
|
|
],
|
|
[
|
|
[ "makedev", "/dev/%DEVNAME%", "0600" ],
|
|
[ "return" ],
|
|
],
|
|
],
|
|
[ "if",
|
|
[ "has", "DEVNAME" ],
|
|
[ "makedev", "/dev/%DEVNAME%", "0644" ],
|
|
],
|
|
],
|
|
],
|
|
[ "if",
|
|
[ "has", "FIRMWARE" ],
|
|
[
|
|
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
|
|
[ "load-firmware", "/lib/firmware" ],
|
|
[ "return" ]
|
|
]
|
|
],
|
|
],
|
|
"remove" : [
|
|
[ "if",
|
|
[ "and",
|
|
[ "has", "DEVNAME" ],
|
|
[ "has", "MAJOR" ],
|
|
[ "has", "MINOR" ],
|
|
],
|
|
[ "rm", "/dev/%DEVNAME%" ]
|
|
]
|
|
]
|
|
} ],
|
|
[ "if",
|
|
[ "and",
|
|
[ "has", "BUTTON" ],
|
|
[ "eq", "SUBSYSTEM", "button" ],
|
|
],
|
|
[ "button", "/etc/rc.button/%BUTTON%" ]
|
|
],
|
|
[ "if",
|
|
[ "and",
|
|
[ "eq", "SUBSYSTEM", "usb-serial" ],
|
|
[ "regex", "DEVNAME",
|
|
[ "^ttyUSB", "^ttyACM" ]
|
|
]
|
|
],
|
|
[ "exec", "/sbin/hotplug-call", "tty" ],
|
|
[ "if",
|
|
[ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
|
|
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
|
|
]
|
|
],
|
|
]
|