0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-05-20 21:27:55 +00:00
Files
openwrt/target/linux/generic/hack-6.12/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch
Mieczyslaw Nalewaj a2063ec986 generic: 6.12: refresh hack patches
Refreshed patches for generic/hack-6.12 by running
make target/linux/refresh

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16547
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-04-30 16:26:34 +02:00

25 lines
925 B
Diff

From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Mon, 7 Nov 2022 23:48:24 +0100
Subject: [PATCH] mtd: support OpenWrt's MTD_ROOTFS_ROOT_DEV
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This allows setting ROOT_DEV to MTD partition named "rootfs".
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -803,7 +803,8 @@ int add_mtd_device(struct mtd_info *mtd)
mutex_unlock(&mtd_table_mutex);
- if (of_property_read_bool(mtd_get_of_node(mtd), "linux,rootfs")) {
+ if (of_property_read_bool(mtd_get_of_node(mtd), "linux,rootfs") ||
+ (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && !strcmp(mtd->name, "rootfs") && ROOT_DEV == 0)) {
if (IS_BUILTIN(CONFIG_MTD)) {
pr_info("mtd: setting mtd%d (%s) as root device\n", mtd->index, mtd->name);
ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index);