Allow callers to override the default partition size.
Callers should know the actual size of the image on the device. If they do,
use that and not our hard-coded constant.
BUG=chromium:234556
TEST=Running it on canary try jobs
Change-Id: I1f4e268d218d83d5499fd1561f8aacf8c4b0f7c2
Reviewed-on: https://gerrit.chromium.org/gerrit/48963
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/delta_diff_generator.h b/delta_diff_generator.h
index 5dfa364..c258a58 100644
--- a/delta_diff_generator.h
+++ b/delta_diff_generator.h
@@ -63,6 +63,7 @@
// output_path is the filename where the delta update should be written.
// If |chunk_size| is not -1, the delta payload is generated based on
// |chunk_size| chunks rather than whole files.
+ // This method computes scratch space based on |rootfs_partition_size|.
// Returns true on success. Also writes the size of the metadata into
// |metadata_size|.
static bool GenerateDeltaUpdateFile(const std::string& old_root,
@@ -74,6 +75,7 @@
const std::string& output_path,
const std::string& private_key_path,
off_t chunk_size,
+ size_t rootfs_partition_size,
uint64_t* metadata_size);
// These functions are public so that the unit tests can access them:
@@ -265,6 +267,7 @@
extern const char* const kBsdiffPath;
extern const char* const kBspatchPath;
extern const char* const kDeltaMagic;
+extern const size_t kRootFSPartitionSize;
}; // namespace chromeos_update_engine