Fix some issues with LBA vs byte offsets

In several places the existing code assumes LBA, but was improperly converted
to use byte offsets, so multiply by the sector size to correct it and maintain
the same interface between MTD & GPT.

Also, since we will need to cgpt create on /dev/fts, which isn't a stat()able
device, allow providing the disk size on the commandline.

TEST=make runtests; cgpt create -s 12345 on MTD image

Original-Change-Id: Icc89a4505aba9a3dfc39b176a372f6e12d106aed
Reviewed-by: Bill Richardson <>
Tested-by: Albert Chaulk <>
Commit-Queue: Albert Chaulk <>
(cherry picked from commit 494646dbadedae88776d6fced396e3ee8af38e54)

Change-Id: Ic7ee0b97f9a34df1c331bad010a0c3307d520512
Signed-off-by: Duncan Laurie <>
5 files changed