Dont replace holes in sparse files with non-0 bytes when creating flash

images

Signed-off-by: Hudson Ayers <hudson.ayers@getcruise.com>
This commit is contained in:
Hudson Ayers 2023-09-05 09:42:21 -07:00
parent fcf9480cbf
commit 89efde17b0

2
util.c
View File

@ -585,7 +585,7 @@ int insert_image(struct image *image, struct image *sub,
* have an extent that starts beyond size.
*/
len = min(len, size);
ret = write_bytes(fd, len, offset, byte);
ret = write_bytes(fd, len, offset, 0); // Assumes 'holes' are always 0 bytes
if (ret) {
image_error(image, "writing %zu bytes failed: %s\n", len, strerror(-ret));
goto out;