420-mtd-redboot_space.patch 968 B

123456789101112131415161718192021222324252627282930
  1. --- a/drivers/mtd/redboot.c
  2. +++ b/drivers/mtd/redboot.c
  3. @@ -265,14 +265,21 @@ static int parse_redboot_partitions(stru
  4. #endif
  5. names += strlen(names)+1;
  6. -#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
  7. if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) {
  8. - i++;
  9. - parts[i].offset = parts[i-1].size + parts[i-1].offset;
  10. - parts[i].size = fl->next->img->flash_base - parts[i].offset;
  11. - parts[i].name = nullname;
  12. - }
  13. + if (!strcmp(parts[i].name, "rootfs")) {
  14. + parts[i].size = fl->next->img->flash_base;
  15. + parts[i].size &= ~(master->erasesize - 1);
  16. + parts[i].size -= parts[i].offset;
  17. +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
  18. + nrparts--;
  19. + } else {
  20. + i++;
  21. + parts[i].offset = parts[i-1].size + parts[i-1].offset;
  22. + parts[i].size = fl->next->img->flash_base - parts[i].offset;
  23. + parts[i].name = nullname;
  24. #endif
  25. + }
  26. + }
  27. tmp_fl = fl;
  28. fl = fl->next;
  29. kfree(tmp_fl);