Skip to content

Commit

Permalink
releases/build.sh: Enforce amd64, use .containerversion
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NickeZ committed Aug 22, 2024
1 parent f69d989 commit 2c57ea6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions releases/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ fi


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

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

echo "firmware.bin created at:"
echo `pwd`/build/bin/firmware.bin
Expand Down

0 comments on commit 2c57ea6

Please sign in to comment.