[riot-notifications] [RIOT-OS/RIOT] makefiles: allow to override suit manifest payloads (#16771)

Francisco notifications at github.com
Mon Aug 23 16:36:22 CEST 2021

### Contribution description

This adds:

* SUIT_MANIFEST_PAYLOADS: firmware payloads to be published with the
* SUIT_MANIFEST_SLOTFILES: firmware payloads referenced by the manifest
in the form 'filename:[offset]:[comp_name]' as expected by

With this the same recipes suit/publish suit/notify can be used with
non slotfiles payloads.

### Testing procedure

`examples/suit_update` still passes.

`suit/publish suit/notify` can work out of the box with for example a patch like this:

diff --git a/examples/suit_update/Makefile b/examples/suit_update/Makefile
index ac0d3c8bae..eefc6098f0 100644
--- a/examples/suit_update/Makefile
+++ b/examples/suit_update/Makefile
@@ -58,6 +58,8 @@ ifeq ($(BOARD),native)
   USE_ETHOS ?= 0
   # Configure two RAM regions with 2K each
+  #
+  include $(CURDIR)/Makefile.suit.native

 # Change this to 0 to not use ethos
diff --git a/examples/suit_update/Makefile.suit.native b/examples/suit_update/Makefile.suit.native
new file mode 100644
index 0000000000..73e58dd4d6
--- /dev/null
+++ b/examples/suit_update/Makefile.suit.native
@@ -0,0 +1,20 @@
+# Required variables defined in riotboot.inc.mk or Makefile.include
+EPOCH := $(shell date +%s)
+# Recipe to generate dummy payload
+       @$(Q)echo $(SUIT_NATIVE_PAYLOAD) > $@
+# Only a single RAM secotor is being updated, so change accordingly
+# Make sure it is built
+SUIT_COAP_SERVER ?= [2001:db8::1]
+SUIT_CLIENT ?= [2001:db8::2]
diff --git a/examples/suit_update/main.c b/examples/suit_update/main.c
index 27ff9a9cdd..13fd7f5773 100644
--- a/examples/suit_update/main.c
+++ b/examples/suit_update/main.c
@@ -192,6 +192,11 @@ int main(void)
     cmd_print_riotboot_hdr(0, NULL);

+    ipv6_addr_t addr;
+    const char addr_str[] = "2001:db8::2";
+    ipv6_addr_from_str(&addr, addr_str);
+    gnrc_netif_ipv6_addr_add(gnrc_netif_iter(NULL), &addr, 64, 0);
     /* start suit coap updater thread */

$ sudo ip tuntap add tap0 mode tap user $USER
$ sudo ip link set tap0 up
$ sudo ip address add 2001:db8::1/64 dev tap0
$ BOARD=native make -C examples/suit_update flash term`
$ BOARD=native make -C examples/suit_update/ suit/publish
$ BOARD=native make -C examples/suit_update/ suit/notify

main(): This is RIOT! (Version: 2021.10-devel-282-g0caae-pr_suit_override_manifest_payloads)
RIOT SUIT update example application
suit_coap: started.
Starting the shell
> suit: received URL: "coap://[2001:db8::1]/fw/native/suit_update-riot.suit_signed.latest.bin"
suit_coap: trigger received
suit_coap: downloading "coap://[2001:db8::1]/fw/native/suit_update-riot.suit_signed.latest.bin"
suit_coap: got manifest with size 305
suit: verifying manifest signature
suit: validated manifest version
)Retrieved sequence number: 0
Manifest seq_no: 1629729120, highest available: 0
suit: validated sequence number
)Formatted component name: .ram.0
validating vendor ID
Comparing 547d0d74-6d3a-5a92-9662-4881afd9407b to 547d0d74-6d3a-5a92-9662-4881afd9407b from manifest
validating vendor ID: OK
validating class id
Comparing bcc90984-fe7d-562b-b4c9-a24f26a3a9cd to bcc90984-fe7d-562b-b4c9-a24f26a3a9cd from manifest
validating class id: OK
SUIT policy check OK.
Formatted component name: .ram.0
Fetching firmware |█████████████████████████| 100%
Finalizing payload store
Verifying image digest
Starting digest verification against image
Install correct payload
Verifying image digest
Starting digest verification against image
Install correct payload

### Issues/PRs references

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * makefiles: allow to override suit manifest payloads

-- File Changes --

    M Makefile.include (5)
    M makefiles/boot/riotboot.mk (5)
    M makefiles/suit.inc.mk (14)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210823/2eb9e824/attachment-0001.htm>

More information about the notifications mailing list