mtd-rootfs.patch 726 B

12345678910111213141516171819202122232425
  1. --- linux-2.6.37.orig/drivers/mtd/mtdpart.c
  2. +++ linux-2.6.37/drivers/mtd/mtdpart.c
  3. @@ -30,6 +30,7 @@
  4. #include <linux/mtd/mtd.h>
  5. #include <linux/mtd/partitions.h>
  6. #include <linux/err.h>
  7. +#include <linux/root_dev.h>
  8. /* Our partition linked list */
  9. static LIST_HEAD(mtd_partitions);
  10. @@ -641,6 +642,14 @@
  11. slave = allocate_partition(master, parts + i, i, cur_offset);
  12. if (IS_ERR(slave))
  13. return PTR_ERR(slave);
  14. +
  15. + if (strcmp(parts[i].name, "rootfs") == 0) {
  16. + if (ROOT_DEV == 0) {
  17. + printk(KERN_NOTICE "mtd: partition \"rootfs\" "
  18. + "set to be root filesystem\n");
  19. + ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, i);
  20. + }
  21. + }
  22. mutex_lock(&mtd_partitions_mutex);
  23. list_add(&slave->list, &mtd_partitions);