Skip to content

Commit a662e21

Browse files
committed
releases/build.sh: Enforce amd64, use .containerversion
Currently it is not posisble to reproducibly build the firmware due to the toolchains we have, therefore we enforce amd64. We have recently added a file called .containerversion with the version of the container that the project should build with. Let's tag the built version in release/build.sh with that as well to make it easier work with.
1 parent 2e38134 commit a662e21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

releases/build.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ fi
3535

3636

3737
# Build the Docker image (this can take a while):
38-
docker build --pull --force-rm --no-cache -t bitbox02-firmware .
38+
# The firmware is only reproducible with the same host compiler. For now we force linux/amd64.
39+
# The file .containerversion does not exist in older versions of the project.
40+
containerversion=$(2>/dev/null cat .containerversion || echo "latest")
41+
docker build --pull --platform linux/amd64 --force-rm --no-cache -t bitbox02-firmware:${containerversion} .
3942

4043
# Revert the above local patch to the Dockerfile again to have a clean state.
4144
git checkout -- Dockerfile
@@ -47,7 +50,7 @@ git checkout -- Dockerfile
4750
#
4851
# The safe.directory config is so that git commands work. even though the repo folder mounted in
4952
# Docker is owned by root, which can be different from the owner on the host.
50-
docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware bash -c "git config --global --add safe.directory /bb02 && cd /bb02 && $2"
53+
docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware:${containerversion} bash -c "git config --global --add safe.directory /bb02 && cd /bb02 && $2"
5154

5255
echo "firmware.bin created at:"
5356
echo `pwd`/build/bin/firmware.bin

0 commit comments

Comments
 (0)