flash-sync: update only DTBs the image already ships

The per-image DTB set is curated by config.xml (the clone image carries
boards the original image deliberately leaves out), so the sync must
never add files to /flash/dtbs, only refresh the ones present. Caught
on the first hardware run: a clean sync on the original image added
three clone-only DTBs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Douglas Teles
2026-07-07 20:59:57 -03:00
parent 6faa39c570
commit 8b0f09c43e
@@ -97,6 +97,11 @@ fi
if [ -d "${SRC}/device_trees" ] && [ -d "${BOOT}/dtbs" ]; then
for dtb in "${SRC}/device_trees/"*.dtb; do
[ -f "${dtb}" ] || continue
# Update only DTBs the image already ships: config.xml curates the
# per-image DTB list (the clone image carries boards the original
# image deliberately leaves out), so adding files here would undo
# that curation. Content never diverges for same-named DTBs.
[ -f "${BOOT}/dtbs/$(basename "${dtb}")" ] || continue
sync_file "${dtb}" "${BOOT}/dtbs/$(basename "${dtb}")"
done
fi