update_engine: Don't search for deflates again in SquashFS compressed files
When we initialize a SquashFS file system, at the same time we find the
location of all deflate buffers. But for some files that have specific
postfix like gz or zip, we try to find the deflates there again. But, we
should only do this when the SquashFS did not actually compress that
file. Otherwise we're just gonna fail.
BUG=chromium:1050869
TEST=cros_generate_update_payload --image gs://chromeos-releases/dev-channel/eve-kvm/12871.1.0/dlc/pita/package/dlc.img --src_image gs://chromeos-releases/dev-channel/eve-kvm/12861.0.0/dlc/pita/package/dlc.img --output delta.bin --debug --work_dir workdir
TEST=sudo FEATURES=test emerge update_engine
Change-Id: I8b01fb182b88d7ec75dcbfa4c1271caf3bf074fe
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2076162
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
diff --git a/payload_generator/deflate_utils.cc b/payload_generator/deflate_utils.cc
index ef8d257..8db67ce 100644
--- a/payload_generator/deflate_utils.cc
+++ b/payload_generator/deflate_utils.cc
@@ -296,7 +296,7 @@
}
}
- if (extract_deflates) {
+ if (extract_deflates && !file.is_compressed) {
// Search for deflates if the file is in zip or gzip format.
// .zvoice files may eventually move out of rootfs. If that happens,
// remove ".zvoice" (crbug.com/782918).