Skip to content
Snippets Groups Projects
  • Sven Eckelmann's avatar
    3599ea52
    images: Fix sysupgrade.tar for devices with NOR flash · 3599ea52
    Sven Eckelmann authored
    
    The NOR flash rootfs images stored in a sysupgrade.tar must end with the
    JFFS2 marker. Otherwise, devices like OpenMesh A42/A62 are not able to
    calculate the md5sum of the fixed squashfs part and store it inside the
    u-boot-env.
    
    But the commit ee76bd11 ("images: fix boot failures on NAND with small
    sub pages") adds up to 1020 0x00 bytes after the 0xdead0de EOF marker. The
    calculated md5sum will be wrong due do this change and u-boot will fail to
    boot the newly flashed device with a message like:
    
      Validating MD5Sum of 'vmlinux'...
      Passed!
      Validating MD5Sum of 'rootfs'...
      Failed!
          583a1b7b54b8601efa64ade42742459b != 8850ee812dfd7638e94083329d5d2781
    
      Data validation failed!
    
    and boot the old image again.
    
    Since the original change should not change the behavior of NOR images,
    just check for the deadc0de marker at the end of the squashfs-jffs2 image
    do avoid the problematic behavior for these images.
    
    Fixes: ee76bd11 ("images: fix boot failures on NAND with small sub pages")
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
    3599ea52
    History
    images: Fix sysupgrade.tar for devices with NOR flash
    Sven Eckelmann authored
    
    The NOR flash rootfs images stored in a sysupgrade.tar must end with the
    JFFS2 marker. Otherwise, devices like OpenMesh A42/A62 are not able to
    calculate the md5sum of the fixed squashfs part and store it inside the
    u-boot-env.
    
    But the commit ee76bd11 ("images: fix boot failures on NAND with small
    sub pages") adds up to 1020 0x00 bytes after the 0xdead0de EOF marker. The
    calculated md5sum will be wrong due do this change and u-boot will fail to
    boot the newly flashed device with a message like:
    
      Validating MD5Sum of 'vmlinux'...
      Passed!
      Validating MD5Sum of 'rootfs'...
      Failed!
          583a1b7b54b8601efa64ade42742459b != 8850ee812dfd7638e94083329d5d2781
    
      Data validation failed!
    
    and boot the old image again.
    
    Since the original change should not change the behavior of NOR images,
    just check for the deadc0de marker at the end of the squashfs-jffs2 image
    do avoid the problematic behavior for these images.
    
    Fixes: ee76bd11 ("images: fix boot failures on NAND with small sub pages")
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>