From 49c7b92ff64cbea9f66436130cab375716875407 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 4 Nov 2013 18:37:05 +0000 Subject: 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 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38643 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../480-mtd-set-rootfs-to-be-root-dev.patch | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch (limited to 'target/linux/generic/patches-3.10/480-mtd-set-rootfs-to-be-root-dev.patch') 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 + #include + #include ++#include + + #include + #include +@@ -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: -- cgit v1.2.3