Skip to content
  • Roman Azarenko's avatar
    tools: ensure zeroed padding in external FIT images · 0cf1a136
    Roman Azarenko authored and Tom Rini's avatar Tom Rini committed
    Padding the header of an external FIT image is achieved by truncating
    the existing temporary FIT file to match the required alignment before
    appending image data. Reusing an existing file this way means that the
    padding will likely contain a portion of the original data not
    overwritten by the new header.
    
    Zero out any data past the end of the new header, and stop at either
    the end of the desired padding, or the end of the old FIT file,
    whichever comes first.
    
    Fixes: 7946a814
    
     ("Revert "mkimage: fit: Do not tail-pad fitImage with external data"")
    Signed-off-by: default avatarRoman Azarenko <roman.azarenko@iopsys.eu>
    Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    0cf1a136