image: Use size of image data when writing images

When detaching a signature, we need to know the size of the
non-signature data. So, add a data_size member to struct image, and
populate it when we iterate through the section table.

When writing the image, use data_size rather than size, so we don't
unnecessarily add the (now unused) signature data.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-08-13 13:49:40 +08:00
parent 8a55df5e96
commit 5466f381dd
4 changed files with 26 additions and 4 deletions

View file

@ -54,7 +54,8 @@ TESTS = sign-verify.sh \
sign-invalidattach-verify.sh \
cert-table-header.sh \
resign-warning.sh \
reattach-warning.sh
reattach-warning.sh \
detach-remove.sh
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = TEST_ARCHES="$(test_arches)" $(srcdir)/test-wrapper.sh