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