This adds support for converting files with holes to "don't care"
chunks. This can result in a substantial reduction in the time it takes
to program an image if it has many holes.
Generally, constants compared to argc have been reduced by one, since we
no longer have the program name as the first argument.
Change-Id: I00750edc07d6415dcc07ae0351e9397b0222b7ba
This adds support for filesystem-level sparse files. These files have
holes which are not stored in the filesystem and when read are full of
zeros. While these zeros may be significant in some types of files,
other types of files may not care about the contents of holes. For
example, most filesystem creation tools write to all the blocks they
care about. Those blocks not written to will remain holes, and can be
safely represented by "don't care" chunks. Using "don't care" chunks
instead of fill chunks can result in a substantial reduction of the time
it takes to program a sparse image.
To accomplish this, we extend the existing "sparse" boolean parameter to
be an enum of mode types. This enum represents the strategy we take when
reading in a file. For the most part the implementation is
straightforward. We use lseek to determine where the holes in the file
are, and then use do_sparse_file_read_normal to create chunks for the
data section. Note that every file has an implicit hole at its end.
Change-Id: I0cfbf08886fca9a91cb753ec8734c84fcbe52c9f