OLD | NEW |
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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // success. | 187 // success. |
188 static bool AssignTempBlocks( | 188 static bool AssignTempBlocks( |
189 Graph* graph, | 189 Graph* graph, |
190 const std::string& new_root, | 190 const std::string& new_root, |
191 int data_fd, | 191 int data_fd, |
192 off_t* data_file_size, | 192 off_t* data_file_size, |
193 std::vector<Vertex::Index>* op_indexes, | 193 std::vector<Vertex::Index>* op_indexes, |
194 std::vector<std::vector<Vertex::Index>::size_type>* reverse_op_indexes, | 194 std::vector<std::vector<Vertex::Index>::size_type>* reverse_op_indexes, |
195 const std::vector<CutEdgeVertexes>& cuts); | 195 const std::vector<CutEdgeVertexes>& cuts); |
196 | 196 |
197 // Given a new rootfs and kernel (|new_image|, |new_kernel_part|), Reads them | |
198 // sequentially, creating a full update of chunk_size chunks. Populates | |
199 // |graph|, |kernel_ops|, and |final_order|, with data about the update | |
200 // operations, and writes relevant data to |fd|, updating |data_file_size| as | |
201 // it does. Only the first |image_size| bytes are read from |new_image| | |
202 // assuming that this is the actual file system. | |
203 static bool ReadFullUpdateFromDisk( | |
204 Graph* graph, | |
205 const std::string& new_kernel_part, | |
206 const std::string& new_image, | |
207 off_t image_size, | |
208 int fd, | |
209 off_t* data_file_size, | |
210 off_t chunk_size, | |
211 std::vector<DeltaArchiveManifest_InstallOperation>* kernel_ops, | |
212 std::vector<Vertex::Index>* final_order); | |
213 | |
214 // Returns true if |op| is a no-op operation that doesn't do any useful work | 197 // Returns true if |op| is a no-op operation that doesn't do any useful work |
215 // (e.g., a move operation that copies blocks onto themselves). | 198 // (e.g., a move operation that copies blocks onto themselves). |
216 static bool IsNoopOperation(const DeltaArchiveManifest_InstallOperation& op); | 199 static bool IsNoopOperation(const DeltaArchiveManifest_InstallOperation& op); |
217 | 200 |
218 static bool InitializePartitionInfo(bool is_kernel, | 201 static bool InitializePartitionInfo(bool is_kernel, |
219 const std::string& partition, | 202 const std::string& partition, |
220 PartitionInfo* info); | 203 PartitionInfo* info); |
221 | 204 |
222 private: | 205 private: |
223 // This should never be constructed | 206 // This should never be constructed |
224 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); | 207 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); |
225 }; | 208 }; |
226 | 209 |
227 extern const char* const kBsdiffPath; | 210 extern const char* const kBsdiffPath; |
228 extern const char* const kBspatchPath; | 211 extern const char* const kBspatchPath; |
229 extern const char* const kDeltaMagic; | 212 extern const char* const kDeltaMagic; |
230 | 213 |
231 }; // namespace chromeos_update_engine | 214 }; // namespace chromeos_update_engine |
232 | 215 |
233 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 216 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
OLD | NEW |