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

Side by Side Diff: generate_delta_main.cc

Issue 5516009: AU: Split applied update verification into a separate step. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: review comments Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « filesystem_copier_action_unittest.cc ('k') | install_plan.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/types.h> 5 #include <sys/types.h>
6 #include <sys/stat.h> 6 #include <sys/stat.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 FLAGS_old_kernel, 83 FLAGS_old_kernel,
84 &kern_info)); 84 &kern_info));
85 CHECK(DeltaDiffGenerator::InitializePartitionInfo(false, // is_kernel 85 CHECK(DeltaDiffGenerator::InitializePartitionInfo(false, // is_kernel
86 FLAGS_old_image, 86 FLAGS_old_image,
87 &root_info)); 87 &root_info));
88 vector<char> kern_hash(kern_info.hash().begin(), 88 vector<char> kern_hash(kern_info.hash().begin(),
89 kern_info.hash().end()); 89 kern_info.hash().end());
90 vector<char> root_hash(root_info.hash().begin(), 90 vector<char> root_hash(root_info.hash().begin(),
91 root_info.hash().end()); 91 root_info.hash().end());
92 DeltaPerformer performer(&prefs); 92 DeltaPerformer performer(&prefs);
93 performer.set_current_kernel_hash(&kern_hash); 93 performer.set_current_kernel_hash(kern_hash);
94 performer.set_current_rootfs_hash(&root_hash); 94 performer.set_current_rootfs_hash(root_hash);
95 CHECK_EQ(performer.Open(FLAGS_old_image.c_str(), 0, 0), 0); 95 CHECK_EQ(performer.Open(FLAGS_old_image.c_str(), 0, 0), 0);
96 CHECK(performer.OpenKernel(FLAGS_old_kernel.c_str())); 96 CHECK(performer.OpenKernel(FLAGS_old_kernel.c_str()));
97 vector<char> buf(1024 * 1024); 97 vector<char> buf(1024 * 1024);
98 int fd = open(FLAGS_apply_delta.c_str(), O_RDONLY, 0); 98 int fd = open(FLAGS_apply_delta.c_str(), O_RDONLY, 0);
99 CHECK_GE(fd, 0); 99 CHECK_GE(fd, 0);
100 ScopedFdCloser fd_closer(&fd); 100 ScopedFdCloser fd_closer(&fd);
101 for (off_t offset = 0;; offset += buf.size()) { 101 for (off_t offset = 0;; offset += buf.size()) {
102 ssize_t bytes_read; 102 ssize_t bytes_read;
103 CHECK(utils::PReadAll(fd, &buf[0], buf.size(), offset, &bytes_read)); 103 CHECK(utils::PReadAll(fd, &buf[0], buf.size(), offset, &bytes_read));
104 if (bytes_read == 0) 104 if (bytes_read == 0)
(...skipping 30 matching lines...) Expand all
135 return 0; 135 return 0;
136 } 136 }
137 137
138 } // namespace {} 138 } // namespace {}
139 139
140 } // namespace chromeos_update_engine 140 } // namespace chromeos_update_engine
141 141
142 int main(int argc, char** argv) { 142 int main(int argc, char** argv) {
143 return chromeos_update_engine::Main(argc, argv); 143 return chromeos_update_engine::Main(argc, argv);
144 } 144 }
OLDNEW
« no previous file with comments | « filesystem_copier_action_unittest.cc ('k') | install_plan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698