1
0

mtd-rootfs.patch 804 B

1234567891011121314151617181920212223242526
  1. diff -Nur linux-3.5.orig//drivers/mtd/mtdpart.c linux-3.5/drivers/mtd/mtdpart.c
  2. --- linux-3.5.orig//drivers/mtd/mtdpart.c 2012-07-21 22:58:29.000000000 +0200
  3. +++ linux-3.5/drivers/mtd/mtdpart.c 2012-07-31 23:59:07.000000000 +0200
  4. @@ -30,6 +30,7 @@
  5. #include <linux/mtd/mtd.h>
  6. #include <linux/mtd/partitions.h>
  7. #include <linux/err.h>
  8. +#include <linux/root_dev.h>
  9. #include "mtdcore.h"
  10. @@ -637,6 +638,14 @@
  11. if (IS_ERR(slave))
  12. return PTR_ERR(slave);
  13. + if (strcmp(parts[i].name, "rootfs") == 0) {
  14. + if (ROOT_DEV == 0) {
  15. + printk(KERN_NOTICE "mtd: partition \"rootfs\" "
  16. + "set to be root filesystem\n");
  17. + ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, i);
  18. + }
  19. + }
  20. +
  21. mutex_lock(&mtd_partitions_mutex);
  22. list_add(&slave->list, &mtd_partitions);
  23. mutex_unlock(&mtd_partitions_mutex);