image_types_sparse: backport generate "don't care" chunks

By default, img2simg will only generate raw and fill chunks. This adds
support for "don't care" chunks, based on file holes. This is similar to
how bmaptool works. "don't care" chunks do not need to be written,
speeding up flashing time.
This change corresponds to upstream  9862a017fa

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: AshishKumar Mishra <emailaddress.ashish@gmail.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
Sean Anderson
2025-09-25 22:59:30 +05:30
committed by Gyorgy Sarvari
parent b414502a08
commit 1f2a86393f
5 changed files with 366 additions and 1 deletions
+1 -1
View File
@@ -11,6 +11,6 @@ CONVERSIONTYPES += "sparse"
CONVERSION_CMD:sparse = " \
INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" && \
truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT" && \
img2simg "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE} \
img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE} \
"
CONVERSION_DEPENDS_sparse = "android-tools-native"