diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2016-07-29 11:12:18 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-08-05 20:55:16 -0400 |
commit | c2fdd34569145ad281aeea5ef16fff83d7075830 (patch) | |
tree | 596fddf6ec6cc840d5d092651068c29866aa00a2 /cmd/gpt.c | |
parent | 584550d76ad113a072470b806cc785141632b9f5 (diff) |
cmd: gpt: fix the wrong size parse for the last partition
The calculation of "dev_desc->lba - 34 - 1 - offset" is not correct for
size '-', because both fist_usable_lba and last_usable_lba will remain
34 sectors.
We can simply use 0 for size '-' because the part_efi module will decode
the size and auto extend the size to maximum available size.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'cmd/gpt.c')
-rw-r--r-- | cmd/gpt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -298,8 +298,8 @@ static int set_gpt_info(struct blk_desc *dev_desc, if (extract_env(val, &p)) p = val; if ((strcmp(p, "-") == 0)) { - /* remove first usable lba and last block */ - parts[i].size = dev_desc->lba - 34 - 1 - offset; + /* Let part efi module to auto extend the size */ + parts[i].size = 0; } else { size_ll = ustrtoull(p, &p, 0); parts[i].size = lldiv(size_ll, dev_desc->blksz); |