ccollins476ad opened a new pull request #8: mfg split: Don't discard trailing 
0xff bytes
URL: https://github.com/apache/mynewt-imgmod/pull/8
 
 
   The `mfg split` command separates an mfgimg binary into several files, one 
for each flash area.
   
   Prior to this commit, imgmod would strip all trailing erase-val bytes (0xff) 
from each file.  Usually this was the correct behavior, but if the contents of 
a flash area legitimately ended with an erase-val byte, then the file would be 
corrupted during this step.
   
   The problem is that `newt` was throwing away information when it created 
mfgimages.  It embedded the specified binaries into a single mfgimage and 
filled in the gaps with erase-val bytes, and it did this without leaving any 
indication of the sizes of the binaries used as input.
   
   Newt was recently changed to include the sizes of these binaries in the 
`manifest.json` file that accompanies an mfgimage.  This commit changes imgmod 
to read these sizes from the manifest file so that it knows how many erase-val 
bytes it can safely strip.
   
   If the manifest does not contain size information (backwards compatibility), 
imgmod falls back to the old behavior or stripping all trailing erase-val bytes.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to