aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-03-24 18:20:13 +0100
committerRafał Miłecki <rafal@milecki.pl>2021-03-24 18:22:37 +0100
commit6dd727ac24fa36ac3f23e9a5cf6781a7d1c6b797 (patch)
tree98874de97ebb594732b6c3b42d48876496b0faf4 /target/linux/generic
parent1ff7569387f69550e8a9356a109a875e4fdb4412 (diff)
downloadupstream-6dd727ac24fa36ac3f23e9a5cf6781a7d1c6b797.tar.gz
upstream-6dd727ac24fa36ac3f23e9a5cf6781a7d1c6b797.tar.bz2
upstream-6dd727ac24fa36ac3f23e9a5cf6781a7d1c6b797.zip
kernel: create bootfs partition when parsing on BCM4908
It's helpful for accessing booting data (DTS, kernel, etc.). It has to be used carefully as CFE's JFFS2 support is quite dumb. It doesn't recognize deleted files and has problems handling 0 inode. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_cfe_bootfs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_cfe_bootfs.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_cfe_bootfs.c
index 5c8a5e1b9b..a3474c9dc2 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_cfe_bootfs.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_cfe_bootfs.c
@@ -17,7 +17,7 @@
#define je16_to_cpu(x) ((x).v16)
#define je32_to_cpu(x) ((x).v32)
-#define NR_PARTS 1
+#define NR_PARTS 2
static int mtdsplit_cfe_bootfs_parse(struct mtd_info *mtd,
const struct mtd_partition **pparts,
@@ -58,12 +58,16 @@ static int mtdsplit_cfe_bootfs_parse(struct mtd_info *mtd,
if (!parts)
return -ENOMEM;
+ parts[0].name = "bootfs";
+ parts[0].offset = 0;
+ parts[0].size = rootfs_offset;
+
if (type == MTDSPLIT_PART_TYPE_UBI)
- parts[0].name = UBI_PART_NAME;
+ parts[1].name = UBI_PART_NAME;
else
- parts[0].name = ROOTFS_PART_NAME;
- parts[0].offset = rootfs_offset;
- parts[0].size = mtd->size - rootfs_offset;
+ parts[1].name = ROOTFS_PART_NAME;
+ parts[1].offset = rootfs_offset;
+ parts[1].size = mtd->size - rootfs_offset;
*pparts = parts;