Thomas Hebb eaa6442e4f mkimage: clarify error message for empty input files
Currently, an empty imput file causes `mmap()` to fail, and you get an
error like "mkimage: Can't read file.img: Invalid argument", which is
extremely unintuitive and hard to diagnose if you don't know what to
look for. Add an explicit check for an empty file and provide a clear
error message instead.

We already bounds check the image size when listing and re-signing
existing images, so we only need this check here, when opening data
files going into a image.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-09-01 19:25:37 -04:00
..
2021-08-04 11:30:46 -04:00
2019-12-06 16:44:20 -05:00
2019-07-29 00:20:31 +02:00
2021-01-13 02:38:00 +01:00
2019-11-04 18:15:32 -07:00