OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 22 matching lines...) Expand all Loading... |
33 // Generally, there will be a vector of Block objects whose length | 33 // Generally, there will be a vector of Block objects whose length |
34 // is the number of blocks on the install partition. | 34 // is the number of blocks on the install partition. |
35 Block() : reader(Vertex::kInvalidIndex), writer(Vertex::kInvalidIndex) {} | 35 Block() : reader(Vertex::kInvalidIndex), writer(Vertex::kInvalidIndex) {} |
36 Vertex::Index reader; | 36 Vertex::Index reader; |
37 Vertex::Index writer; | 37 Vertex::Index writer; |
38 }; | 38 }; |
39 | 39 |
40 // This is the only function that external users of the class should call. | 40 // This is the only function that external users of the class should call. |
41 // old_image and new_image are paths to two image files. They should be | 41 // old_image and new_image are paths to two image files. They should be |
42 // mounted read-only at paths old_root and new_root respectively. | 42 // mounted read-only at paths old_root and new_root respectively. |
| 43 // {old,new}_kernel_part are paths to the old and new kernel partition |
| 44 // images, respectively. |
43 // output_path is the filename where the delta update should be written. | 45 // output_path is the filename where the delta update should be written. |
44 // Returns true on success. | 46 // Returns true on success. |
45 static bool GenerateDeltaUpdateFile(const std::string& old_root, | 47 static bool GenerateDeltaUpdateFile(const std::string& old_root, |
46 const std::string& old_image, | 48 const std::string& old_image, |
47 const std::string& new_root, | 49 const std::string& new_root, |
48 const std::string& new_image, | 50 const std::string& new_image, |
| 51 const std::string& old_kernel_part, |
| 52 const std::string& new_kernel_part, |
49 const std::string& output_path); | 53 const std::string& output_path); |
50 | 54 |
51 // These functions are public so that the unit tests can access them: | 55 // These functions are public so that the unit tests can access them: |
52 | 56 |
53 // Reads old_filename (if it exists) and a new_filename and determines | 57 // Reads old_filename (if it exists) and a new_filename and determines |
54 // the smallest way to encode this file for the diff. It stores | 58 // the smallest way to encode this file for the diff. It stores |
55 // necessary data in out_data and fills in out_op. | 59 // necessary data in out_data and fills in out_op. |
56 // If there's no change in old and new files, it creates a MOVE | 60 // If there's no change in old and new files, it creates a MOVE |
57 // operation. If there is a change, or the old file doesn't exist, | 61 // operation. If there is a change, or the old file doesn't exist, |
58 // the smallest of REPLACE, REPLACE_BZ, or BSDIFF wins. | 62 // the smallest of REPLACE, REPLACE_BZ, or BSDIFF wins. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); | 115 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); |
112 }; | 116 }; |
113 | 117 |
114 extern const char* const kBsdiffPath; | 118 extern const char* const kBsdiffPath; |
115 extern const char* const kBspatchPath; | 119 extern const char* const kBspatchPath; |
116 extern const char* const kDeltaMagic; | 120 extern const char* const kDeltaMagic; |
117 | 121 |
118 }; // namespace chromeos_update_engine | 122 }; // namespace chromeos_update_engine |
119 | 123 |
120 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 124 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
OLD | NEW |