From: Rafał Miłecki Date: Wed, 10 Feb 2016 11:35:50 +0000 (+0000) Subject: mtd: fix Seama format after replacing EOF with sysupgrade data X-Git-Tag: reboot~458 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=commitdiff_plain;h=358ae42152224bd9c0379ee56b793aebd2555369 mtd: fix Seama format after replacing EOF with sysupgrade data 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 SVN-Revision: 48688 --- diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c index 03ee5671d5..eda001e1d8 100644 --- a/package/system/mtd/src/mtd.c +++ b/package/system/mtd/src/mtd.c @@ -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)