AU: support for generating new style full updates.
New style full updates are full updates that use the delta upload file
format. A full update consists of sequential operations to write the
full kernel/rootfs in chunks (currently 128KiB).
Because these full updates use the new file format, they get benefits
over the old type of full update:
- support for embedded signatures
- (eventual) support for resuming installation across reboot
- help reduce code needed in the updater client software
BUG=7248
TEST=generated/applied full update on host; unittests
Review URL: http://codereview.chromium.org/3550020
diff --git a/generate_delta_main.cc b/generate_delta_main.cc
index ab05c77..c66d9d1 100644
--- a/generate_delta_main.cc
+++ b/generate_delta_main.cc
@@ -92,17 +92,20 @@
LOG(INFO) << "done applying delta.";
return 0;
}
- CHECK(!FLAGS_old_dir.empty());
- CHECK(!FLAGS_new_dir.empty());
- CHECK(!FLAGS_old_image.empty());
CHECK(!FLAGS_new_image.empty());
CHECK(!FLAGS_out_file.empty());
- CHECK(!FLAGS_old_kernel.empty());
CHECK(!FLAGS_new_kernel.empty());
- if ((!IsDir(FLAGS_old_dir.c_str())) || (!IsDir(FLAGS_new_dir.c_str()))) {
- LOG(FATAL) << "old_dir or new_dir not directory";
+ if (FLAGS_old_image.empty()) {
+ LOG(INFO) << "Generating full update";
+ } else {
+ LOG(INFO) << "Generating delta update";
+ CHECK(!FLAGS_old_kernel.empty());
+ CHECK(!FLAGS_old_dir.empty());
+ CHECK(!FLAGS_new_dir.empty());
+ if ((!IsDir(FLAGS_old_dir.c_str())) || (!IsDir(FLAGS_new_dir.c_str()))) {
+ LOG(FATAL) << "old_dir or new_dir not directory";
+ }
}
-
DeltaDiffGenerator::GenerateDeltaUpdateFile(FLAGS_old_dir,
FLAGS_old_image,
FLAGS_new_dir,