]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: Include table-length in first-lba checks
authorSamuel Dionne-Riel <samuel@dionne-riel.com>
Sat, 17 Apr 2021 06:17:53 +0000 (02:17 -0400)
committerSamuel Dionne-Riel <samuel@dionne-riel.com>
Sat, 17 Apr 2021 20:15:19 +0000 (16:15 -0400)
commitfb64d9328870737502c6ff94b38a084c28bfd008
tree5f0fc1e9213822e4f7f0dabbdd38a7652640e567
parent1c75a85101e36ebc193183733821546f0fa430fc
libfdisk: Include table-length in first-lba checks

Otherwise, sfdisk would error out on its own dump, as first-lba would be
earlier than "plausible" assuming the default table size.

This is because it did not look for `table-length` when using an sfdisk
script. This means that using `--dump` on a valid image, could not be
unserialized back into a valid image.

This is helpful in exotic situations, where a partition has to be
created earlier than the conventional "first-lba" (2048). For example,
on Allwinner A64 boards, where a firmware is stored at LBA16. With this
it is possible to ask for `first-lba` at or earlier than 16, by reducing
the number of entries to e.g. 48.
libfdisk/src/gpt.c