File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1+ import sys
2+ from fx2 .format import input_data , output_data
3+
4+
5+ def normalize (input ):
6+ output = []
7+ for (addr , chunk ) in sorted (input ):
8+ if output and output [- 1 ][0 ] + len (output [- 1 ][1 ]) == addr :
9+ output [- 1 ] = (output [- 1 ][0 ], output [- 1 ][1 ] + chunk )
10+ else :
11+ output .append ((addr , chunk ))
12+ return output
13+
14+
15+ with open (sys .argv [1 ], "rb" ) as f :
16+ data = input_data (f )
17+ data = normalize (data )
18+ with open (sys .argv [2 ], "wb" ) as f :
19+ output_data (f , data )
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ set -ex
2323
2424# Install dependencies.
2525apt-get update -qq
26- apt-get install -qq --no-install-recommends git make sdcc
26+ apt-get install -qq --no-install-recommends git make sdcc python3 python3-usb1
2727
2828# Any commands that create new files in the host mount must be invoked with the caller UID/GID, or
2929# else the created files will be owned by root. We can't use `docker run --user` because then
@@ -47,7 +47,10 @@ make -C firmware clean
4747make -C vendor/libfx2/firmware/library all MODELS=medium
4848make -C firmware all
4949
50- # Deploy the artifact.
51- cp firmware/glasgow.ihex software/glasgow/hardware/firmware.ihex
50+ # Deploy the artifact. For incomprehensible (literally; I could not figure out why) reasons,
51+ # the Debian and NixOS builds of exact same commit of sdcc produce different .ihex files that
52+ # nevertheless translate to the same binary contents.
53+ PYTHONPATH=vendor/libfx2/software python3 firmware/normalize.py \
54+ firmware/glasgow.ihex software/glasgow/hardware/firmware.ihex
5255
5356END
You can’t perform that action at this time.
0 commit comments