AU: Update Downloader to support our image formats.
The downloader used to be dumb in the sense that it would pipe output
to either a DirectFileWriter or a DirectFileWriter via a
GzipDecompressingFileWriter, depending on if we were downloading an
update that was compressed or not. Sadly, things have gotten more
complex: we need to download to two partitions (kernel + rootfs), and
we may stream data via a DeltaPerformer (a type of FileWriter) to the
disk. Thus, the Downloader streams to either
1. gzip decompress->split_writer->direct to disk OR
2. delta performer
Other misc changes: Change FilesystemCopierAction to support
optionally copying the kernel partition rather than root partition.
InstallPlan struct: add an entry for destiation kernel partition.
Test Utils: a new ScopedTempFile class
Utils: support for getting the booted kernel partition device.
BUG=None
TEST=attached unittests
Review URL: http://codereview.chromium.org/1694025
diff --git a/update_attempter.cc b/update_attempter.cc
index 6b8c361..84410ad 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -35,7 +35,9 @@
shared_ptr<OmahaResponseHandlerAction> response_handler_action(
new OmahaResponseHandlerAction);
shared_ptr<FilesystemCopierAction> filesystem_copier_action(
- new FilesystemCopierAction);
+ new FilesystemCopierAction(false));
+ shared_ptr<FilesystemCopierAction> filesystem_copier_action_kernel(
+ new FilesystemCopierAction(true));
shared_ptr<DownloadAction> download_action(
new DownloadAction(new LibcurlHttpFetcher));
shared_ptr<PostinstallRunnerAction> postinstall_runner_action(
@@ -49,6 +51,8 @@
actions_.push_back(shared_ptr<AbstractAction>(update_check_action));
actions_.push_back(shared_ptr<AbstractAction>(response_handler_action));
actions_.push_back(shared_ptr<AbstractAction>(filesystem_copier_action));
+ actions_.push_back(shared_ptr<AbstractAction>(
+ filesystem_copier_action_kernel));
actions_.push_back(shared_ptr<AbstractAction>(download_action));
actions_.push_back(shared_ptr<AbstractAction>(postinstall_runner_action));
actions_.push_back(shared_ptr<AbstractAction>(set_bootable_flag_action));
@@ -64,7 +68,10 @@
BondActions(request_prep_action.get(), update_check_action.get());
BondActions(update_check_action.get(), response_handler_action.get());
BondActions(response_handler_action.get(), filesystem_copier_action.get());
- BondActions(filesystem_copier_action.get(), download_action.get());
+ BondActions(response_handler_action.get(),
+ filesystem_copier_action_kernel.get());
+ BondActions(filesystem_copier_action_kernel.get(),
+ download_action.get());
// TODO(adlr): Bond these actions together properly
// BondActions(download_action.get(), install_action.get());
// BondActions(install_action.get(), postinstall_runner_action.get());