Project_SylDa/tools/copy_firmware.sh

22 lines
No EOL
649 B
Shell
Executable file

#!/bin/bash
set -e
BINARY_DIR="$(cd "$(dirname "$0")/.." && pwd)/.pio/build/s3lite-server"
ASSETS_DIR="$(cd "$(dirname "$0")/.." && pwd)/android/app/src/main/assets/firmware"
mkdir -p "$ASSETS_DIR"
cp "$BINARY_DIR/bootloader.bin" "$ASSETS_DIR/"
cp "$BINARY_DIR/partitions.bin" "$ASSETS_DIR/"
cp "$BINARY_DIR/firmware.bin" "$ASSETS_DIR/"
BOOT_APP0=$(find ~/.platformio/packages/framework-arduinoespressif32 -name "boot_app0.bin" 2>/dev/null | head -1)
if [ -n "$BOOT_APP0" ]; then
cp "$BOOT_APP0" "$ASSETS_DIR/"
else
echo "ERROR: boot_app0.bin not found"
exit 1
fi
echo "Firmware binaries copied to $ASSETS_DIR:"
ls -la "$ASSETS_DIR"