[openwrt/openwrt] generic: mtdsplit: fit: improve detecting external-data FIT

LEDE Commits lede-commits at lists.infradead.org
Wed Nov 5 06:23:02 PST 2025


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a3b2a2e15d5e5a296f5bc7c5549b11bba46e10ea

commit a3b2a2e15d5e5a296f5bc7c5549b11bba46e10ea
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Oct 5 00:34:42 2025 +0100

    generic: mtdsplit: fit: improve detecting external-data FIT
    
    Currently the detection of external-data FIT images works by checking
    if the FIT structure is more than 4 kiB. However, for boards with lots
    of different DT-overlays and configurations the FIT structure can
    exceed 4 kiB which results in the FIT splitter to fail detecting the
    rootfs.
    Increase the threshold for external-data FIT to 512 kiB as there aren't
    any kernel images smaller than that, and FIT structure less than 512 kiB
    will always be an external-data FIT.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
index a271a676e1..29d26f4057 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
@@ -258,7 +258,7 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
 	 * hence we need to parse FDT structure to find the end of the
 	 * last external data refernced.
 	 */
-	if (fit_size > 0x1000) {
+	if (fit_size > 0x80000) {
 		enum mtdsplit_part_type type;
 
 		/* Search for the rootfs partition after the FIT image */




More information about the lede-commits mailing list