image_types_sparse.bbclass 697 B

12345678910111213141516
  1. inherit image_types
  2. # This sets the granularity of the sparse image conversion. Chunk sizes will be
  3. # specified in units of this value. Setting this value smaller than the
  4. # underlying image's block size will not result in any further space saving.
  5. # However, there is no loss in correctness if this value is larger or smaller
  6. # than optimal. This value should be a power of two.
  7. SPARSE_BLOCK_SIZE ??= "4096"
  8. CONVERSIONTYPES += "sparse"
  9. CONVERSION_CMD:sparse() {
  10. INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
  11. truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT"
  12. img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE}
  13. }
  14. CONVERSION_DEPENDS_sparse = "android-tools-native"