mkimg: We always want the last block of the last inserted partition

Even with an absolute offset we want to know the last block the partition
otherwise we endup with an image the size of the metadata.
This allow to create image with the ESP placed at a specific position which
is useful on arm/arm64 where u-boot have always a hard time to read the ESP
if it's not aligned on 512k.
mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G
now works.

MFC after:	3 days
This commit is contained in:
Emmanuel Vadot 2021-02-25 16:34:28 +01:00
parent 369706a6f8
commit 3b6268bb9e

View File

@ -528,10 +528,8 @@ mkimg(void)
(long long)blkoffset);
}
}
if (!abs_offset) {
block = scheme_metadata(SCHEME_META_PART_AFTER,
part->block + part->size);
}
block = scheme_metadata(SCHEME_META_PART_AFTER,
part->block + part->size);
}
mkimg_validate();