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/install_plan.h b/install_plan.h
index 9151e1b..fba89fe 100644
--- a/install_plan.h
+++ b/install_plan.h
@@ -17,23 +17,27 @@
InstallPlan(bool is_full,
const std::string& url,
const std::string& hash,
- const std::string& install_path)
+ const std::string& install_path,
+ const std::string& kernel_install_path)
: is_full_update(is_full),
download_url(url),
download_hash(hash),
- install_path(install_path) {}
+ install_path(install_path),
+ kernel_install_path(kernel_install_path) {}
InstallPlan() : is_full_update(false) {}
bool is_full_update;
std::string download_url; // url to download from
std::string download_hash; // hash of the data at the url
std::string install_path; // path to install device
+ std::string kernel_install_path; // path to kernel install device
bool operator==(const InstallPlan& that) const {
return (is_full_update == that.is_full_update) &&
(download_url == that.download_url) &&
(download_hash == that.download_hash) &&
- (install_path == that.install_path);
+ (install_path == that.install_path) &&
+ (kernel_install_path == that.kernel_install_path);
}
bool operator!=(const InstallPlan& that) const {
return !((*this) == that);
@@ -42,7 +46,8 @@
LOG(INFO) << "InstallPlan: "
<< (is_full_update ? "full_update" : "delta_update")
<< ", url: " << download_url << ", hash: " << download_hash
- << ", install_path: " << install_path;
+ << ", install_path: " << install_path
+ << ", kernel_install_path: " << kernel_install_path;
}
};