kernel: allow rootfs splitters to work without CONFIG_MTD_ROOTFS_SPLIT
authorRafał Miłecki <zajec5@gmail.com>
Mon, 6 Oct 2014 13:49:11 +0000 (13:49 +0000)
committerRafał Miłecki <zajec5@gmail.com>
Mon, 6 Oct 2014 13:49:11 +0000 (13:49 +0000)
We want to remove that old (built-in) splitter at some point.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 42804

target/linux/generic/patches-3.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
target/linux/generic/patches-3.14/405-mtd-add-more-helper-functions.patch

index 92a3ee7633ff1c1ff79f743def618de9c6f03194..00a2e0e6fad63e7bc24a7b244367fce9cbb962d8 100644 (file)
  static inline unsigned long
  mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len)
  {
-@@ -660,6 +691,10 @@ static void split_rootfs_data(struct mtd
-       unsigned int split_size;
-       int ret;
-+      ret = run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
-+      if (ret > 0)
-+              return;
-+
-       ret = split_squashfs(master, part->offset, &split_offset);
-       if (ret)
-               return;
-@@ -709,6 +744,12 @@ static void split_uimage(struct mtd_info
+@@ -709,6 +740,12 @@ static void split_uimage(struct mtd_info
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
        if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT))
                split_uimage(master, part);
  }
+@@ -726,9 +763,12 @@ static void mtd_partition_split(struct m
+               return;
+       if (!strcmp(part->mtd.name, "rootfs")) {
++              int ret;
++
+               rootfs_found = 1;
+-              if (config_enabled(CONFIG_MTD_ROOTFS_SPLIT))
++              ret = run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
++              if (ret <= 0 && config_enabled(CONFIG_MTD_ROOTFS_SPLIT))
+                       split_rootfs_data(master, part);
+       }
 --- a/include/linux/mtd/partitions.h
 +++ b/include/linux/mtd/partitions.h
 @@ -70,6 +70,8 @@ struct mtd_part_parser_data {
index c6ce8728bb3a9a27b4b2392f24deac8d775c0bd4..420095eb6940f5683d5cc611fb710440fbe96f6f 100644 (file)
@@ -18,7 +18,7 @@
        }
        if (slave->offset == MTDPART_OFS_RETAIN) {
                slave->offset = cur_offset;
-@@ -985,6 +983,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -984,6 +982,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);