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 24 matching lines...) Expand all Loading... |
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 | 43 // {old,new}_kernel_part are paths to the old and new kernel partition |
44 // images, respectively. | 44 // images, respectively. |
| 45 // private_key_path points to a private key used to sign the update. |
| 46 // Pass empty string to not sign the update. |
45 // output_path is the filename where the delta update should be written. | 47 // output_path is the filename where the delta update should be written. |
46 // Returns true on success. | 48 // Returns true on success. |
47 static bool GenerateDeltaUpdateFile(const std::string& old_root, | 49 static bool GenerateDeltaUpdateFile(const std::string& old_root, |
48 const std::string& old_image, | 50 const std::string& old_image, |
49 const std::string& new_root, | 51 const std::string& new_root, |
50 const std::string& new_image, | 52 const std::string& new_image, |
51 const std::string& old_kernel_part, | 53 const std::string& old_kernel_part, |
52 const std::string& new_kernel_part, | 54 const std::string& new_kernel_part, |
53 const std::string& output_path); | 55 const std::string& output_path, |
| 56 const std::string& private_key_path); |
54 | 57 |
55 // These functions are public so that the unit tests can access them: | 58 // These functions are public so that the unit tests can access them: |
56 | 59 |
57 // Reads old_filename (if it exists) and a new_filename and determines | 60 // Reads old_filename (if it exists) and a new_filename and determines |
58 // the smallest way to encode this file for the diff. It stores | 61 // the smallest way to encode this file for the diff. It stores |
59 // necessary data in out_data and fills in out_op. | 62 // necessary data in out_data and fills in out_op. |
60 // If there's no change in old and new files, it creates a MOVE | 63 // If there's no change in old and new files, it creates a MOVE |
61 // operation. If there is a change, or the old file doesn't exist, | 64 // operation. If there is a change, or the old file doesn't exist, |
62 // the smallest of REPLACE, REPLACE_BZ, or BSDIFF wins. | 65 // the smallest of REPLACE, REPLACE_BZ, or BSDIFF wins. |
63 // new_filename must contain at least one byte. | 66 // new_filename must contain at least one byte. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); | 118 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); |
116 }; | 119 }; |
117 | 120 |
118 extern const char* const kBsdiffPath; | 121 extern const char* const kBsdiffPath; |
119 extern const char* const kBspatchPath; | 122 extern const char* const kBspatchPath; |
120 extern const char* const kDeltaMagic; | 123 extern const char* const kDeltaMagic; |
121 | 124 |
122 }; // namespace chromeos_update_engine | 125 }; // namespace chromeos_update_engine |
123 | 126 |
124 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 127 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
OLD | NEW |