update_engine: Generate PUFFDIFF operation
This patch adds functionality for generating PUFFDIFF operation, but
since the minor verion has not been increase, it actually does not
generate the operation itself. PUFFDIFF is used for patching deflate
based files.
BUG=chromium:767120
TEST=unittest passes; brillo_update_payload {generate|verify} passes;
CQ-DEPEND=CL:726945
Change-Id: I4ffdac8dce3740ef9fc2156cb0dad83a8364c8b5
Reviewed-on: https://chromium-review.googlesource.com/658298
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
diff --git a/payload_generator/squashfs_filesystem.h b/payload_generator/squashfs_filesystem.h
index aceebb8..b79f8c7 100644
--- a/payload_generator/squashfs_filesystem.h
+++ b/payload_generator/squashfs_filesystem.h
@@ -55,9 +55,11 @@
~SquashfsFilesystem() override = default;
- // Creates the file system from the Squashfs file itself.
+ // Creates the file system from the Squashfs file itself. If
+ // |extract_deflates| is true, it will process files to find location of all
+ // deflate streams.
static std::unique_ptr<SquashfsFilesystem> CreateFromFile(
- const std::string& sqfs_path);
+ const std::string& sqfs_path, bool extract_deflates);
// Creates the file system from a file map |filemap| which is a multi-line
// string with each line with the following format:
@@ -99,7 +101,11 @@
SquashfsFilesystem() = default;
// Initialize and populates the files in the file system.
- bool Init(const std::string& map, size_t size, const SquashfsHeader& header);
+ bool Init(const std::string& map,
+ const std::string& sqfs_path,
+ size_t size,
+ const SquashfsHeader& header,
+ bool extract_deflates);
// The size of the image in bytes.
size_t size_;