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