aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-11-04 18:37:05 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-11-04 18:37:05 +0000
commit49c7b92ff64cbea9f66436130cab375716875407 (patch)
treec62f30861c8da40a9ae791e91d07e71fe8cdcd6b /target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch
parent0986dff6ec307d608b65bc71617f1253fab06ad2 (diff)
downloadmaster-187ad058-49c7b92ff64cbea9f66436130cab375716875407.tar.gz
master-187ad058-49c7b92ff64cbea9f66436130cab375716875407.tar.bz2
master-187ad058-49c7b92ff64cbea9f66436130cab375716875407.zip
kernel/3.1[02]: move MTD root device setup code to mtdcore
The current code only allows to automatically set root device on MTD partitions. Move the code to MTD core to allow to use it with all MTD devices. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38643 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch')
-rw-r--r--target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch
new file mode 100644
index 0000000000..58c4a8ae3f
--- /dev/null
+++ b/target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch
@@ -0,0 +1,26 @@
+--- a/drivers/mtd/mtdcore.c
++++ b/drivers/mtd/mtdcore.c
+@@ -37,6 +37,7 @@
+ #include <linux/backing-dev.h>
+ #include <linux/gfp.h>
+ #include <linux/slab.h>
++#include <linux/root_dev.h>
+
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+@@ -408,6 +409,15 @@ int add_mtd_device(struct mtd_info *mtd)
+ of this try_ nonsense, and no bitching about it
+ either. :) */
+ __module_get(THIS_MODULE);
++
++ if (!strcmp(mtd->name, "rootfs") &&
++ config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
++ ROOT_DEV == 0) {
++ pr_notice("mtd: device %d (%s) set to be root filesystem\n",
++ mtd->index, mtd->name);
++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index);
++ }
++
+ return 0;
+
+ fail_added: