Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1902)

Unified Diff: delta_diff_generator.cc

Issue 3762007: AU: Include old kernel hash for source partition verification. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | delta_performer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index 3dcd2cbd2390f00944b5052116038ee64f5b1dea..30110261c69f64df2705ae7c6c98aada6e4b6de6 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -446,7 +446,7 @@ struct DeltaObject {
type(in_type),
size(in_size) {}
bool operator <(const DeltaObject& object) const {
- return size < object.size;
+ return (size != object.size) ? (size < object.size) : (name < object.name);
}
string name;
int type;
@@ -618,7 +618,7 @@ bool InitializePartitionInfo(bool is_kernel,
TEST_AND_RETURN_FALSE(hasher.Finalize());
const vector<char>& hash = hasher.raw_hash();
info->set_hash(hash.data(), hash.size());
- LOG(INFO) << "hash: " << hasher.hash();
+ LOG(INFO) << partition << ": size=" << size << " hash=" << hasher.hash();
return true;
}
@@ -627,8 +627,12 @@ bool InitializePartitionInfos(const string& old_kernel,
const string& old_rootfs,
const string& new_rootfs,
DeltaArchiveManifest* manifest) {
- // TODO(petkov): Generate the old kernel info when we stop generating full
- // updates for the kernel partition.
+ if (!old_kernel.empty()) {
+ TEST_AND_RETURN_FALSE(
+ InitializePartitionInfo(true,
+ old_kernel,
+ manifest->mutable_old_kernel_info()));
+ }
TEST_AND_RETURN_FALSE(
InitializePartitionInfo(true,
new_kernel,
« no previous file with comments | « no previous file | delta_performer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698