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

osmith gerrit-no-reply at lists.osmocom.org
Mon Mar 8 07:24:12 UTC 2021


osmith has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/23255 )

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/prepare_upload.sh" after produce the same files.

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

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 7ddfa6e..2ad7a7f 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -68,6 +68,7 @@
 if [ "x$publish" = "x--publish" ]; then
 	echo
 	echo "=============== UPLOAD BUILD  =============="
+	contrib/prepare_upload.sh
 
 	cat > "/build/known_hosts" <<EOF
 [rita.osmocom.org]:48 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
diff --git a/contrib/prepare_upload.sh b/contrib/prepare_upload.sh
new file mode 100755
index 0000000..8242fd4
--- /dev/null
+++ b/contrib/prepare_upload.sh
@@ -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
+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)-$$@.map -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 https://gerrit.osmocom.org/c/simtrace2/+/23255
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I118a4ff397a178281c26a6b98112fa66b6f049ab
Gerrit-Change-Number: 23255
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210308/cc1e42d2/attachment.htm>


More information about the gerrit-log mailing list