Skip to content
Snippets Groups Projects
Commit 4a4c324c authored by John Crispin's avatar John Crispin
Browse files

mtd: fix reading of image magic bytes in smaller chunks


The image_check currently fails when it cannot read all magic bytes in a
single chunk. But this can happen when the data are read from a pipe. This
currently breaks the openmesh.sh upgrade script with musl because it uses
dd with a blocksize of 1 to copy the image file to the mtd process.

The read can simply be repeated until enough bytes are read for the magic
byte check. It only stops when either an error was returned or 0 bytes were
read.

Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@open-mesh.com>

SVN-Revision: 48891
parent 8fb8b78b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment