pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
308 stars 110 forks source link

Regression in PR #102 #104

Closed TobleMiner closed 4 years ago

TobleMiner commented 4 years ago

PR #102 causes a regression in image-flash.c

Problem is that pad_file behaves differently depending on whether it is called with infile == NULL or infile != NULL.

If called with infile == NULL size is assumed to be an absolute offset in the output file. Else size is assumed to be the size of infile + padding.

Since https://github.com/pengutronix/genimage/pull/102/files#diff-088cb03e9ae7e9e2f4755d4ccf535699L63 handles those cases the same, output images are no longer created correctly.

Unfortunately I did not discover this during testing because none of my testcases had an empty partition that was preceded by another partition.

103 contains a suggestion on how to fix the regression