}
static int
-mtd_dump(const char *mtd, int size)
+mtd_dump(const char *mtd, int part_offset, int size)
{
int ret = 0, offset = 0;
int fd;
if (!size)
size = mtdsize;
+ if (part_offset)
+ lseek(fd, part_offset, SEEK_SET);
+
buf = malloc(erasesize);
if (!buf)
return -1;
}
break;
case 'o':
- if (!mtd_fixtrx) {
- fprintf(stderr, "-o: is not available on this platform\n");
- usage();
- }
errno = 0;
offset = strtoul(optarg, 0, 0);
if (errno) {
mtd_verify(device, imagefile);
break;
case CMD_DUMP:
- mtd_dump(device, dump_len);
+ mtd_dump(device, offset, dump_len);
break;
case CMD_ERASE:
if (!unlocked)