Skip to content

Commit 0e1320f

Browse files
committed
Update Makefile
1 parent 5cfb98a commit 0e1320f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,15 @@ OpenTR6260: prebuild_OpenTR6260
585585
echo "Generating TR6260 OTA diff (platforms/TR6260/current.bin -> OpenTR6260_$(APP_VERSION).bin)"; \
586586
chmod +x sdk/OpenTR6260/tool/ota_tool || true; \
587587
sdk/OpenTR6260/tool/ota_tool diff sdk/OpenTR6260/new_partition_0x6000.bin platforms/TR6260/current.bin output/$(APP_VERSION)/OpenTR6260_$(APP_VERSION).bin output/$(APP_VERSION)/OpenTR6260_$(APP_VERSION)_ota.img || echo "WARNING: TR6260 ota_tool failed; OpenTR6260_$(APP_VERSION)_ota.img was not generated"; \
588+
OTA_IMG=output/$(APP_VERSION)/OpenTR6260_$(APP_VERSION)_ota.img; \
589+
if [ -f "$$OTA_IMG" ]; then \
590+
echo "Patching TR6260 OTA header: patch_version @0x07 -> 0x01 (bootloader compat)"; \
591+
if command -v dd >/dev/null 2>&1; then \
592+
printf '\001' | dd of="$$OTA_IMG" bs=1 seek=7 count=1 conv=notrunc 2>/dev/null || true; \
593+
else \
594+
python3 -c "import sys; p=sys.argv[1]; f=open(p, 'r+b'); f.seek(7); f.write(b'\\x01'); f.close()" "$$OTA_IMG" || true; \
595+
fi; \
596+
fi; \
588597
else \
589598
echo "No TR6260 OTA baseline (platforms/TR6260/current.bin) or missing sdk/OpenTR6260/tool/ota_tool; skipping TR6260 OTA diff generation"; \
590599
fi

0 commit comments

Comments
 (0)