diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-03-10 17:32:20 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-10-10 14:32:28 +0200 |
commit | fb31038e1fbc959465947beb946534f9edc2c556 (patch) | |
tree | e75506a6cb32972b8b78a1e7e75fb320212c3015 /target/linux/generic/files/drivers | |
parent | 329b1543f3902885488c85ce3c679b0028992b47 (diff) | |
download | upstream-fb31038e1fbc959465947beb946534f9edc2c556.tar.gz upstream-fb31038e1fbc959465947beb946534f9edc2c556.tar.bz2 upstream-fb31038e1fbc959465947beb946534f9edc2c556.zip |
kernel: mtdsplit: support UBI after FIT images
Change the partition name accordingly. Same behavior as mtdsplit_uimage
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 62fd9f97090d05637a283d594f2d02958fd36a80)
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r-- | target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 3230d859b0..d8fb74ea38 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c @@ -256,9 +256,11 @@ mtdsplit_fit_parse(struct mtd_info *mtd, * last external data refernced. */ if (fit_size > 0x1000) { + enum mtdsplit_part_type type; + /* Search for the rootfs partition after the FIT image */ ret = mtd_find_rootfs_from(mtd, fit_offset + fit_size, mtd->size, - &rootfs_offset, NULL); + &rootfs_offset, &type); if (ret) { pr_info("no rootfs found after FIT image in \"%s\"\n", mtd->name); @@ -275,7 +277,10 @@ mtdsplit_fit_parse(struct mtd_info *mtd, parts[0].offset = fit_offset; parts[0].size = mtd_rounddown_to_eb(fit_size, mtd) + mtd->erasesize; - parts[1].name = ROOTFS_PART_NAME; + if (type == MTDSPLIT_PART_TYPE_UBI) + parts[1].name = UBI_PART_NAME; + else + parts[1].name = ROOTFS_PART_NAME; parts[1].offset = rootfs_offset; parts[1].size = rootfs_size; |