mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-14 17:28:28 +04:00
The hotplug rules live in a single /etc/hotplug.json, so a package that needs a device node named, owned or grouped its own way has no way to contribute one; the alternatives are patching the shared file or falling back to a shell script under /etc/hotplug.d. Load /etc/hotplug.json.d/*.json from inside the device node branch, ahead of the built-in name rules, and /etc/hotplug-preinit.json.d/* at the end of the preinit script. Fragments are run in sorted order. A fragment that creates a node keeps it: the generic rule below still runs, but its mknod() fails with EEXIST and leaves the node alone. This is done in preparation for deprecating some of the subtarget-wide FEATURES flags, instead introducing feature-umbrella packages such as `video-support` and `audio-support` shipping the hotplug rule snippets and having all providers (ie. kmods) and users depend on them. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
20 lines
359 B
JSON
20 lines
359 B
JSON
[
|
|
[ "case", "ACTION", {
|
|
"add": [
|
|
[ "if",
|
|
[ "has", "FIRMWARE" ],
|
|
[
|
|
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
|
|
[ "load-firmware", "/lib/firmware" ],
|
|
[ "return" ]
|
|
]
|
|
]
|
|
]
|
|
} ],
|
|
[ "if",
|
|
[ "eq", "SUBSYSTEM", "button" ],
|
|
[ "exec", "/etc/rc.button/failsafe" ]
|
|
],
|
|
[ "include", "/etc/hotplug-preinit.json.d/*.json" ]
|
|
]
|