mtd-rootfs.patch 840 B

1234567891011121314151617181920212223242526
  1. diff -Nur linux-4.1.15.orig/drivers/mtd/mtdpart.c linux-4.1.15/drivers/mtd/mtdpart.c
  2. --- linux-4.1.15.orig/drivers/mtd/mtdpart.c 2015-12-15 06:24:51.000000000 +0100
  3. +++ linux-4.1.15/drivers/mtd/mtdpart.c 2015-12-26 21:02:02.766905805 +0100
  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 <linux/kconfig.h>
  10. #include "mtdcore.h"
  11. @@ -667,6 +668,14 @@
  12. if (IS_ERR(slave))
  13. return PTR_ERR(slave);
  14. + if (strcmp(parts[i].name, "rootfs") == 0) {
  15. + if (ROOT_DEV == 0) {
  16. + printk(KERN_NOTICE "mtd: partition \"rootfs\" "
  17. + "set to be root filesystem\n");
  18. + ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, i);
  19. + }
  20. + }
  21. +
  22. mutex_lock(&mtd_partitions_mutex);
  23. list_add(&slave->list, &mtd_partitions);
  24. mutex_unlock(&mtd_partitions_mutex);