blob: 4334066d7b52d7b084b76ca7ca57dec47e6ebace [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
2// Copyright (C) 2015 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
Alex Deymo14158572015-06-13 03:37:08 -070016
17#include "update_engine/payload_generator/payload_file.h"
18
Alex Deymo6f20dd42015-08-18 16:42:46 -070019#include <endian.h>
20
Alex Deymo14158572015-06-13 03:37:08 -070021#include <algorithm>
Simon Glass3d32f852017-06-28 16:38:11 -060022#include <map>
Sen Jiang3a4dfac2018-08-30 16:57:38 -070023#include <utility>
Simon Glass3d32f852017-06-28 16:38:11 -060024
25#include <base/strings/stringprintf.h>
Alex Deymo14158572015-06-13 03:37:08 -070026
Alex Deymo39910dc2015-11-09 17:04:30 -080027#include "update_engine/common/hash_calculator.h"
Kelvin Zhangdeb34452021-01-21 11:54:36 -050028#include "update_engine/common/utils.h"
Alex Deymo39910dc2015-11-09 17:04:30 -080029#include "update_engine/payload_consumer/delta_performer.h"
30#include "update_engine/payload_consumer/file_writer.h"
31#include "update_engine/payload_consumer/payload_constants.h"
Alex Deymo14158572015-06-13 03:37:08 -070032#include "update_engine/payload_generator/annotated_operation.h"
Alex Deymo14158572015-06-13 03:37:08 -070033#include "update_engine/payload_generator/delta_diff_utils.h"
34#include "update_engine/payload_generator/payload_signer.h"
35
36using std::string;
37using std::vector;
38
39namespace chromeos_update_engine {
40
41namespace {
42
Alex Deymo14158572015-06-13 03:37:08 -070043struct DeltaObject {
44 DeltaObject(const string& in_name, const int in_type, const off_t in_size)
Amin Hassani232f8f92019-01-14 16:15:31 -080045 : name(in_name), type(in_type), size(in_size) {}
46 bool operator<(const DeltaObject& object) const {
Alex Deymo14158572015-06-13 03:37:08 -070047 return (size != object.size) ? (size < object.size) : (name < object.name);
48 }
49 string name;
50 int type;
51 off_t size;
52};
53
54// Writes the uint64_t passed in in host-endian to the file as big-endian.
55// Returns true on success.
56bool WriteUint64AsBigEndian(FileWriter* writer, const uint64_t value) {
57 uint64_t value_be = htobe64(value);
58 TEST_AND_RETURN_FALSE(writer->Write(&value_be, sizeof(value_be)));
59 return true;
60}
61
62} // namespace
63
Alex Deymo14158572015-06-13 03:37:08 -070064bool PayloadFile::Init(const PayloadGenerationConfig& config) {
Alex Deymoa4073ef2016-03-22 23:40:53 -070065 TEST_AND_RETURN_FALSE(config.version.Validate());
66 major_version_ = config.version.major;
67 manifest_.set_minor_version(config.version.minor);
Alex Deymo14158572015-06-13 03:37:08 -070068 manifest_.set_block_size(config.block_size);
Sen Jiang5011df62017-06-28 17:13:19 -070069 manifest_.set_max_timestamp(config.max_timestamp);
Yifan Hong398cb542018-10-18 11:29:40 -070070
Amin Hassani55c75412019-10-07 11:20:39 -070071 if (config.target.dynamic_partition_metadata != nullptr)
72 *(manifest_.mutable_dynamic_partition_metadata()) =
73 *(config.target.dynamic_partition_metadata);
Yifan Hong398cb542018-10-18 11:29:40 -070074
Kelvin Zhang9101ff32021-01-19 15:48:53 -050075 if (config.disable_vabc) {
76 manifest_.mutable_dynamic_partition_metadata()->set_vabc_enabled(false);
77 }
Tianjief5baff42020-07-17 21:43:22 -070078 if (config.is_partial_update) {
79 manifest_.set_partial_update(true);
80 }
Kelvin Zhangdeb34452021-01-21 11:54:36 -050081
82 if (!config.apex_info_file.empty()) {
83 ApexMetadata apex_metadata;
84 int fd = open(config.apex_info_file.c_str(), O_RDONLY);
85 if (fd < 0) {
86 PLOG(FATAL) << "Failed to open " << config.apex_info_file << " for read.";
87 }
88 ScopedFdCloser closer{&fd};
89 CHECK(apex_metadata.ParseFromFileDescriptor(fd));
90 if (apex_metadata.apex_info_size() > 0) {
91 *manifest_.mutable_apex_info() =
92 std::move(*apex_metadata.mutable_apex_info());
93 }
94 }
Alex Deymo14158572015-06-13 03:37:08 -070095 return true;
96}
97
Sen Jiangb9ef4912015-09-21 15:06:13 -070098bool PayloadFile::AddPartition(const PartitionConfig& old_conf,
99 const PartitionConfig& new_conf,
Tianjiee9156ec2020-08-11 11:13:54 -0700100 vector<AnnotatedOperation> aops,
Kelvin Zhang7a265752020-10-29 15:51:35 -0400101 vector<CowMergeOperation> merge_sequence,
102 size_t cow_size) {
Sen Jiangb9ef4912015-09-21 15:06:13 -0700103 Partition part;
Kelvin Zhang7a265752020-10-29 15:51:35 -0400104 part.cow_size = cow_size;
Sen Jiangb9ef4912015-09-21 15:06:13 -0700105 part.name = new_conf.name;
Kelvin Zhangb0b9c202020-07-24 16:02:09 -0400106 part.aops = std::move(aops);
Tianjiee9156ec2020-08-11 11:13:54 -0700107 part.cow_merge_sequence = std::move(merge_sequence);
Sen Jiang05feee02015-11-11 15:59:49 -0800108 part.postinstall = new_conf.postinstall;
Sen Jiang3a4dfac2018-08-30 16:57:38 -0700109 part.verity = new_conf.verity;
Kelvin Zhang1f496422020-08-11 17:18:23 -0400110 part.version = new_conf.version;
Sen Jiangb9ef4912015-09-21 15:06:13 -0700111 // Initialize the PartitionInfo objects if present.
112 if (!old_conf.path.empty())
Amin Hassani232f8f92019-01-14 16:15:31 -0800113 TEST_AND_RETURN_FALSE(
114 diff_utils::InitializePartitionInfo(old_conf, &part.old_info));
115 TEST_AND_RETURN_FALSE(
116 diff_utils::InitializePartitionInfo(new_conf, &part.new_info));
Sen Jiangb9ef4912015-09-21 15:06:13 -0700117 part_vec_.push_back(std::move(part));
Sen Jiang70a6ab02015-08-28 13:23:27 -0700118 return true;
Alex Deymo14158572015-06-13 03:37:08 -0700119}
120
121bool PayloadFile::WritePayload(const string& payload_file,
122 const string& data_blobs_path,
123 const string& private_key_path,
Sen Jiangaef1c6f2015-10-07 10:05:32 -0700124 uint64_t* metadata_size_out) {
Alex Deymo14158572015-06-13 03:37:08 -0700125 // Reorder the data blobs with the manifest_.
Amin Hassanied03b442020-10-26 17:21:29 -0700126 ScopedTempFile ordered_blobs_file("CrAU_temp_data.ordered.XXXXXX");
127 TEST_AND_RETURN_FALSE(
128 ReorderDataBlobs(data_blobs_path, ordered_blobs_file.path()));
Alex Deymo14158572015-06-13 03:37:08 -0700129
Sen Jiang70a6ab02015-08-28 13:23:27 -0700130 // Check that install op blobs are in order.
131 uint64_t next_blob_offset = 0;
Sen Jiangb9ef4912015-09-21 15:06:13 -0700132 for (const auto& part : part_vec_) {
133 for (const auto& aop : part.aops) {
Sen Jiang70a6ab02015-08-28 13:23:27 -0700134 if (!aop.op.has_data_offset())
135 continue;
136 if (aop.op.data_offset() != next_blob_offset) {
Amin Hassani232f8f92019-01-14 16:15:31 -0800137 LOG(FATAL) << "bad blob offset! " << aop.op.data_offset()
138 << " != " << next_blob_offset;
Alex Deymo14158572015-06-13 03:37:08 -0700139 }
Sen Jiang70a6ab02015-08-28 13:23:27 -0700140 next_blob_offset += aop.op.data_length();
Alex Deymo14158572015-06-13 03:37:08 -0700141 }
142 }
143
Sen Jiangb9ef4912015-09-21 15:06:13 -0700144 // Copy the operations and partition info from the part_vec_ to the manifest.
Sen Jiang70a6ab02015-08-28 13:23:27 -0700145 manifest_.clear_partitions();
Sen Jiangb9ef4912015-09-21 15:06:13 -0700146 for (const auto& part : part_vec_) {
Amin Hassani55c75412019-10-07 11:20:39 -0700147 PartitionUpdate* partition = manifest_.add_partitions();
148 partition->set_partition_name(part.name);
Kelvin Zhang1f496422020-08-11 17:18:23 -0400149 if (!part.version.empty()) {
150 partition->set_version(part.version);
151 }
Kelvin Zhang7a265752020-10-29 15:51:35 -0400152 if (part.cow_size > 0) {
153 partition->set_estimate_cow_size(part.cow_size);
154 }
Amin Hassani55c75412019-10-07 11:20:39 -0700155 if (part.postinstall.run) {
156 partition->set_run_postinstall(true);
157 if (!part.postinstall.path.empty())
158 partition->set_postinstall_path(part.postinstall.path);
159 if (!part.postinstall.filesystem_type.empty())
160 partition->set_filesystem_type(part.postinstall.filesystem_type);
161 partition->set_postinstall_optional(part.postinstall.optional);
162 }
163 if (!part.verity.IsEmpty()) {
164 if (part.verity.hash_tree_extent.num_blocks() != 0) {
165 *partition->mutable_hash_tree_data_extent() =
166 part.verity.hash_tree_data_extent;
167 *partition->mutable_hash_tree_extent() = part.verity.hash_tree_extent;
168 partition->set_hash_tree_algorithm(part.verity.hash_tree_algorithm);
169 if (!part.verity.hash_tree_salt.empty())
170 partition->set_hash_tree_salt(part.verity.hash_tree_salt.data(),
171 part.verity.hash_tree_salt.size());
Sen Jiang05feee02015-11-11 15:59:49 -0800172 }
Amin Hassani55c75412019-10-07 11:20:39 -0700173 if (part.verity.fec_extent.num_blocks() != 0) {
174 *partition->mutable_fec_data_extent() = part.verity.fec_data_extent;
175 *partition->mutable_fec_extent() = part.verity.fec_extent;
176 partition->set_fec_roots(part.verity.fec_roots);
Alex Deymo14158572015-06-13 03:37:08 -0700177 }
178 }
Amin Hassani55c75412019-10-07 11:20:39 -0700179 for (const AnnotatedOperation& aop : part.aops) {
180 *partition->add_operations() = aop.op;
181 }
Tianjiee9156ec2020-08-11 11:13:54 -0700182 for (const auto& merge_op : part.cow_merge_sequence) {
183 *partition->add_merge_operations() = merge_op;
184 }
185
Amin Hassani55c75412019-10-07 11:20:39 -0700186 if (part.old_info.has_size() || part.old_info.has_hash())
187 *(partition->mutable_old_partition_info()) = part.old_info;
188 if (part.new_info.has_size() || part.new_info.has_hash())
189 *(partition->mutable_new_partition_info()) = part.new_info;
Alex Deymo14158572015-06-13 03:37:08 -0700190 }
191
192 // Signatures appear at the end of the blobs. Note the offset in the
Amin Hassani55c75412019-10-07 11:20:39 -0700193 // |manifest_|.
Sen Jiang644f6182015-10-06 16:45:57 -0700194 uint64_t signature_blob_length = 0;
Alex Deymo14158572015-06-13 03:37:08 -0700195 if (!private_key_path.empty()) {
Amin Hassani232f8f92019-01-14 16:15:31 -0800196 TEST_AND_RETURN_FALSE(PayloadSigner::SignatureBlobLength(
Sen Jiang9b2f1782019-01-24 14:27:50 -0800197 {private_key_path}, &signature_blob_length));
Sen Jiang3e728fe2015-11-05 11:37:23 -0800198 PayloadSigner::AddSignatureToManifest(
Kelvin Zhangb0b9c202020-07-24 16:02:09 -0400199 next_blob_offset, signature_blob_length, &manifest_);
Alex Deymo14158572015-06-13 03:37:08 -0700200 }
201
Sen Jiang70a6ab02015-08-28 13:23:27 -0700202 // Serialize protobuf
Alex Deymo14158572015-06-13 03:37:08 -0700203 string serialized_manifest;
Sen Jiang9b2f1782019-01-24 14:27:50 -0800204 TEST_AND_RETURN_FALSE(manifest_.SerializeToString(&serialized_manifest));
Alex Deymo14158572015-06-13 03:37:08 -0700205
Sen Jiangaef1c6f2015-10-07 10:05:32 -0700206 uint64_t metadata_size =
207 sizeof(kDeltaMagic) + 2 * sizeof(uint64_t) + serialized_manifest.size();
208
Alex Deymo14158572015-06-13 03:37:08 -0700209 LOG(INFO) << "Writing final delta file header...";
210 DirectFileWriter writer;
211 TEST_AND_RETURN_FALSE_ERRNO(writer.Open(payload_file.c_str(),
212 O_WRONLY | O_CREAT | O_TRUNC,
213 0644) == 0);
214 ScopedFileWriterCloser writer_closer(&writer);
215
216 // Write header
Alex Deymo95699a92016-12-08 19:43:01 -0800217 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(kDeltaMagic, sizeof(kDeltaMagic)));
Alex Deymo14158572015-06-13 03:37:08 -0700218
219 // Write major version number
Sen Jiang46e9b172015-08-31 14:11:01 -0700220 TEST_AND_RETURN_FALSE(WriteUint64AsBigEndian(&writer, major_version_));
Alex Deymo14158572015-06-13 03:37:08 -0700221
222 // Write protobuf length
Amin Hassani232f8f92019-01-14 16:15:31 -0800223 TEST_AND_RETURN_FALSE(
224 WriteUint64AsBigEndian(&writer, serialized_manifest.size()));
Alex Deymo14158572015-06-13 03:37:08 -0700225
Amin Hassani55c75412019-10-07 11:20:39 -0700226 // Metadata signature has the same size as payload signature, because they
227 // are both the same kind of signature for the same kind of hash.
228 uint32_t metadata_signature_size = htobe32(signature_blob_length);
229 TEST_AND_RETURN_FALSE_ERRNO(
230 writer.Write(&metadata_signature_size, sizeof(metadata_signature_size)));
231 metadata_size += sizeof(metadata_signature_size);
232 // Set correct size instead of big endian size.
233 metadata_signature_size = signature_blob_length;
Sen Jiangf4bb3e62015-09-29 11:12:09 -0700234
Alex Deymo14158572015-06-13 03:37:08 -0700235 // Write protobuf
236 LOG(INFO) << "Writing final delta file protobuf... "
237 << serialized_manifest.size();
Alex Deymo95699a92016-12-08 19:43:01 -0800238 TEST_AND_RETURN_FALSE_ERRNO(
239 writer.Write(serialized_manifest.data(), serialized_manifest.size()));
Alex Deymo14158572015-06-13 03:37:08 -0700240
Sen Jiang644f6182015-10-06 16:45:57 -0700241 // Write metadata signature blob.
Amin Hassani55c75412019-10-07 11:20:39 -0700242 if (!private_key_path.empty()) {
Sen Jiang9b2f1782019-01-24 14:27:50 -0800243 brillo::Blob metadata_hash;
Amin Hassani232f8f92019-01-14 16:15:31 -0800244 TEST_AND_RETURN_FALSE(HashCalculator::RawHashOfFile(
245 payload_file, metadata_size, &metadata_hash));
Sen Jiang9b2f1782019-01-24 14:27:50 -0800246 string metadata_signature;
247 TEST_AND_RETURN_FALSE(PayloadSigner::SignHashWithKeys(
248 metadata_hash, {private_key_path}, &metadata_signature));
Alex Deymo95699a92016-12-08 19:43:01 -0800249 TEST_AND_RETURN_FALSE_ERRNO(
250 writer.Write(metadata_signature.data(), metadata_signature.size()));
Sen Jiang644f6182015-10-06 16:45:57 -0700251 }
252
Amin Hassani55c75412019-10-07 11:20:39 -0700253 // Append the data blobs.
Alex Deymo14158572015-06-13 03:37:08 -0700254 LOG(INFO) << "Writing final delta file data blobs...";
Amin Hassanied03b442020-10-26 17:21:29 -0700255 int blobs_fd = open(ordered_blobs_file.path().c_str(), O_RDONLY, 0);
Alex Deymo14158572015-06-13 03:37:08 -0700256 ScopedFdCloser blobs_fd_closer(&blobs_fd);
257 TEST_AND_RETURN_FALSE(blobs_fd >= 0);
258 for (;;) {
259 vector<char> buf(1024 * 1024);
260 ssize_t rc = read(blobs_fd, buf.data(), buf.size());
261 if (0 == rc) {
262 // EOF
263 break;
264 }
265 TEST_AND_RETURN_FALSE_ERRNO(rc > 0);
Alex Deymo95699a92016-12-08 19:43:01 -0800266 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(buf.data(), rc));
Alex Deymo14158572015-06-13 03:37:08 -0700267 }
268
Sen Jiang644f6182015-10-06 16:45:57 -0700269 // Write payload signature blob.
Alex Deymo14158572015-06-13 03:37:08 -0700270 if (!private_key_path.empty()) {
271 LOG(INFO) << "Signing the update...";
Sen Jiang9b2f1782019-01-24 14:27:50 -0800272 string signature;
Alex Deymo14158572015-06-13 03:37:08 -0700273 TEST_AND_RETURN_FALSE(PayloadSigner::SignPayload(
274 payload_file,
Sen Jiang9b2f1782019-01-24 14:27:50 -0800275 {private_key_path},
Sen Jiang720df3e2015-10-01 13:10:44 -0700276 metadata_size,
Sen Jiang644f6182015-10-06 16:45:57 -0700277 metadata_signature_size,
278 metadata_size + metadata_signature_size + manifest_.signatures_offset(),
Sen Jiang9b2f1782019-01-24 14:27:50 -0800279 &signature));
Alex Deymo95699a92016-12-08 19:43:01 -0800280 TEST_AND_RETURN_FALSE_ERRNO(
Sen Jiang9b2f1782019-01-24 14:27:50 -0800281 writer.Write(signature.data(), signature.size()));
Alex Deymo14158572015-06-13 03:37:08 -0700282 }
283
Sen Jiangaef1c6f2015-10-07 10:05:32 -0700284 ReportPayloadUsage(metadata_size);
285 *metadata_size_out = metadata_size;
Alex Deymo14158572015-06-13 03:37:08 -0700286 return true;
287}
288
Amin Hassani232f8f92019-01-14 16:15:31 -0800289bool PayloadFile::ReorderDataBlobs(const string& data_blobs_path,
290 const string& new_data_blobs_path) {
Alex Deymo14158572015-06-13 03:37:08 -0700291 int in_fd = open(data_blobs_path.c_str(), O_RDONLY, 0);
292 TEST_AND_RETURN_FALSE_ERRNO(in_fd >= 0);
293 ScopedFdCloser in_fd_closer(&in_fd);
294
295 DirectFileWriter writer;
Alex Deymo95699a92016-12-08 19:43:01 -0800296 int rc = writer.Open(
297 new_data_blobs_path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0644);
298 if (rc != 0) {
299 PLOG(ERROR) << "Error creating " << new_data_blobs_path;
300 return false;
301 }
Alex Deymo14158572015-06-13 03:37:08 -0700302 ScopedFileWriterCloser writer_closer(&writer);
303 uint64_t out_file_size = 0;
304
Alex Deymoa4073ef2016-03-22 23:40:53 -0700305 for (auto& part : part_vec_) {
Sen Jiangb9ef4912015-09-21 15:06:13 -0700306 for (AnnotatedOperation& aop : part.aops) {
Alex Deymo14158572015-06-13 03:37:08 -0700307 if (!aop.op.has_data_offset())
308 continue;
309 CHECK(aop.op.has_data_length());
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700310 brillo::Blob buf(aop.op.data_length());
Alex Deymo14158572015-06-13 03:37:08 -0700311 ssize_t rc = pread(in_fd, buf.data(), buf.size(), aop.op.data_offset());
312 TEST_AND_RETURN_FALSE(rc == static_cast<ssize_t>(buf.size()));
313
314 // Add the hash of the data blobs for this operation
315 TEST_AND_RETURN_FALSE(AddOperationHash(&aop.op, buf));
316
317 aop.op.set_data_offset(out_file_size);
Alex Deymo95699a92016-12-08 19:43:01 -0800318 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(buf.data(), buf.size()));
Alex Deymo14158572015-06-13 03:37:08 -0700319 out_file_size += buf.size();
320 }
321 }
322 return true;
323}
324
Alex Deymoa12ee112015-08-12 22:19:32 -0700325bool PayloadFile::AddOperationHash(InstallOperation* op,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700326 const brillo::Blob& buf) {
Sen Jiang2703ef42017-03-16 13:36:21 -0700327 brillo::Blob hash;
328 TEST_AND_RETURN_FALSE(HashCalculator::RawHashOfData(buf, &hash));
Alex Deymo14158572015-06-13 03:37:08 -0700329 op->set_data_sha256_hash(hash.data(), hash.size());
330 return true;
331}
332
333void PayloadFile::ReportPayloadUsage(uint64_t metadata_size) const {
Simon Glass3d32f852017-06-28 16:38:11 -0600334 std::map<DeltaObject, int> object_counts;
Alex Deymo14158572015-06-13 03:37:08 -0700335 off_t total_size = 0;
Sen Jiangf23bf922018-11-01 18:26:07 -0700336 int total_op = 0;
Alex Deymo14158572015-06-13 03:37:08 -0700337
Sen Jiangb9ef4912015-09-21 15:06:13 -0700338 for (const auto& part : part_vec_) {
Sen Jianga91195d2018-10-25 15:15:38 -0700339 string part_prefix = "<" + part.name + ">:";
Sen Jiangb9ef4912015-09-21 15:06:13 -0700340 for (const AnnotatedOperation& aop : part.aops) {
Sen Jianga91195d2018-10-25 15:15:38 -0700341 DeltaObject delta(
342 part_prefix + aop.name, aop.op.type(), aop.op.data_length());
Simon Glass3d32f852017-06-28 16:38:11 -0600343 object_counts[delta]++;
Alex Deymo14158572015-06-13 03:37:08 -0700344 total_size += aop.op.data_length();
345 }
Sen Jiangf23bf922018-11-01 18:26:07 -0700346 total_op += part.aops.size();
Alex Deymo14158572015-06-13 03:37:08 -0700347 }
348
Simon Glass3d32f852017-06-28 16:38:11 -0600349 object_counts[DeltaObject("<manifest-metadata>", -1, metadata_size)] = 1;
Alex Deymo14158572015-06-13 03:37:08 -0700350 total_size += metadata_size;
351
Sen Jianga91195d2018-10-25 15:15:38 -0700352 constexpr char kFormatString[] = "%6.2f%% %10jd %-13s %s %d\n";
Simon Glass3d32f852017-06-28 16:38:11 -0600353 for (const auto& object_count : object_counts) {
354 const DeltaObject& object = object_count.first;
Sen Jianga91195d2018-10-25 15:15:38 -0700355 // Use printf() instead of LOG(INFO) because timestamp makes it difficult to
356 // compare two reports.
Sen Jiangcebb6882019-02-26 16:23:28 +0800357 printf(kFormatString,
358 object.size * 100.0 / total_size,
359 object.size,
360 (object.type >= 0
361 ? InstallOperationTypeName(
362 static_cast<InstallOperation::Type>(object.type))
363 : "-"),
364 object.name.c_str(),
365 object_count.second);
Alex Deymo14158572015-06-13 03:37:08 -0700366 }
Sen Jiangf23bf922018-11-01 18:26:07 -0700367 printf(kFormatString, 100.0, total_size, "", "<total>", total_op);
368 fflush(stdout);
Alex Deymo14158572015-06-13 03:37:08 -0700369}
370
Alex Deymo14158572015-06-13 03:37:08 -0700371} // namespace chromeos_update_engine