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?


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

--
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

Reply via email to