Commit Graph

6 Commits

Author SHA1 Message Date
Michael Olbrich
650d9bb963 image-android-sparse: initialize chunk_header
It contains a reserved field that remains uninitialized otherwise and is
written to the output file.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-06-27 10:49:17 +02:00
Michael Olbrich
0ef795f3a6 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>
2023-10-11 08:53:58 +02:00
Wojciech Nizinski
4a200b2267 image-android-sparse: Fix #224: truncated image generated
When source image file ends with empty (sparse) area, this area is
skipped and incomplete sparse file is generated.

Signed-off-by: Wojciech Nizinski <wojciech.nizinski@grinn-global.com>
2023-10-11 08:53:58 +02:00
Michael Olbrich
cfd0426a62 make rootpath optional
When none of the images need files from the rootpath, then make it
optional. Some types never need it. For others the image must be explicitly
marked as empty.

Fixes: #181

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2022-03-25 16:43:36 +01:00
Bastian Krause
89490b9b7c image-android-sparse: use off_t instead of int for lseek return values
On a 64 bit system off_t can hold signed, 64 bit integers. Putting large
off_t values in a 32 bit int results in overflows. These overflows
trigger the "< 0" check and result in errors. This can be observed on
large input images.

lseek() returns an off_t, so introduce an off_t to store its return
value appropriately.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
2021-06-15 13:06:22 +02:00
Michael Olbrich
84c04645a9 add new image type for android sparse images
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2021-01-13 09:02:51 +01:00