Truncate source partitions to a multiple of 4 KiB.
When flashing partitions that aren't a multiple of 4 KiB using fastboot,
the last block of these partitions would not be padded with zeros. Full
and incremental paylaods will pad with zeros and write them on the new
target partitions, but the first incremental package after flashing a
device would fail.
This patch truncates the source partitions that aren't multiple of 4
KiB, discarding the data on the last partial 4 KiB block.
Bug: 28626303
TEST=`brillo_update_payload generate ..` a null-incremental payload;
boot.img includes mostly SOURCE_COPY and one REPLACE operation at the
end.
Change-Id: I25e0172fb074392488d96cd00e711c68adfa0e7f
1 file changed