Files
firmware/bin/build-esp32.sh

42 lines
1.0 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -e
2023-01-21 16:17:08 +01:00
VERSION=`bin/buildinfo.py long`
SHORT_VERSION=`bin/buildinfo.py short`
2025-12-08 18:21:23 -05:00
BUILDDIR=.pio/build/$1
OUTDIR=release
rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg install -e $1
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
2025-12-08 18:21:23 -05:00
rm -f $BUILDDIR/firmware*
# The shell vars the build tool expects to find
export APP_VERSION=$VERSION
basename=firmware-$1-$VERSION
pio run --environment $1 -t mtjson # -v
2025-12-08 18:21:23 -05:00
cp $BUILDDIR/$basename.elf $OUTDIR/$basename.elf
echo "Copying ESP32 bin file"
2025-12-08 18:21:23 -05:00
cp $BUILDDIR/$basename.factory.bin $OUTDIR/$basename.factory.bin
echo "Copying ESP32 update bin file"
2025-12-08 18:21:23 -05:00
cp $BUILDDIR/$basename.bin $OUTDIR/$basename.bin
echo "Copying Filesystem for ESP32 targets"
2025-12-08 18:21:23 -05:00
cp $BUILDDIR/littlefs-$1-$VERSION.bin $OUTDIR/littlefs-$1-$VERSION.bin
cp bin/device-install.* $OUTDIR/
cp bin/device-update.* $OUTDIR/
echo "Copying manifest"
2025-12-08 18:21:23 -05:00
cp $BUILDDIR/$basename.mt.json $OUTDIR/$basename.mt.json