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

Unified Diff: generate_delta_main.cc

Issue 4042004: AU: When applying delta locally, get source checksums (Closed) Base URL: http://git.chromium.org/git/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
Index: generate_delta_main.cc
diff --git a/generate_delta_main.cc b/generate_delta_main.cc
index efeeb3b6038574b38df5ae616994b583c6f1e362..8a98c0980557101e477bf18208c32aeadcc236cd 100644
--- a/generate_delta_main.cc
+++ b/generate_delta_main.cc
@@ -76,7 +76,22 @@ int Main(int argc, char** argv) {
LOG(INFO) << "Setting up preferences under: " << FLAGS_prefs_dir;
LOG_IF(ERROR, !prefs.Init(FilePath(FLAGS_prefs_dir)))
<< "Failed to initialize preferences.";
+ // Get original checksums
+ LOG(INFO) << "Calculating original checksums";
+ PartitionInfo kern_info, root_info;
+ CHECK(InitializePartitionInfo(true, // is_kernel
+ FLAGS_old_kernel,
+ &kern_info));
+ CHECK(InitializePartitionInfo(false, // is_kernel
+ FLAGS_old_image,
+ &root_info));
+ vector<char> kern_hash(kern_info.hash().begin(),
+ kern_info.hash().end());
+ vector<char> root_hash(root_info.hash().begin(),
+ root_info.hash().end());
petkov 2010/10/22 20:15:16 indent is off.
adlr 2010/10/22 20:40:18 Done.
DeltaPerformer performer(&prefs);
+ performer.set_current_kernel_hash(&kern_hash);
+ performer.set_current_rootfs_hash(&root_hash);
CHECK_EQ(performer.Open(FLAGS_old_image.c_str(), 0, 0), 0);
CHECK(performer.OpenKernel(FLAGS_old_kernel.c_str()));
vector<char> buf(1024 * 1024);

Powered by Google App Engine
This is Rietveld 408576698