2021-11-04 20:56:41 +00:00
|
|
|
From 5001f2e1a325b68dbf225bd17f69a4d3d975cca5 Mon Sep 17 00:00:00 2001
|
|
|
|
From: John Crispin <john@phrozen.org>
|
|
|
|
Date: Thu, 9 Mar 2017 09:31:44 +0100
|
|
|
|
Subject: [PATCH 61/69] mtd: "rootfs" conflicts with OpenWrt auto mounting
|
|
|
|
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
---
|
2022-01-16 02:54:58 +00:00
|
|
|
drivers/mtd/mtdpart.c | 4 ++++
|
2021-11-04 20:56:41 +00:00
|
|
|
1 file changed, 4 insertions(+)
|
|
|
|
|
2022-01-16 02:54:58 +00:00
|
|
|
--- a/drivers/mtd/mtdpart.c
|
|
|
|
+++ b/drivers/mtd/mtdpart.c
|
2022-03-30 08:42:31 +00:00
|
|
|
@@ -50,7 +50,11 @@ static struct mtd_info *allocate_partiti
|
2022-01-16 02:54:58 +00:00
|
|
|
|
|
|
|
/* allocate the partition structure */
|
|
|
|
child = kzalloc(sizeof(*child), GFP_KERNEL);
|
2022-03-30 08:42:31 +00:00
|
|
|
- name = kstrdup(part->name, GFP_KERNEL);
|
2022-01-16 02:54:58 +00:00
|
|
|
+ /* "rootfs" conflicts with OpenWrt auto mounting */
|
|
|
|
+ if (mtd_type_is_nand(parent) && !strcmp(part->name, "rootfs"))
|
|
|
|
+ name = "ubi";
|
|
|
|
+ else
|
|
|
|
+ name = kstrdup(part->name, GFP_KERNEL);
|
|
|
|
if (!name || !child) {
|
|
|
|
printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n",
|
|
|
|
parent->name);
|