summaryrefslogtreecommitdiff
path: root/target/linux/patches/2.6.35.7/mtd-root.patch
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-10-16 20:10:34 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-10-16 20:10:34 +0200
commit94c0a7374ee0c980a34e134f93dca1d46e7af7bc (patch)
tree134e5415fb5d2ccc613bdab46c97f5fa3df8c730 /target/linux/patches/2.6.35.7/mtd-root.patch
parent07c250a84c1cc9ace9ebf00800f2125461a2662b (diff)
parent084c175e59e9ea61c68154ad9982adcd918cbfcf (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Conflicts: package/freeradius-server/Makefile package/nss/patches/patch-mozilla_security_coreconf_Linux_mk
Diffstat (limited to 'target/linux/patches/2.6.35.7/mtd-root.patch')
-rw-r--r--target/linux/patches/2.6.35.7/mtd-root.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/target/linux/patches/2.6.35.7/mtd-root.patch b/target/linux/patches/2.6.35.7/mtd-root.patch
new file mode 100644
index 000000000..0317a0a3e
--- /dev/null
+++ b/target/linux/patches/2.6.35.7/mtd-root.patch
@@ -0,0 +1,62 @@
+diff -Nur linux-2.6.31.4.orig/drivers/mtd/Kconfig linux-2.6.31.4/drivers/mtd/Kconfig
+--- linux-2.6.31.4.orig/drivers/mtd/Kconfig 2009-10-12 22:15:40.000000000 +0200
++++ linux-2.6.31.4/drivers/mtd/Kconfig 2009-10-21 11:45:10.557679089 +0200
+@@ -53,6 +53,11 @@
+ should normally be compiled as kernel modules. The modules perform
+ various checks and verifications when loaded.
+
++config MTD_ROOTFS_ROOT_DEV
++ bool "Automatically set 'rootfs' partition to be root filesystem"
++ depends on MTD_PARTITIONS
++ default y
++
+ config MTD_REDBOOT_PARTS
+ tristate "RedBoot partition table parsing"
+ depends on MTD_PARTITIONS
+diff -Nur linux-2.6.31.4.orig/drivers/mtd/mtdpart.c linux-2.6.31.4/drivers/mtd/mtdpart.c
+--- linux-2.6.31.4.orig/drivers/mtd/mtdpart.c 2009-10-12 22:15:40.000000000 +0200
++++ linux-2.6.31.4/drivers/mtd/mtdpart.c 2009-10-21 11:46:39.593679219 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/compatmac.h>
++#include <linux/root_dev.h>
+
+ /* Our partition linked list */
+ static LIST_HEAD(mtd_partitions);
+@@ -35,7 +36,7 @@
+ * the pointer to that structure with this macro.
+ */
+ #define PART(x) ((struct mtd_part *)(x))
+-
++#define IS_PART(mtd) (mtd->read == part_read)
+
+ /*
+ * MTD methods which simply translate the effective address and pass through
+@@ -517,14 +518,23 @@
+ {
+ struct mtd_part *slave;
+ uint64_t cur_offset = 0;
+- int i;
++ int i, j;
+
+ printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
+
+- for (i = 0; i < nbparts; i++) {
+- slave = add_one_partition(master, parts + i, i, cur_offset);
++ for (i = 0, j = 0; i < nbparts; i++) {
++ slave = add_one_partition(master, parts + i, j++, cur_offset);
+ if (!slave)
+ return -ENOMEM;
++ if (!strcmp(parts[i].name, "rootfs")) {
++#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV
++ if (ROOT_DEV == 0) {
++ printk(KERN_NOTICE "mtd: partition \"rootfs\" "
++ "set to be root filesystem\n");
++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, slave->mtd.index);
++ }
++#endif
++ }
+ cur_offset = slave->offset + slave->mtd.size;
+ }
+