build: add image_build.sh and erase_ota.sh scripts

This commit is contained in:
2026-05-10 14:39:22 +02:00
parent cfe1c2c6d8
commit ae73f12d1c
2 changed files with 24 additions and 0 deletions

7
rust/erase_ota.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cargo espflash erase-parts otadata --partition-table "${SCRIPT_DIR}/partitions.csv"

17
rust/image_build.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
rm -f "${SCRIPT_DIR}/image.bin"
"${SCRIPT_DIR}/build_website.sh"
cargo build --release
espflash save-image \
--bootloader "${SCRIPT_DIR}/bootloader.bin" \
--partition-table "${SCRIPT_DIR}/partitions.csv" \
--chip esp32c6 \
target/riscv32imac-unknown-none-elf/release/plant-ctrl2 \
"${SCRIPT_DIR}/image.bin"