Hi Leif,
On 05/04/2017 04:33 PM, Middelschulte, Leif wrote:
Now, about my second question: How does a custom hook script communicate its
progress back to the install-handler (i.e. rauc service)?
I'd go modify rauc's update_handler.c, set the G_SUBPROCESS_FLAGS_STDOUT_PIPE
flag for the spawned slot script-process and read back the progress and
propagate it to the DBus interface using
r_context_send_progress.
Is that the right direction here?
in RAUC, the progress is generated by adding a 'step' for an action you
perform.
When starting the action you call r_context_begin_step(), when
terminating the action you call r_context_end_step(). It is important to
know that steps have a nesting depth that allows visualizers to control
the granularity of information they show.
A step can also be marked as either successful or failed.
An example is the "Determining slot states" step:
r_context_begin_step("determine_slot_states", "Determining slot
states", 0);
[...]
r_context_end_step("determine_slot_states", res);
Thus, this should be the interface to use to add new steps.
The current granularity we have does not go deeper than "Copying image".
This will be called for both a default install handler as well as for an
install hook.
If you ask for progress from the install hook, you intend to be more
fine-grained with your messages?
Best regards, Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
RAUC mailing list