[U-Boot] [PATCH 1/2] Revert "cmd: gpt: add - partition size parsing"
Julian Scheel
julian at jusst.de
Wed Jul 27 15:17:50 CEST 2016
Partition size is automatically calculated by part_efi when omitted. Besides
this the patch introduced regressions because of faulty maximum size and
offset computations.
This reverts commit 666362356e1ccc0df91c03b1d3f97939968b9c04.
Signed-off-by: Julian Scheel <julian at jusst.de>
---
cmd/gpt.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 3d9706b..8ffaef3 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -181,7 +181,6 @@ static int set_gpt_info(struct blk_desc *dev_desc,
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);
@@ -297,14 +296,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;
- } else {
- size_ll = ustrtoull(p, &p, 0);
- parts[i].size = lldiv(size_ll, dev_desc->blksz);
- }
-
+ size_ll = ustrtoull(p, &p, 0);
+ parts[i].size = lldiv(size_ll, dev_desc->blksz);
free(val);
/* start address */
@@ -317,8 +310,6 @@ static int set_gpt_info(struct blk_desc *dev_desc,
free(val);
}
- offset += parts[i].size + parts[i].start;
-
/* bootable */
if (found_key(tok, "bootable"))
parts[i].bootable = 1;
--
2.9.0
More information about the U-Boot
mailing list