From a371d2c6886a43ad574284e4ea78581effee2370 Mon Sep 17 00:00:00 2001 From: Builder Date: Wed, 13 Nov 2019 14:05:44 +0300 Subject: [PATCH] Remove patches-3.4.35_unused folder --- ...mtd-add-rootfs-split-support_part001.patch | 35 --- ...mtd-add-rootfs-split-support_part002.patch | 240 ------------------ ...td-add-rootfs-split-support_part003a.patch | 10 - ...-mtd-hook-mtdsplit-to-Kbuild_part001.patch | 14 - ...-mtd-hook-mtdsplit-to-Kbuild_part002.patch | 11 - ...mtd-hook-mtdsplit-to-Kbuild_part003z.patch | 11 - ...quashfs_len-in-split_squasfh_part001.patch | 59 ----- ...quashfs_len-in-split_squasfh_part002.patch | 10 - ...td-add-more-helper-functions_part001.patch | 20 -- ...d-add-more-helper-functions_part002a.patch | 14 - ...td-add-more-helper-functions_part003.patch | 27 -- ...d-add-more-helper-functions_part004z.patch | 24 -- .../406-mtd-add-squashfs-parser_part001.patch | 20 -- .../406-mtd-add-squashfs-parser_part002.patch | 10 - 14 files changed, 505 deletions(-) delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part001.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part002.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part003a.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part001.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part002.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part003z.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part001.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part002.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part001.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part002a.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part003.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part004z.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part001.patch delete mode 100644 target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part002.patch diff --git a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part001.patch b/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part001.patch deleted file mode 100644 index 5bc097ce04..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part001.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -12,6 +12,32 @@ menuconfig MTD - - if MTD - -+menu "OpenWrt specific MTD options" -+ -+config MTD_ROOTFS_ROOT_DEV -+ bool "Automatically set 'rootfs' partition to be root filesystem" -+ default y -+ -+config MTD_ROOTFS_SPLIT -+ bool "Automatically split 'rootfs' partition for squashfs" -+ default y -+ -+config MTD_SPLIT_FIRMWARE -+ bool "Automatically split firmware partition for kernel+rootfs" -+ default y -+ -+config MTD_SPLIT_FIRMWARE_NAME -+ string "Firmware partition name" -+ depends on MTD_SPLIT_FIRMWARE -+ default "firmware" -+ -+config MTD_UIMAGE_SPLIT -+ bool "Enable split support for firmware partitions containing a uImage" -+ depends on MTD_SPLIT_FIRMWARE -+ default y -+ -+endmenu -+ - config MTD_TESTS - tristate "MTD tests support (DANGEROUS)" - depends on m diff --git a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part002.patch b/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part002.patch deleted file mode 100644 index 3db35500ec..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part002.patch +++ /dev/null @@ -1,240 +0,0 @@ ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - - #include "mtdcore.h" -@@ -45,13 +46,14 @@ struct mtd_part { - struct list_head list; - }; - -+static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part); -+ - /* - * Given a pointer to the MTD object in the mtd_part structure, we can retrieve - * the pointer to that structure with this macro. - */ - #define PART(x) ((struct mtd_part *)(x)) - -- - /* - * MTD methods which simply translate the effective address and pass through - * to the _real_ device. -@@ -533,8 +535,10 @@ out_register: - return slave; - } - --int mtd_add_partition(struct mtd_info *master, char *name, -- long long offset, long long length) -+ -+static int -+__mtd_add_partition(struct mtd_info *master, char *name, -+ long long offset, long long length, bool dup_check) - { - struct mtd_partition part; - struct mtd_part *p, *new; -@@ -566,21 +570,24 @@ int mtd_add_partition(struct mtd_info *m - end = offset + length; - - mutex_lock(&mtd_partitions_mutex); -- list_for_each_entry(p, &mtd_partitions, list) -- if (p->master == master) { -- if ((start >= p->offset) && -- (start < (p->offset + p->mtd.size))) -- goto err_inv; -- -- if ((end >= p->offset) && -- (end < (p->offset + p->mtd.size))) -- goto err_inv; -- } -+ if (dup_check) { -+ list_for_each_entry(p, &mtd_partitions, list) -+ if (p->master == master) { -+ if ((start >= p->offset) && -+ (start < (p->offset + p->mtd.size))) -+ goto err_inv; -+ -+ if ((end >= p->offset) && -+ (end < (p->offset + p->mtd.size))) -+ goto err_inv; -+ } -+ } - - list_add(&new->list, &mtd_partitions); - mutex_unlock(&mtd_partitions_mutex); - - add_mtd_device(&new->mtd); -+ mtd_partition_split(master, new); - - return ret; - err_inv: -@@ -590,6 +597,12 @@ err_inv: - } - EXPORT_SYMBOL_GPL(mtd_add_partition); - -+int mtd_add_partition(struct mtd_info *master, char *name, -+ long long offset, long long length) -+{ -+ return __mtd_add_partition(master, name, offset, length, true); -+} -+ - int mtd_del_partition(struct mtd_info *master, int partno) - { - struct mtd_part *slave, *next; -@@ -613,6 +626,144 @@ int mtd_del_partition(struct mtd_info *m - } - EXPORT_SYMBOL_GPL(mtd_del_partition); - -+static inline unsigned long -+mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len) -+{ -+ unsigned long mask = mtd->erasesize - 1; -+ -+ len += offset & mask; -+ len = (len + mask) & ~mask; -+ len -= offset & mask; -+ return len; -+} -+ -+#define ROOTFS_SPLIT_NAME "rootfs_data" -+ -+struct squashfs_super_block { -+ __le32 s_magic; -+ __le32 pad0[9]; -+ __le64 bytes_used; -+}; -+ -+ -+static int split_squashfs(struct mtd_info *master, int offset, int *split_offset) -+{ -+ struct squashfs_super_block sb; -+ int len, ret; -+ -+ ret = mtd_read(master, offset, sizeof(sb), &len, (void *) &sb); -+ if (ret || (len != sizeof(sb))) { -+ printk(KERN_ALERT "split_squashfs: error occured while reading " -+ "from \"%s\"\n", master->name); -+ return -EINVAL; -+ } -+ -+ if (SQUASHFS_MAGIC != le32_to_cpu(sb.s_magic) ) { -+ printk(KERN_ALERT "split_squashfs: no squashfs found in \"%s\"\n", -+ master->name); -+ *split_offset = 0; -+ return 0; -+ } -+ -+ if (le64_to_cpu((sb.bytes_used)) <= 0) { -+ printk(KERN_ALERT "split_squashfs: squashfs is empty in \"%s\"\n", -+ master->name); -+ *split_offset = 0; -+ return 0; -+ } -+ -+ len = (u32) le64_to_cpu(sb.bytes_used); -+ len = mtd_pad_erasesize(master, offset, len); -+ *split_offset = offset + len; -+ -+ return 0; -+} -+ -+static void split_rootfs_data(struct mtd_info *master, struct mtd_part *part) -+{ -+ unsigned int split_offset = 0; -+ unsigned int split_size; -+ int ret; -+ -+ ret = split_squashfs(master, part->offset, &split_offset); -+ if (ret) -+ return; -+ -+ if (split_offset <= 0) -+ return; -+ -+ split_size = part->mtd.size - (split_offset - part->offset); -+ printk(KERN_INFO "mtd: partition \"%s\" created automatically, ofs=0x%x, len=0x%x\n", -+ ROOTFS_SPLIT_NAME, split_offset, split_size); -+ -+ __mtd_add_partition(master, ROOTFS_SPLIT_NAME, split_offset, -+ split_size, false); -+} -+ -+#define UBOOT_MAGIC 0x27051956 -+ -+static void split_uimage(struct mtd_info *master, struct mtd_part *part) -+{ -+ struct { -+ __be32 magic; -+ __be32 pad[2]; -+ __be32 size; -+ } hdr; -+ size_t len; -+ -+ if (mtd_read(master, part->offset, sizeof(hdr), &len, (void *) &hdr)) -+ return; -+ -+ if (len != sizeof(hdr) || hdr.magic != cpu_to_be32(UBOOT_MAGIC)) -+ return; -+ -+ len = be32_to_cpu(hdr.size) + 0x40; -+ len = mtd_pad_erasesize(master, part->offset, len); -+ if (len + master->erasesize > part->mtd.size) -+ return; -+ -+ __mtd_add_partition(master, "rootfs", part->offset + len, -+ part->mtd.size - len, false); -+} -+ -+#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME -+#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME -+#else -+#define SPLIT_FIRMWARE_NAME "unused" -+#endif -+ -+static void split_firmware(struct mtd_info *master, struct mtd_part *part) -+{ -+ if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT)) -+ split_uimage(master, part); -+} -+ -+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -+ int offset, int size) -+{ -+} -+ -+static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) -+{ -+ static int rootfs_found = 0; -+ -+ if (rootfs_found) -+ return; -+ -+ if (!strcmp(part->mtd.name, "rootfs")) { -+ rootfs_found = 1; -+ -+ if (config_enabled(CONFIG_MTD_ROOTFS_SPLIT)) -+ split_rootfs_data(master, part); -+ } -+ -+ if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && -+ config_enabled(CONFIG_MTD_SPLIT_FIRMWARE)) -+ split_firmware(master, part); -+ -+ arch_split_mtd_part(master, part->mtd.name, part->offset, -+ part->mtd.size); -+} - /* - * This function, given a master MTD object and a partition table, creates - * and registers slave MTD objects which are bound to the master according to -@@ -642,6 +793,7 @@ int add_mtd_partitions(struct mtd_info * - mutex_unlock(&mtd_partitions_mutex); - - add_mtd_device(&slave->mtd); -+ mtd_partition_split(master, slave); - - cur_offset = slave->offset + slave->mtd.size; - } diff --git a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part003a.patch b/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part003a.patch deleted file mode 100644 index 79d41ea3ba..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/400-mtd-add-rootfs-split-support_part003a.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/linux/mtd/partitions.h -+++ b/include/linux/mtd/partitions.h -@@ -83,5 +83,7 @@ - int mtd_add_partition(struct mtd_info *master, char *name, - long long offset, long long length); - int mtd_del_partition(struct mtd_info *master, int partno); -+extern void __weak arch_split_mtd_part(struct mtd_info *master, -+ const char *name, int offset, int size); - - #endif diff --git a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part001.patch b/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part001.patch deleted file mode 100644 index 1c6b5826cf..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part001.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -36,6 +36,11 @@ config MTD_UIMAGE_SPLIT - depends on MTD_SPLIT_FIRMWARE - default y - -+config MTD_SPLIT -+ def_bool y -+ help -+ Generic MTD split support. -+ - endmenu - - config MTD_TESTS diff --git a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part002.patch b/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part002.patch deleted file mode 100644 index f59e0d4ab0..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part002.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -6,6 +6,8 @@ - obj-$(CONFIG_MTD) += mtd.o - mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o - -+mtd-$(CONFIG_MTD_SPLIT) += mtdsplit/mtdsplit.o -+ - obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o - obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o - obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o diff --git a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part003z.patch b/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part003z.patch deleted file mode 100644 index 0ecafcafba..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/403-mtd-hook-mtdsplit-to-Kbuild_part003z.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -53,6 +53,8 @@ - help - Generic MTD split support. - -+source "drivers/mtd/mtdsplit/Kconfig" -+ - endmenu - - config MTD_TESTS diff --git a/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part001.patch b/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part001.patch deleted file mode 100644 index 45d2640a54..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part001.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -33,6 +33,7 @@ - #include - - #include "mtdcore.h" -+#include "mtdsplit/mtdsplit.h" - - /* Our partition linked list */ - static LIST_HEAD(mtd_partitions); -@@ -668,43 +669,16 @@ mtd_pad_erasesize(struct mtd_info *mtd, - return len; - } - --#define ROOTFS_SPLIT_NAME "rootfs_data" -- --struct squashfs_super_block { -- __le32 s_magic; -- __le32 pad0[9]; -- __le64 bytes_used; --}; -- -- - static int split_squashfs(struct mtd_info *master, int offset, int *split_offset) - { -- struct squashfs_super_block sb; -+ size_t squashfs_len; - int len, ret; - -- ret = mtd_read(master, offset, sizeof(sb), &len, (void *) &sb); -- if (ret || (len != sizeof(sb))) { -- printk(KERN_ALERT "split_squashfs: error occured while reading " -- "from \"%s\"\n", master->name); -- return -EINVAL; -- } -- -- if (SQUASHFS_MAGIC != le32_to_cpu(sb.s_magic) ) { -- printk(KERN_ALERT "split_squashfs: no squashfs found in \"%s\"\n", -- master->name); -- *split_offset = 0; -- return 0; -- } -- -- if (le64_to_cpu((sb.bytes_used)) <= 0) { -- printk(KERN_ALERT "split_squashfs: squashfs is empty in \"%s\"\n", -- master->name); -- *split_offset = 0; -- return 0; -- } -+ ret = mtd_get_squashfs_len(master, offset, &squashfs_len); -+ if (ret) -+ return ret; - -- len = (u32) le64_to_cpu(sb.bytes_used); -- len = mtd_pad_erasesize(master, offset, len); -+ len = mtd_pad_erasesize(master, offset, squashfs_len); - *split_offset = offset + len; - - return 0; diff --git a/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part002.patch b/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part002.patch deleted file mode 100644 index 0ddd95733b..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/404-mtd-use-mtd_get_squashfs_len-in-split_squasfh_part002.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -20,6 +20,7 @@ config MTD_ROOTFS_ROOT_DEV - - config MTD_ROOTFS_SPLIT - bool "Automatically split 'rootfs' partition for squashfs" -+ select MTD_SPLIT - default y - - config MTD_SPLIT_FIRMWARE diff --git a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part001.patch b/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part001.patch deleted file mode 100644 index 5d954c9874..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part001.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -434,14 +434,12 @@ static struct mtd_part *allocate_partiti - if (slave->offset == MTDPART_OFS_APPEND) - slave->offset = cur_offset; - if (slave->offset == MTDPART_OFS_NXTBLK) { -- slave->offset = cur_offset; -- if (mtd_mod_by_eb(cur_offset, master) != 0) { -- /* Round up to next erasesize */ -- slave->offset = (mtd_div_by_eb(cur_offset, master) + 1) * master->erasesize; -+ /* Round up to next erasesize */ -+ slave->offset = mtd_roundup_to_eb(cur_offset, master); -+ if (slave->offset != cur_offset) - printk(KERN_NOTICE "Moving partition %d: " - "0x%012llx -> 0x%012llx\n", partno, - (unsigned long long)cur_offset, (unsigned long long)slave->offset); -- } - } - if (slave->offset == MTDPART_OFS_RETAIN) { - slave->offset = cur_offset; diff --git a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part002a.patch b/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part002a.patch deleted file mode 100644 index 550126688b..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part002a.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/linux/mtd/partitions.h -+++ b/include/linux/mtd/partitions.h -@@ -83,6 +83,11 @@ - int mtd_add_partition(struct mtd_info *master, char *name, - long long offset, long long length); - int mtd_del_partition(struct mtd_info *master, int partno); -+ -+struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd); -+uint64_t mtdpart_get_offset(const struct mtd_info *mtd); -+uint64_t mtd_get_device_size(const struct mtd_info *mtd); -+ - extern void __weak arch_split_mtd_part(struct mtd_info *master, - const char *name, int offset, int size); - diff --git a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part003.patch b/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part003.patch deleted file mode 100644 index 079518a5ab..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part003.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/include/linux/mtd/mtd.h -+++ b/include/linux/mtd/mtd.h -@@ -331,6 +331,24 @@ static inline uint32_t mtd_mod_by_eb(uin - return do_div(sz, mtd->erasesize); - } - -+static inline uint64_t mtd_roundup_to_eb(uint64_t sz, struct mtd_info *mtd) -+{ -+ if (mtd_mod_by_eb(sz, mtd) == 0) -+ return sz; -+ -+ /* Round up to next erase block */ -+ return (mtd_div_by_eb(sz, mtd) + 1) * mtd->erasesize; -+} -+ -+static inline uint64_t mtd_rounddown_to_eb(uint64_t sz, struct mtd_info *mtd) -+{ -+ if (mtd_mod_by_eb(sz, mtd) == 0) -+ return sz; -+ -+ /* Round down to the start of the current erase block */ -+ return (mtd_div_by_eb(sz, mtd)) * mtd->erasesize; -+} -+ - static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) - { - if (mtd->writesize_shift) diff --git a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part004z.patch b/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part004z.patch deleted file mode 100644 index 049416ba77..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/405-mtd-add-more-helper-functions_part004z.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -887,3 +887,21 @@ - return ispart; - } - EXPORT_SYMBOL_GPL(mtd_is_partition); -+ -+struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd) -+{ -+ if (!mtd_is_partition(mtd)) -+ return (struct mtd_info *)mtd; -+ -+ return PART(mtd)->master; -+} -+EXPORT_SYMBOL_GPL(mtdpart_get_master); -+ -+uint64_t mtdpart_get_offset(const struct mtd_info *mtd) -+{ -+ if (!mtd_is_partition(mtd)) -+ return 0; -+ -+ return PART(mtd)->offset; -+} -+EXPORT_SYMBOL_GPL(mtdpart_get_offset); diff --git a/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part001.patch b/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part001.patch deleted file mode 100644 index df474b11a8..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part001.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -37,6 +37,17 @@ config MTD_UIMAGE_SPLIT - depends on MTD_SPLIT_FIRMWARE - default y - -+comment "Rootfs partition parsers" -+ -+config MTD_SPLIT_SQUASHFS_ROOT -+ bool "Squashfs based root partition parser" -+ select MTD_SPLIT -+ default n -+ help -+ This provides a parsing function which allows to detect the -+ offset and size of the unused portion of a rootfs partition -+ containing a squashfs. -+ - config MTD_SPLIT - def_bool n - help diff --git a/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part002.patch b/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part002.patch deleted file mode 100644 index 8a8ecc5282..0000000000 --- a/target/linux/hisilicon/patches-3.4.35_unused/406-mtd-add-squashfs-parser_part002.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -7,6 +7,7 @@ - mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o - - mtd-$(CONFIG_MTD_SPLIT) += mtdsplit/mtdsplit.o -+mtd-$(CONFIG_MTD_SPLIT_SQUASHFS_ROOT) += mtdsplit/mtdsplit_squashfs.o - - obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o - obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o