From 4546469e7b1afc9ebf0a553672db51b09befa4fc Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 18 Mar 2019 17:05:19 +0100 Subject: [PATCH 1/2] make: riotboot: ensure epoch in APP_VER is evaluated once --- makefiles/boot/riotboot.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefiles/boot/riotboot.mk b/makefiles/boot/riotboot.mk index 89fdd26f7a5d..890e4e7cbdab 100644 --- a/makefiles/boot/riotboot.mk +++ b/makefiles/boot/riotboot.mk @@ -17,7 +17,8 @@ export SLOT0_OFFSET SLOT0_LEN SLOT1_OFFSET SLOT1_LEN ifeq (1, RIOT_CI_BUILD) APP_VER ?= 0 else - APP_VER ?= $(shell date +%s) + EPOCH := $(shell date +%s) + APP_VER ?= $(EPOCH) endif # Final target for slot 0 with riot_hdr From b4557eae16159a3e4769549c793530c54079610e Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 19 Mar 2019 13:58:59 +0100 Subject: [PATCH 2/2] make: riotboot: add $APP_VER to image file names --- makefiles/boot/riotboot.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefiles/boot/riotboot.mk b/makefiles/boot/riotboot.mk index 890e4e7cbdab..6edabe9f2420 100644 --- a/makefiles/boot/riotboot.mk +++ b/makefiles/boot/riotboot.mk @@ -22,8 +22,8 @@ else endif # Final target for slot 0 with riot_hdr -SLOT0_RIOT_BIN = $(BINDIR_APP)-slot0.riot.bin -SLOT1_RIOT_BIN = $(BINDIR_APP)-slot1.riot.bin +SLOT0_RIOT_BIN = $(BINDIR_APP)-slot0.$(APP_VER).riot.bin +SLOT1_RIOT_BIN = $(BINDIR_APP)-slot1.$(APP_VER).riot.bin SLOT_RIOT_BINS = $(SLOT0_RIOT_BIN) $(SLOT1_RIOT_BIN) # if RIOTBOOT_SKIP_COMPILE is set to 1, "make riotboot/slot[01](-flash)" @@ -54,7 +54,7 @@ link: $(SLOT_RIOT_ELFS) endif # Create binary target with RIOT header -$(SLOT_RIOT_BINS): %.riot.bin: %.hdr %.bin +$(SLOT_RIOT_BINS): %.$(APP_VER).riot.bin: %.hdr %.bin @echo "creating $@..." $(Q)cat $^ > $@