Change in simtrace2[master]: firmware: create duplicate files for upload only

osmith gerrit-no-reply at
Fri Mar 5 15:17:17 UTC 2021

osmith has uploaded this change for review. ( )

Change subject: firmware: create duplicate files for upload only

firmware: create duplicate files for upload only

Don't create copies of firmware files with version strings appended in
the normal build. Only do this before uploading the firmware files.

I have verified that "make" before this change and
"make; contrib/" after produce the same files.

Close: OS#4413
Change-Id: I118a4ff397a178281c26a6b98112fa66b6f049ab
M contrib/
A contrib/
M firmware/Makefile
3 files changed, 15 insertions(+), 4 deletions(-)

  git pull ssh:// refs/changes/55/23255/1

diff --git a/contrib/ b/contrib/
index 7ddfa6e..2ad7a7f 100755
--- a/contrib/
+++ b/contrib/
@@ -68,6 +68,7 @@
 if [ "x$publish" = "x--publish" ]; then
 	echo "=============== UPLOAD BUILD  =============="
+	contrib/
 	cat > "/build/known_hosts" <<EOF
 []:48 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
diff --git a/contrib/ b/contrib/
new file mode 100755
index 0000000..8242fd4
--- /dev/null
+++ b/contrib/
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+# Create copies of binaries with -latest, -$GIT_VERSION (OS#4413, OS#3452)
+GIT_VERSION="$(./git-version-gen .tarball-version)"
+echo "Copying binaries with "-latest" and "-$GIT_VERSION" appended..."
+cd firmware/bin
+for ext in bin elf; do
+	for file in *."$ext"; do
+		without_ext="${file%.*}"
+		cp -v "$file" "$without_ext-latest.$ext"
+		cp -v "$file" "$without_ext-$GIT_VERSION.$ext"
+	done
diff --git a/firmware/Makefile b/firmware/Makefile
index d7c64b9..ccf5843 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -211,12 +211,8 @@
 $(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
 	@$(CC) $(LDFLAGS) $(LD_OPTIONAL) -T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$ -o $(OUTPUT)-$$@.elf $$^ $(LIBS)
-	cp $(OUTPUT)-$$@.elf $(OUTPUT)-$$@-$(GIT_VERSION).elf
-	cp $(OUTPUT)-$$@.elf $(OUTPUT)-$$@-latest.elf
 	@$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt
 	@$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
-	cp $(OUTPUT)-$$@.bin $(OUTPUT)-$$@-$(GIT_VERSION).bin
-	cp $(OUTPUT)-$$@.bin $(OUTPUT)-$$@-latest.bin
 	@$(SIZE) $$^ $(OUTPUT)-$$@.elf
 $$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I118a4ff397a178281c26a6b98112fa66b6f049ab
Gerrit-Change-Number: 23255
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list