mail archive of the rauc mailing list
 help / color / mirror / Atom feed
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, 4 May 2017 14:33:03 +0000	[thread overview]
Message-ID: <1493908382.31913.1.camel@klsmartin.com> (raw)
In-Reply-To: <30eb89be-17c9-3e4e-766b-7e833ccc93f7@pengutronix.de>

Hi Enrico,

firstofall: Thanks for your reply!

Am Donnerstag, den 04.05.2017, 12:29 +0200 schrieb Enrico Joerns:
> Hi Leif,
> 
> On 04/26/2017 06:03 PM, Middelschulte, Leif wrote:
> > Hi,
> > 
> > I want to flash a µCtrl, as part of a "Install group" using RAUC and (if necessary) a custom Handler (?).
> > 
> > Looking at https://github.com/rauc/rauc/blob/master/test/install-content/custom_handler.sh I was wondering about the progress indication.
> > What's the supposed way to extend RAUC to handle some kind of binary bundled within the raucb and communicate the update progress back to the (already implemented) Update Controller?
> 
> the `custom handler` you took a look at is something different than what 
> you require. It is a way to fully customize the entire RAUC installation 
> process using a script or a binary.
> 
> I guess this is not what you intend to do.
> 
> If I got it right, you only want to have a custom handling for a single 
> slot class.
> This is what RAUCs `hooks` [1] are for. Or, to be more detailed, what 
> the per-slot `install` hook [2] is for.
> 
> Hooks are defined in your Bundles manifest and provided by a single 
> `hook` script that must be placed inside the bundle and referred to in 
> the bundle section `[hooks]`:
> 
>    [hooks]
>    filename=my-hooks.sh
> 
> Then you have to add to your µCtrl-Slots image section the line
> 
>    [image.uctrl]
>    ...
>    hooks=install
> 
> This will make RAUC calling the hook skript instead of performing the 
> default installation routine for this slot.
> 
> In the hook script you should check for being executed with the 
> arguments matching your slot. An example for this is in the 
> documentation. Slightly adapted to your needs it will look something 
> like this:
> 
>    #!/bin/sh
> 
>    case "$1" in
>            slot-install)
>                    # only uctrl needs to be handled
>                    test "$RAUC_SLOT_CLASS" = "uctrl" || exit 0
> 
>                    uctrl-update-routine "$RAUC_IMAGE_NAME"
>                    ;;
>            *)
>                    exit 1
>                    ;;
>    esac
> 
>    exit 0
> 
> 
> Does that help you?
Yeah, that makes sense.

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?

> 
> 
> Best regards
> 
> Enrico
> 
> 
> [1] 
> http://rauc.readthedocs.io/en/latest/using.html#bundle-based-customization-hooks
> [2] http://rauc.readthedocs.io/en/latest/using.html#install-hook
> 

Best regards,

Leif
_______________________________________________
RAUC mailing list

  reply	other threads:[~2017-05-04 14:33 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 [this message]
2017-05-10 13:22     ` Enrico Joerns
2017-05-11 10:29       ` Middelschulte, Leif
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=1493908382.31913.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