102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch 906 B

12345678910111213141516171819202122232425
  1. From 5001f2e1a325b68dbf225bd17f69a4d3d975cca5 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Thu, 9 Mar 2017 09:31:44 +0100
  4. Subject: [PATCH 61/69] mtd: "rootfs" conflicts with OpenWrt auto mounting
  5. Signed-off-by: John Crispin <[email protected]>
  6. ---
  7. drivers/mtd/mtdpart.c | 4 ++++
  8. 1 file changed, 4 insertions(+)
  9. --- a/drivers/mtd/mtdpart.c
  10. +++ b/drivers/mtd/mtdpart.c
  11. @@ -57,7 +57,11 @@ static struct mtd_info *allocate_partiti
  12. /* allocate the partition structure */
  13. child = kzalloc(sizeof(*child), GFP_KERNEL);
  14. - name = kstrdup(part->name, GFP_KERNEL);
  15. + /* "rootfs" conflicts with OpenWrt auto mounting */
  16. + if (mtd_type_is_nand(parent) && !strcmp(part->name, "rootfs"))
  17. + name = "ubi";
  18. + else
  19. + name = kstrdup(part->name, GFP_KERNEL);
  20. if (!name || !child) {
  21. printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n",
  22. parent->name);