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 via email to