blob: d6ea68968e99cd6a6577b75f26f7802a622796c9 [file] [log] [blame]
Andrew Geissler32b11992021-03-31 13:37:05 -05001inherit image_types
2
Patrick Williams92b42cb2022-09-03 06:53:57 -05003# This sets the granularity of the sparse image conversion. Chunk sizes will be
4# specified in units of this value. Setting this value smaller than the
5# underlying image's block size will not result in any further space saving.
6# However, there is no loss in correctness if this value is larger or smaller
7# than optimal. This value should be a power of two.
8SPARSE_BLOCK_SIZE ??= "4096"
9
Andrew Geissler32b11992021-03-31 13:37:05 -050010CONVERSIONTYPES += "sparse"
Patrick Williams2a254922023-08-11 09:48:11 -050011
12CONVERSION_CMD:sparse = " \
13 truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "${IMAGE_NAME}.${type}"; \
14 img2simg -s "${IMAGE_NAME}.${type}" "${IMAGE_NAME}.${type}.sparse" ${SPARSE_BLOCK_SIZE}; \
15 "
16
Andrew Geissler32b11992021-03-31 13:37:05 -050017CONVERSION_DEPENDS_sparse = "android-tools-native"