disk_partition_t *parts;
int errno = 0;
uint64_t size_ll, start_ll;
+ lbaint_t offset = 0;
debug("%s: lba num: 0x%x %d\n", __func__,
(unsigned int)dev_desc->lba, (unsigned int)dev_desc->lba);
}
if (extract_env(val, &p))
p = val;
- size_ll = ustrtoull(p, &p, 0);
- parts[i].size = lldiv(size_ll, dev_desc->blksz);
+ if ((strcmp(p, "-") == 0)) {
+ /* remove first usable lba and last block */
+ parts[i].size = dev_desc->lba - 34 - 1 - offset;
+ } else {
+ size_ll = ustrtoull(p, &p, 0);
+ parts[i].size = lldiv(size_ll, dev_desc->blksz);
+ }
+
free(val);
/* start address */
free(val);
}
+ offset += parts[i].size + parts[i].start;
+
/* bootable */
if (found_key(tok, "bootable"))
parts[i].bootable = 1;