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

Unified Diff: src/platform/update_engine/filesystem_copier_action.cc

Issue 1694025: AU: Update Downloader to support our image formats. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 8 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
Index: src/platform/update_engine/filesystem_copier_action.cc
diff --git a/src/platform/update_engine/filesystem_copier_action.cc b/src/platform/update_engine/filesystem_copier_action.cc
index 18bab4464180f030fdcc12500f27cc9407ab4b1b..bd4486730b08db0191a5772ca72ec5bbd2e8647c 100755
--- a/src/platform/update_engine/filesystem_copier_action.cc
+++ b/src/platform/update_engine/filesystem_copier_action.cc
@@ -47,17 +47,23 @@ void FilesystemCopierAction::PerformAction() {
return;
}
- const string source =
- copy_source_.empty() ? utils::BootDevice() : copy_source_;
- LOG(INFO) << "Copying from " << source << " to "
- << install_plan_.install_path;
+ string source = copy_source_;
+ if (source.empty()) {
+ source = copying_kernel_install_path_ ?
+ utils::BootKernelDevice(utils::BootDevice()) :
+ utils::BootDevice();
+ }
+
+ const string destination = copying_kernel_install_path_ ?
+ install_plan_.kernel_install_path :
+ install_plan_.install_path;
int src_fd = open(source.c_str(), O_RDONLY);
if (src_fd < 0) {
PLOG(ERROR) << "Unable to open " << source << " for reading:";
return;
}
- int dst_fd = open(install_plan_.install_path.c_str(),
+ int dst_fd = open(destination.c_str(),
O_WRONLY | O_TRUNC | O_CREAT,
0644);
if (dst_fd < 0) {
« no previous file with comments | « src/platform/update_engine/filesystem_copier_action.h ('k') | src/platform/update_engine/filesystem_copier_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698