| 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 #include "update_engine/delta_diff_generator.h" | 5 #include "update_engine/delta_diff_generator.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <inttypes.h> | 9 #include <inttypes.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 using std::set; | 43 using std::set; |
| 44 using std::string; | 44 using std::string; |
| 45 using std::vector; | 45 using std::vector; |
| 46 | 46 |
| 47 namespace chromeos_update_engine { | 47 namespace chromeos_update_engine { |
| 48 | 48 |
| 49 typedef DeltaDiffGenerator::Block Block; | 49 typedef DeltaDiffGenerator::Block Block; |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 const size_t kBlockSize = 4096; // bytes | 52 const size_t kBlockSize = 4096; // bytes |
| 53 const size_t kRootFSPartitionSize = 1 * 1024 * 1024 * 1024; // 1 GiB | 53 const size_t kRootFSPartitionSize = 1 * 1024 * 1024 * 1024; // bytes |
| 54 const uint64_t kVersionNumber = 1; | 54 const uint64_t kVersionNumber = 1; |
| 55 const uint64_t kFullUpdateChunkSize = 128 * 1024; // bytes | 55 const uint64_t kFullUpdateChunkSize = 1024 * 1024; // bytes |
| 56 | 56 |
| 57 static const char* kInstallOperationTypes[] = { | 57 static const char* kInstallOperationTypes[] = { |
| 58 "REPLACE", | 58 "REPLACE", |
| 59 "REPLACE_BZ", | 59 "REPLACE_BZ", |
| 60 "MOVE", | 60 "MOVE", |
| 61 "BSDIFF" | 61 "BSDIFF" |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Stores all Extents for a file into 'out'. Returns true on success. | 64 // Stores all Extents for a file into 'out'. Returns true on success. |
| 65 bool GatherExtents(const string& path, | 65 bool GatherExtents(const string& path, |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 | 1518 |
| 1519 LOG(INFO) << "All done. Successfully created delta file."; | 1519 LOG(INFO) << "All done. Successfully created delta file."; |
| 1520 return true; | 1520 return true; |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 const char* const kBsdiffPath = "/usr/bin/bsdiff"; | 1523 const char* const kBsdiffPath = "/usr/bin/bsdiff"; |
| 1524 const char* const kBspatchPath = "/usr/bin/bspatch"; | 1524 const char* const kBspatchPath = "/usr/bin/bspatch"; |
| 1525 const char* const kDeltaMagic = "CrAU"; | 1525 const char* const kDeltaMagic = "CrAU"; |
| 1526 | 1526 |
| 1527 }; // namespace chromeos_update_engine | 1527 }; // namespace chromeos_update_engine |
| OLD | NEW |