+ /* Sizes */
+
+ for (; info->vendor_header_size + info->cferom_size <= info->file_size; info->cferom_size += 0x20000) {
+ if (fseek(fp, info->vendor_header_size + info->cferom_size, SEEK_SET)) {
+ err = -errno;
+ fprintf(stderr, "Failed to fseek to the 0x%zx\n", info->cferom_size);
+ return err;
+ }
+ if (fread(&tmp16, 1, sizeof(tmp16), fp) != sizeof(tmp16)) {
+ fprintf(stderr, "Failed to read while looking for JFFS2\n");
+ return -EIO;
+ }
+ if (be16_to_cpu(tmp16) == 0x8519)
+ break;
+ }
+ if (info->vendor_header_size + info->cferom_size >= info->file_size) {
+ fprintf(stderr, "Failed to find cferom size (no bootfs found)\n");
+ return -EPROTO;
+ }
+