Skip to content

Commit 3f796b6

Browse files
committed
tools/autobuild: Make firmware destination directory configurable.
The destination directory for the firmware built by `autobuild.sh` is currently hard-coded to `/tmp/autobuild-firmware-$$`. Now that there are many boards built by this script, the `/tmp` partition can run out of space. This commit makes the destination directory configurable via the `MICROPY_AUTOBUILD_DEST` environment variable. Signed-off-by: Damien George <[email protected]>
1 parent 0b1a6be commit 3f796b6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/autobuild/autobuild.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# - IDF_PATH_V50 must be set
88
# - MICROPY_AUTOBUILD_MICROPYTHON_REPO must be set to location of micropython repository
99
# - MICROPY_AUTOBUILD_MAKE must be set to the make command to use, eg "make -j2"
10+
# - MICROPY_AUTOBUILD_DEST must be set to a directory name to place the output firmware
11+
# (this directory will be created, and removed at the end if firmware is copied to a
12+
# remote machine using MICROPY_AUTOBUILD_REMOTE_MACHINE and MICROPY_AUTOBUILD_REMOTE_DIR)
1013
#
1114
# Optional settings:
1215
# - MICROPY_AUTOBUILD_REMOTE_MACHINE can be set to a remote ssh machine to copy files to
@@ -27,6 +30,11 @@ if [ -z "$MICROPY_AUTOBUILD_MAKE" ]; then
2730
exit 1
2831
fi
2932

33+
if [ -z "$MICROPY_AUTOBUILD_DEST" ]; then
34+
echo "must set MICROPY_AUTOBUILD_DEST"
35+
exit 1
36+
fi
37+
3038
########################################
3139
# Initialisation
3240

@@ -37,7 +45,7 @@ AUTODIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
3745
source ${AUTODIR}/build-boards.sh
3846

3947
# make local directory to put firmware
40-
LOCAL_FIRMWARE=/tmp/autobuild-firmware-$$
48+
LOCAL_FIRMWARE=${MICROPY_AUTOBUILD_DEST}
4149
mkdir -p ${LOCAL_FIRMWARE}
4250

4351
# get latest MicroPython

0 commit comments

Comments
 (0)