From 766dff74457d9788a96ae9c8a3607c8e5c4081e2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 2 Sep 2014 17:13:42 +0000 Subject: [PATCH] mtd: Fix trx check after partition rename ("linux" to "firmware") MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On brcm47xx (Huawei E970), I noticed that sysupgrade now tries to flash trx images which don't fit into the flash, resulting in non-booting system. I found that mtd does trx size checking only when flashing to a partition called "linux". This patch changes this to be "firmware". This matches the following patch which changed partition name in bcm47xxpart.c driver to "firmware": commit 86b4d5ef68ca77ff6724ebb9bddd6b93239c87fc Author: hauke Date: Sun Dec 1 16:32:32 2013 +0000 brcm47xx: use "firmware" partition name ... Signed-off-by: Rafał Miłecki SVN-Revision: 38973 Signed-off-by: Mathias Adam SVN-Revision: 42403 --- package/system/mtd/src/trx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/mtd/src/trx.c b/package/system/mtd/src/trx.c index 65c24404c2..86d62fc19e 100644 --- a/package/system/mtd/src/trx.c +++ b/package/system/mtd/src/trx.c @@ -107,7 +107,7 @@ trx_check(int imagefd, const char *mtd, char *buf, int *len) const struct trx_header *trx = (const struct trx_header *) buf; int fd; - if (strcmp(mtd, "linux") != 0) + if (strcmp(mtd, "firmware") != 0) return 1; *len = read(imagefd, buf, 32); -- 2.30.2