mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 23:16:56 +04:00
Move the storage backend probe, the ctx construction, the locking helpers and the volume-name check out of the CLI script into /usr/lib/uvol/common.uc, so a second entry point can reuse them without duplicating the logic. Publish ubus object 'uvol' with the volume operations and a readiness query. Consumers such as uxc are pure ubus frontends and must not exec the command line tool. Ship an rpcd exec plugin, installed by the uvol package itself, taking the same locks as the CLI so both entry points stay serialised. As stdout is the plugin's reply channel, point file descriptor 1 at stderr for the duration of a call. Send a 'uvol.ready' ubus event at the end of 'uvol boot', carrying the active backend name and whether the .meta volume is ready. Consumers such as uxc can wait for this event instead of polling volume state. Sending is best-effort: boot keeps its exit code even when ubusd is not reachable. Signed-off-by: Daniel Golle <daniel@makrotopia.org>