-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
makefiles: allow to override suit manifest payloads #16771
Changes from all commits
ce35647
17c6717
ac5c316
993af3d
76ee54e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,43 +4,54 @@ | |
# makefiles/suit.base.inc.mk | ||
# | ||
# | ||
SUIT_COAP_BASEPATH ?= fw/$(BOARD) | ||
|
||
# Mandatory APP_VER, set to epoch by default | ||
EPOCH = $(call memoized,EPOCH,$(shell date +%s)) | ||
APP_VER ?= $(EPOCH) | ||
|
||
SUIT_VENDOR ?= "riot-os.org" | ||
SUIT_SEQNR ?= $(APP_VER) | ||
SUIT_CLASS ?= $(BOARD) | ||
|
||
SUIT_COAP_BASEPATH ?= fw/$(APPLICATION)/$(BOARD) | ||
SUIT_COAP_SERVER ?= localhost | ||
SUIT_COAP_ROOT ?= coap://$(SUIT_COAP_SERVER)/$(SUIT_COAP_BASEPATH) | ||
SUIT_COAP_FSROOT ?= $(RIOTBASE)/coaproot | ||
|
||
BINDIR_SUIT = $(BINDIR)/suit_files | ||
$(BINDIR_SUIT): $(CLEAN) | ||
$(Q)mkdir -p $(BINDIR_SUIT) | ||
|
||
# | ||
SUIT_MANIFEST ?= $(BINDIR_APP)-riot.suit.$(APP_VER).bin | ||
SUIT_MANIFEST_LATEST ?= $(BINDIR_APP)-riot.suit.latest.bin | ||
SUIT_MANIFEST_SIGNED ?= $(BINDIR_APP)-riot.suit_signed.$(APP_VER).bin | ||
SUIT_MANIFEST_SIGNED_LATEST ?= $(BINDIR_APP)-riot.suit_signed.latest.bin | ||
SUIT_MANIFEST_BASENAME ?= riot.suit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getting the application name back in here should fix the overwriting for different applications? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead, I added the application name to |
||
SUIT_MANIFEST ?= $(BINDIR_SUIT)/$(SUIT_MANIFEST_BASENAME)_unsigned.$(SUIT_SEQNR).bin | ||
SUIT_MANIFEST_LATEST ?= $(BINDIR_SUIT)/$(SUIT_MANIFEST_BASENAME)_unsigned.latest.bin | ||
SUIT_MANIFEST_SIGNED ?= $(BINDIR_SUIT)/$(SUIT_MANIFEST_BASENAME).$(SUIT_SEQNR).bin | ||
SUIT_MANIFEST_SIGNED_LATEST ?= $(BINDIR_SUIT)/$(SUIT_MANIFEST_BASENAME).latest.bin | ||
|
||
SUIT_NOTIFY_VERSION ?= latest | ||
SUIT_NOTIFY_MANIFEST ?= $(APPLICATION)-riot.suit_signed.$(SUIT_NOTIFY_VERSION).bin | ||
SUIT_NOTIFY_MANIFEST ?= $(SUIT_MANIFEST_BASENAME).$(SUIT_NOTIFY_VERSION).bin | ||
|
||
# Long manifest names require more buffer space when parsing | ||
export CFLAGS += -DCONFIG_SOCK_URLPATH_MAXLEN=128 | ||
|
||
SUIT_VENDOR ?= "riot-os.org" | ||
SUIT_SEQNR ?= $(APP_VER) | ||
SUIT_CLASS ?= $(BOARD) | ||
SUIT_MANIFEST_PAYLOADS ?= $(SLOT0_RIOT_BIN) $(SLOT1_RIOT_BIN) | ||
SUIT_MANIFEST_SLOTFILES ?= $(SLOT0_RIOT_BIN):$(SLOT0_OFFSET) \ | ||
$(SLOT1_RIOT_BIN):$(SLOT1_OFFSET) | ||
|
||
# | ||
$(SUIT_MANIFEST): $(SLOT0_RIOT_BIN) $(SLOT1_RIOT_BIN) | ||
$(SUIT_MANIFEST): $(SUIT_MANIFEST_PAYLOADS) $(BINDIR_SUIT) | ||
$(Q)$(RIOTBASE)/dist/tools/suit/gen_manifest.py \ | ||
--urlroot $(SUIT_COAP_ROOT) \ | ||
--seqnr $(SUIT_SEQNR) \ | ||
--uuid-vendor $(SUIT_VENDOR) \ | ||
--uuid-class $(SUIT_CLASS) \ | ||
-o [email protected] \ | ||
$(SLOT0_RIOT_BIN):$(SLOT0_OFFSET) \ | ||
$(SLOT1_RIOT_BIN):$(SLOT1_OFFSET) | ||
$(SUIT_MANIFEST_SLOTFILES) | ||
|
||
$(Q)$(SUIT_TOOL) create -f suit -i [email protected] -o $@ | ||
|
||
$(Q)rm -f [email protected] | ||
|
||
|
||
$(SUIT_MANIFEST_SIGNED): $(SUIT_MANIFEST) $(SUIT_SEC) | ||
$(Q)$(SUIT_TOOL) sign -k $(SUIT_SEC) -m $(SUIT_MANIFEST) -o $@ | ||
|
||
|
@@ -50,14 +61,12 @@ $(SUIT_MANIFEST_LATEST): $(SUIT_MANIFEST) | |
$(SUIT_MANIFEST_SIGNED_LATEST): $(SUIT_MANIFEST_SIGNED) | ||
$(Q)ln -f -s $< $@ | ||
|
||
SUIT_MANIFESTS := $(SUIT_MANIFEST) \ | ||
$(SUIT_MANIFEST_LATEST) \ | ||
$(SUIT_MANIFEST_SIGNED) \ | ||
SUIT_MANIFESTS := $(SUIT_MANIFEST_SIGNED) \ | ||
$(SUIT_MANIFEST_SIGNED_LATEST) | ||
|
||
suit/manifest: $(SUIT_MANIFESTS) | ||
|
||
suit/publish: $(SUIT_MANIFESTS) $(SLOT0_RIOT_BIN) $(SLOT1_RIOT_BIN) | ||
suit/publish: $(SUIT_MANIFESTS) $(SUIT_MANIFEST_PAYLOADS) | ||
$(Q)mkdir -p $(SUIT_COAP_FSROOT)/$(SUIT_COAP_BASEPATH) | ||
$(Q)cp $^ $(SUIT_COAP_FSROOT)/$(SUIT_COAP_BASEPATH) | ||
$(Q)for file in $^; do \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reasoning behind that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoiding a shell call if not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can split
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine, I was just not familiar with
call memoized