Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 1 | inherit image_types |
| 2 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 3 | # 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. |
| 8 | SPARSE_BLOCK_SIZE ??= "4096" |
| 9 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 10 | CONVERSIONTYPES += "sparse" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 11 | CONVERSION_CMD:sparse() { |
| 12 | INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" |
| 13 | truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT" |
| 14 | img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE} |
| 15 | } |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 16 | CONVERSION_DEPENDS_sparse = "android-tools-native" |