mirror of
https://github.com/pengutronix/genimage.git
synced 2024-11-23 09:43:50 +08:00
image-android-sparse: handle images with a size that is not a multiple of the block-size
Round up instead of down, otherwise an don't care block is appended. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
4a200b2267
commit
0ef795f3a6
@ -317,7 +317,7 @@ static int android_sparse_generate(struct image *image)
|
||||
ret = flush_header(image, out_fd, &chunk_header, pos);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
block = extents[extent].end / sparse->block_size;
|
||||
block = (extents[extent].end - 1 + sparse->block_size) / sparse->block_size;
|
||||
}
|
||||
|
||||
if (block < block_count) {
|
||||
|
Loading…
Reference in New Issue
Block a user