Skip to content

Commit 39343fd

Browse files
committed
Merge remote-tracking branch 'benma/build-fixes'
2 parents eef2092 + e648e9f commit 39343fd

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

releases/build.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,24 @@ git clone --depth 1 --branch $1 --recurse-submodules https://github.com/digitalb
1111

1212
cd temp;
1313

14+
# The shallow clone above doesn't fetch tags. Even if only building the firmware, the CMakeLists.txt
15+
# fetches the bootloader version using `./scripts/get_version bootloader`, which requires a
16+
# bootloader tag. The build scripts can be changed to only use the firmware tag that is needed,
17+
# ignoring the others, but we fetch the tags here so that builds of previous releases continue to
18+
# work.
19+
git fetch --tags;
20+
1421
# Build the Docker image (this can take a while):
1522
docker build --pull --force-rm --no-cache -t bitbox02-firmware .
1623

17-
# Build the firmware. The inlined python package install can be
18-
# removed after v4.1.0, but is necessary for v4.1.0 as it is missing
19-
# in the Dockerfile of that release. The safe.directory config is so
20-
# that git commands work. even though the repo folder mounted in
21-
# Docker is owned by root, which can be different from the owner on
22-
# the host.
23-
docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware bash -c "apt-get update && apt-get install -y python && git config --global --add safe.directory /bb02 && cd /bb02 && $2"
24+
# Build the firmware.
25+
#
26+
# For firmware versions v4.1.0 and older, you'll need to manually install `python` inside the Docker
27+
# container, as it is missing in the Dockerfile of that release.
28+
#
29+
# The safe.directory config is so that git commands work. even though the repo folder mounted in
30+
# Docker is owned by root, which can be different from the owner on the host.
31+
docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware bash -c "git config --global --add safe.directory /bb02 && cd /bb02 && $2"
2432

2533
echo "firmware.bin created at:"
2634
echo `pwd`/build/bin/firmware.bin

0 commit comments

Comments
 (0)