cgpt: create: calculate Last Usable LBA in DriveLastUsableLBA()

We'll need the Last Usable LBA elsewhere, so move this into a function.

BUG=none
TEST=Create GPT with `cgpt create [ -D $SIZE ] $DEV` and check for same
Last Usable LBA with `cgpt show [ -D $SIZE ]-v $DEV | grep 'Last LBA:'`
before/after changes.
BRANCH=none

Change-Id: I82e56b54bbbb676dd83c7eae27566072f80403d4
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/6258635
Commit-Queue: Jakub "Kuba" Czapiga <[email protected]>
Reviewed-by: Jakub "Kuba" Czapiga <[email protected]>
Reviewed-by: Tomasz Michalec <[email protected]>
3 files changed
OSZAR »