From 1a57ce0c03b8c33a69c3a87d537d1a61a666f046 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Tue, 23 Feb 2016 14:40:40 +0000
Subject: [PATCH] kernel: mtdsplit: add missing digest field to Seama header
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Seama format has 2 similar headers: container (seal) header and entity
header. The first one has size always set to 0 and doesn't contain MD5
digest.

When dealing with Seama on a flash we deal directly with an entity. You
can see mtdsplit_parse_seama reads from offset 0 and expects entity to
be there. Seama container is used by bootloader / interface only which
extract entity out of it and flash it.

That said we should fix our header struct. This is important as we
calculate possible rootfs offset assuming it may be placed right after
Seama entity. So far calculate offset was always 16B too low.

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

SVN-Revision: 48754
---
 target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
index f8ddee7ce0..ee0444a43e 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
@@ -26,6 +26,7 @@ struct seama_header {
 	__be16	reserved;	/* reserved for  */
 	__be16	metasize;	/* size of the META data */
 	__be32	size;		/* size of the image */
+	u8	md5[16];	/* digest */
 };
 
 static int mtdsplit_parse_seama(struct mtd_info *master,
-- 
2.30.2