[OpenWrt-Devel] [PATCH] mtd: fix Seama format after replacing EOF with sysupgrade data

Rafał Miłecki zajec5 at gmail.com
Mon Feb 8 07:36:27 EST 2016


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 at gmail.com>
---
 package/system/mtd/src/mtd.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c
index 03ee567..eda001e 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)
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list