mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-20 11:39:02 +00:00
kernel: split out mtd hack for CONFIG_FIT_PARTITION + rootfs
This is some hack on top of our old hack. Use separated patch for it so
it's easier to understand and actually possible to describe. We should
ideally get rid of this (and we actually did with kernels 5.15+).
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 6a64eb2664
)
This commit is contained in:
parent
8c1f8f9978
commit
af20d9d03b
@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
#include <linux/nvmem-provider.h>
|
||||
|
||||
#include <linux/mtd/mtd.h>
|
||||
@@ -759,6 +760,19 @@ int add_mtd_device(struct mtd_info *mtd)
|
||||
@@ -759,6 +760,16 @@ int add_mtd_device(struct mtd_info *mtd)
|
||||
of this try_ nonsense, and no bitching about it
|
||||
either. :) */
|
||||
__module_get(THIS_MODULE);
|
||||
@ -31,9 +31,6 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
+ unsigned int index = mtd->index;
|
||||
+ pr_notice("mtd: device %d (%s) set to be root filesystem\n",
|
||||
+ mtd->index, mtd->name);
|
||||
+#ifdef CONFIG_FIT_PARTITION
|
||||
+ index <<= 2;
|
||||
+#endif
|
||||
+ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, index);
|
||||
+ }
|
||||
+
|
||||
|
@ -0,0 +1,19 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat Apr 10 17:00:57 2021 +0200
|
||||
Subject: [PATCH] mtd: fix squashfs root on targets with CONFIG_FIT_PARTITION
|
||||
|
||||
Fix assumption about the block device index
|
||||
---
|
||||
|
||||
--- a/drivers/mtd/mtdcore.c
|
||||
+++ b/drivers/mtd/mtdcore.c
|
||||
@@ -767,6 +767,9 @@ int add_mtd_device(struct mtd_info *mtd)
|
||||
unsigned int index = mtd->index;
|
||||
pr_notice("mtd: device %d (%s) set to be root filesystem\n",
|
||||
mtd->index, mtd->name);
|
||||
+#ifdef CONFIG_FIT_PARTITION
|
||||
+ index <<= 2;
|
||||
+#endif
|
||||
ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, index);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user