| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "update_engine/postinstall_runner_action.h" | 5 #include "update_engine/postinstall_runner_action.h" |
| 6 #include <sys/mount.h> | 6 #include <sys/mount.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include "update_engine/utils.h" | 8 #include "update_engine/utils.h" |
| 9 | 9 |
| 10 namespace chromeos_update_engine { | 10 namespace chromeos_update_engine { |
| 11 | 11 |
| 12 using std::string; | 12 using std::string; |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 const string kMountPath(utils::kStatefulPartition + "/au_destination"); | 15 const string kMountPath(string(utils::kStatefulPartition) + "/au_destination"); |
| 16 const string kPostinstallScript("/postinst"); | 16 const string kPostinstallScript("/postinst"); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void PostinstallRunnerAction::PerformAction() { | 19 void PostinstallRunnerAction::PerformAction() { |
| 20 CHECK(HasInputObject()); | 20 CHECK(HasInputObject()); |
| 21 const string install_device = GetInputObject(); | 21 const string install_device = GetInputObject(); |
| 22 | 22 |
| 23 int rc = mount(install_device.c_str(), kMountPath.c_str(), "ext3", 0, NULL); | 23 int rc = mount(install_device.c_str(), kMountPath.c_str(), "ext3", 0, NULL); |
| 24 if (rc < 0) { | 24 if (rc < 0) { |
| 25 LOG(ERROR) << "Unable to mount destination device " << install_device | 25 LOG(ERROR) << "Unable to mount destination device " << install_device |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 // non-fatal | 40 // non-fatal |
| 41 LOG(ERROR) << "Unable to umount destination device"; | 41 LOG(ERROR) << "Unable to umount destination device"; |
| 42 } | 42 } |
| 43 if (success && HasOutputPipe()) { | 43 if (success && HasOutputPipe()) { |
| 44 SetOutputObject(install_device); | 44 SetOutputObject(install_device); |
| 45 } | 45 } |
| 46 processor_->ActionComplete(this, success); | 46 processor_->ActionComplete(this, success); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace chromeos_update_engine | 49 } // namespace chromeos_update_engine |
| OLD | NEW |