401-bcm963xx_real_rootfs_length.patch 947 B

123456789101112131415161718192021222324252627
  1. --- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
  2. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
  3. @@ -85,8 +85,10 @@ struct bcm_tag {
  4. __u32 rootfs_crc;
  5. /* 224-227: CRC32 of kernel partition */
  6. __u32 kernel_crc;
  7. - /* 228-235: Unused at present */
  8. - char reserved1[8];
  9. + /* 228-231: Image sequence number */
  10. + char image_sequence[4];
  11. + /* 222-235: Openwrt: real rootfs length */
  12. + __u32 real_rootfs_length;
  13. /* 236-239: CRC32 of header excluding last 20 bytes */
  14. __u32 header_crc;
  15. /* 240-255: Unused at present */
  16. --- a/drivers/mtd/bcm63xxpart.c
  17. +++ b/drivers/mtd/bcm63xxpart.c
  18. @@ -110,7 +110,8 @@ static int bcm63xx_parse_cfe_partitions(
  19. } else {
  20. /* OpenWrt layout */
  21. rootfsaddr = kerneladdr + kernellen;
  22. - rootfslen = spareaddr - rootfsaddr;
  23. + rootfslen = buf->real_rootfs_length;
  24. + spareaddr = rootfsaddr + rootfslen;
  25. }
  26. } else {
  27. pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n",