update_engine: Add delta payload support for squashfs
This patch adds support for generating delta payloads for squashfs
images. This is needed to get delta payloads for DLC images.
In order to get the supported major and minor versions of the
update_engine that matches the squashfs image (either squashfs image
contains the entire rootfs, including the update_engine, or the image is
a DLC), we need to read /etc/update_engine inside the image.
We do this by calling unsquashfs and only unsquashing the target file
and later reading its content into a key-value store to be used for
delta payload generation.
BUG=chromium:926986
TEST=unittest
TEST=delta_generator --out_file=output --partition_names=dlc --new_partitions=dlc.img --old_partitions=dlc.img
Change-Id: Ib5599032c873223a5caca82918e138d8b4fcec43
Reviewed-on: https://chromium-review.googlesource.com/1446278
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/sample_images/generate_images.sh b/sample_images/generate_images.sh
index 8478682..e0b54ae 100755
--- a/sample_images/generate_images.sh
+++ b/sample_images/generate_images.sh
@@ -270,6 +270,7 @@
# Add squashfs sample images.
generate_image disk_sqfs_empty sqfs empty $((1024 * 4096)) 4096
generate_image disk_sqfs_default sqfs default $((1024 * 4096)) 4096
+ generate_image disk_sqfs_unittest sqfs unittest $((1024 * 4096)) 4096
# Generate the tarball and delete temporary images.
echo "Packing tar file sample_images.tar.bz2"