From bceb091084acec9738ab3a7892481244f8d3ec93 Mon Sep 17 00:00:00 2001 From: ju6ge Date: Sun, 10 May 2026 14:27:11 +0200 Subject: [PATCH] build: add image_build.sh and erase_ota.sh scripts --- rust/erase_ota.sh | 7 +++++++ rust/image_build.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 rust/erase_ota.sh create mode 100755 rust/image_build.sh diff --git a/rust/erase_ota.sh b/rust/erase_ota.sh new file mode 100755 index 0000000..079ce36 --- /dev/null +++ b/rust/erase_ota.sh @@ -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" diff --git a/rust/image_build.sh b/rust/image_build.sh new file mode 100755 index 0000000..d4e0175 --- /dev/null +++ b/rust/image_build.sh @@ -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"