Parse Android boot.img.
The Android boot.img contains kernel, ramdisk and optionally second
stage bootloader. Both kernel and ramdisk could be compressed by gzip.
This patch add a new boot img filesystem to parse boot.img to split
it into |File|s, and find the deflates to utilize puffin, which could
save us several MBs in delta payload size.
As a side effect, generating delta payload for boot partition is much
faster because it is now splitted into smaller files, and we can make
use of multithreading.
Bug: 110494725
Test: generate a delta payload
Change-Id: If41468b37a407fe1b7a70c2b61f632f7df8176d5
diff --git a/payload_generator/payload_signer.cc b/payload_generator/payload_signer.cc
index 0b47dd4..8eba2dc 100644
--- a/payload_generator/payload_signer.cc
+++ b/payload_generator/payload_signer.cc
@@ -231,8 +231,8 @@
Extent* dummy_extent = dummy_op->add_dst_extents();
// Tell the dummy op to write this data to a big sparse hole
dummy_extent->set_start_block(kSparseHole);
- dummy_extent->set_num_blocks((signature_blob_length + kBlockSize - 1) /
- kBlockSize);
+ dummy_extent->set_num_blocks(
+ utils::DivRoundUp(signature_blob_length, kBlockSize));
}
}