From: "Middelschulte, Leif" <Leif.Middelschulte@klsmartin.com>
To: "ejo@pengutronix.de" <ejo@pengutronix.de>
Cc: "rauc@pengutronix.de" <rauc@pengutronix.de>
Subject: Re: [RAUC] Progress indication
Date: Thu, 11 May 2017 10:29:41 +0000 [thread overview]
Message-ID: <1494498580.6958.1.camel@klsmartin.com> (raw)
In-Reply-To: <382dd7e9-7505-80b9-2465-ac1c019ad115@pengutronix.de>
Hello Enrico,
Am Mittwoch, den 10.05.2017, 15:22 +0200 schrieb Enrico Joerns:
> 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?
Yes, since some updates will take quite a while, we'd like to display an approximate progress (e.g. bytes written/byte to be written).
I saw that there's a "send_progress" callback one can use from *within* the installer. But currently it's not even used to indicate any progress of raw (stream) copies, right?
I'm trying to stick to upstream code as much as possible and, eventually, contribute what's necessary to communicate progress back.
If I understood the code right, I'd go and do the following:
1.) make my hook script write its percentual progress to stdout
2.) I'd fork RAUC Service's update_handler code to read back STDOUT from the spawned's process (i.e. hook.sh)
3.) use send_progress to publish the information to the "dumb" GUI
>
> Best regards, Enrico
>
Best regards,
Leif
P.S.: Is there an IRC, Slack or GITTER channel for RAUC discussions?
_______________________________________________
RAUC mailing list
next prev parent reply other threads:[~2017-05-11 10:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 16:03 Middelschulte, Leif
2017-05-04 10:29 ` Enrico Joerns
2017-05-04 14:33 ` Middelschulte, Leif
2017-05-10 13:22 ` Enrico Joerns
2017-05-11 10:29 ` Middelschulte, Leif [this message]
2017-05-16 9:21 ` Enrico Joerns
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494498580.6958.1.camel@klsmartin.com \
--to=leif.middelschulte@klsmartin.com \
--cc=ejo@pengutronix.de \
--cc=rauc@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox