cros_generate_update_payload: Truncate rootfs to the filesystem size.

The delta_generator only updates the filesystem data, not the whole
partition. Currently, delta_generator code reads the size of the
filesystem and updates only that part. This patch resizes the rootfs
file before feeding it to the delta_generator in preparation for the
removal of the filesystem size computation in delta_generator.

CQ-DEPEND=CL:302805
BUG=b:24478450
TEST=`cros_generate_uptade_payload --extract --image $IMAGE` for lumpy-7262.57.0 and lumpy-2913.331.0
TEST=`cros_generate_update_payload --output payload.bin --image $IMAGE` for base and test images.

Change-Id: Iba508c4e12ad661e9a079e2f7d037187f8ec2b41
Reviewed-on: https://chromium-review.googlesource.com/302951
Commit-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed