Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: delta_diff_generator.cc

Issue 3325009: AU: when making a delta update, don't delta compress kernel partition. (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index 10f68464a15a5e6e100fc0381b156bd61871d93d..4433c1f143e1f435c0447f590f3d38c9d10b9483 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -431,35 +431,34 @@ bool DeltaCompressKernelPartition(
// Add a new install operation
ops->resize(1);
DeltaArchiveManifest_InstallOperation* op = &(*ops)[0];
- op->set_type(DeltaArchiveManifest_InstallOperation_Type_BSDIFF);
+ op->set_type(DeltaArchiveManifest_InstallOperation_Type_REPLACE_BZ);
op->set_data_offset(*blobs_length);
// Do the actual compression
vector<char> data;
- TEST_AND_RETURN_FALSE(BsdiffFiles(old_kernel_part, new_kernel_part, &data));
- TEST_AND_RETURN_FALSE(utils::WriteAll(blobs_fd, &data[0], data.size()));
- *blobs_length += data.size();
+ TEST_AND_RETURN_FALSE(utils::ReadFile(new_kernel_part, &data));
+ TEST_AND_RETURN_FALSE(!data.empty());
+
+ vector<char> data_bz;
+ TEST_AND_RETURN_FALSE(BzipCompress(data, &data_bz));
+ CHECK(!data_bz.empty());
+
+ TEST_AND_RETURN_FALSE(utils::WriteAll(blobs_fd, &data_bz[0], data_bz.size()));
+ *blobs_length += data_bz.size();
- off_t old_part_size = utils::FileSize(old_kernel_part);
- TEST_AND_RETURN_FALSE(old_part_size >= 0);
off_t new_part_size = utils::FileSize(new_kernel_part);
TEST_AND_RETURN_FALSE(new_part_size >= 0);
- op->set_data_length(data.size());
+ op->set_data_length(data_bz.size());
- op->set_src_length(old_part_size);
op->set_dst_length(new_part_size);
- // Theres a single src/dest extent for each
- Extent* src_extent = op->add_src_extents();
- src_extent->set_start_block(0);
- src_extent->set_num_blocks((old_part_size + kBlockSize - 1) / kBlockSize);
-
+ // Theres a single dest extent
Daniel Erat 2010/09/03 05:43:22 nit: s/Theres/There's/
Extent* dst_extent = op->add_dst_extents();
dst_extent->set_start_block(0);
dst_extent->set_num_blocks((new_part_size + kBlockSize - 1) / kBlockSize);
- LOG(INFO) << "Done delta compressing kernel partition.";
+ LOG(INFO) << "Done compressing kernel partition.";
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698