From 118e099fc5e1457ad1136114f9c8904c1a7fbbf4 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Thu, 20 Feb 2025 16:24:57 +0100 Subject: [PATCH] refactor: simplify Gitea release workflow by using esptool for binary creation --- .github/workflows/providers/gitea-release.yml | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/providers/gitea-release.yml b/.github/workflows/providers/gitea-release.yml index 50bd715..d7c42f8 100644 --- a/.github/workflows/providers/gitea-release.yml +++ b/.github/workflows/providers/gitea-release.yml @@ -44,34 +44,27 @@ jobs: # Create OTA binary (firmware only) cp firmware.bin filaman_ota.bin - # Create basic flash layout - echo "Creating initial 4MB flash image..." - dd if=/dev/zero bs=1M count=4 of=flash_4mb.bin + # Use esptool to create the full binary + esptool.py --chip esp32 merge_bin \ + --flash_mode dio \ + --flash_freq 40m \ + --flash_size 4MB \ + --target-offset 0x0 \ + -o filaman_full.bin \ + 0x1000 bootloader.bin \ + 0x8000 partitions.bin \ + 0x10000 firmware.bin \ + 0x3D0000 spiffs.bin - # Create partition layout - echo "Writing bootloader..." - dd if=bootloader.bin of=flash_4mb.bin bs=1 seek=$((0x1000)) conv=notrunc - - echo "Writing partitions..." - dd if=partitions.bin of=flash_4mb.bin bs=1 seek=$((0x8000)) conv=notrunc - - echo "Writing firmware..." - dd if=firmware.bin of=flash_4mb.bin bs=1 seek=$((0x10000)) conv=notrunc - - echo "Writing SPIFFS..." - dd if=spiffs.bin of=flash_4mb.bin bs=1 seek=$((0x3D0000)) conv=notrunc - - # Rename to final name - cp flash_4mb.bin filaman_full.bin - - # Verify file sizes and content + # Verify binaries echo "File sizes:" ls -lh *.bin echo "Binary information:" + echo "OTA binary info:" esptool.py --chip esp32 image_info filaman_ota.bin || true - echo "Full binary info:" - xxd -l 64 filaman_full.bin + echo "Full binary first 64 bytes:" + od -A x -t x1z -N 64 filaman_full.bin - name: Create Release env: