[openwrt/openwrt] kernel: split out mtd hack for CONFIG_FIT_PARTITION + rootfs

LEDE Commits lede-commits at lists.infradead.org
Mon Nov 21 07:47:12 PST 2022


rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/af20d9d03bbe080fd9b27024acf5fca7bec15e4f

commit af20d9d03bbe080fd9b27024acf5fca7bec15e4f
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Mon Nov 7 23:39:52 2022 +0100

    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 at milecki.pl>
    (cherry picked from commit 6a64eb2664c13bc7d6800747066603c27fcad8e0)
---
 .../hack-5.10/420-mtd-set-rootfs-to-be-root-dev.patch |  5 +----
 ...squashfs-root-on-targets-with-CONFIG_FIT_PAR.patch | 19 +++++++++++++++++++
 ...td-parsers-add-nvmem-support-to-cmdlinepart.patch} |  0
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/hack-5.10/420-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/hack-5.10/420-mtd-set-rootfs-to-be-root-dev.patch
index fa3b175dcf..a70d8af4c2 100644
--- a/target/linux/generic/hack-5.10/420-mtd-set-rootfs-to-be-root-dev.patch
+++ b/target/linux/generic/hack-5.10/420-mtd-set-rootfs-to-be-root-dev.patch
@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos <juhosg at 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 at 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);
 +	}
 +
diff --git a/target/linux/generic/hack-5.10/421-mtd-fix-squashfs-root-on-targets-with-CONFIG_FIT_PAR.patch b/target/linux/generic/hack-5.10/421-mtd-fix-squashfs-root-on-targets-with-CONFIG_FIT_PAR.patch
new file mode 100644
index 0000000000..2f7da2aaba
--- /dev/null
+++ b/target/linux/generic/hack-5.10/421-mtd-fix-squashfs-root-on-targets-with-CONFIG_FIT_PAR.patch
@@ -0,0 +1,19 @@
+From: Felix Fietkau <nbd at 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);
+ 	}
+ 
diff --git a/target/linux/generic/hack-5.10/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch b/target/linux/generic/hack-5.10/422-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch
similarity index 100%
rename from target/linux/generic/hack-5.10/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch
rename to target/linux/generic/hack-5.10/422-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch




More information about the lede-commits mailing list