mtd: fix Seama format after replacing EOF with sysupgrade data
authorRafał Miłecki <zajec5@gmail.com>
Wed, 10 Feb 2016 11:35:50 +0000 (11:35 +0000)
committerRafał Miłecki <zajec5@gmail.com>
Wed, 10 Feb 2016 11:35:50 +0000 (11:35 +0000)
Seama header has MD5 similarly to TRX and its CRC32. We need to update
it after replacing anything in Seama entity content to make bootloader
accept it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 48688

package/system/mtd/src/mtd.c

index 03ee5671d5d4c32575ba13987c8ca94159460022..eda001e1d8516313782bd317a6ab01d92b953b02 100644 (file)
@@ -659,8 +659,19 @@ resume:
                offset = 0;
        }
 
-       if (jffs2_replaced && trx_fixup) {
-               trx_fixup(fd, mtd);
+       if (jffs2_replaced) {
+               switch (imageformat) {
+               case MTD_IMAGE_FORMAT_TRX:
+                       if (trx_fixup)
+                               trx_fixup(fd, mtd);
+                       break;
+               case MTD_IMAGE_FORMAT_SEAMA:
+                       if (mtd_fixseama)
+                               mtd_fixseama(mtd, 0);
+                       break;
+               default:
+                       break;
+               }
        }
 
        if (!quiet)