1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
From: Gabor Juhos <juhosg@openwrt.org>
Subject: kernel/3.10: allow to use partition parsers for rootfs and firmware split
lede-commit: 3b71cd94bc9517bc25267dccb393b07d4b54564e
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/mtd/mtdpart.c | 37 +++++++++++++++++++++++++++++++++++++
include/linux/mtd/partitions.h | 2 ++
2 files changed, 39 insertions(+)
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -746,6 +746,7 @@ run_parsers_by_type(struct mtd_part *sla
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
+ run_parsers_by_type(part, MTD_PARSER_TYPE_FIRMWARE);
}
static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part)
@@ -755,6 +756,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
+ if (!strcmp(part->mtd.name, "rootfs")) {
+ run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
+
+ rootfs_found = 1;
+ }
+
if (IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE) &&
!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) &&
!of_find_property(mtd_get_of_node(&part->mtd), "compatible", NULL))
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -75,6 +75,8 @@ struct mtd_part_parser_data {
enum mtd_parser_type {
MTD_PARSER_TYPE_DEVICE = 0,
+ MTD_PARSER_TYPE_ROOTFS,
+ MTD_PARSER_TYPE_FIRMWARE,
};
struct mtd_part_parser {
|