| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 <vector> | 8 #include <vector> |
| 9 #include "update_engine/subprocess.h" | 9 #include "update_engine/subprocess.h" |
| 10 #include "update_engine/utils.h" | 10 #include "update_engine/utils.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ScopedActionCompleter completer(processor_, this); | 25 ScopedActionCompleter completer(processor_, this); |
| 26 | 26 |
| 27 // Make mountpoint. | 27 // Make mountpoint. |
| 28 TEST_AND_RETURN(utils::MakeTempDirectory("/tmp/au_postint_mount.XXXXXX", | 28 TEST_AND_RETURN(utils::MakeTempDirectory("/tmp/au_postint_mount.XXXXXX", |
| 29 &temp_rootfs_dir_)); | 29 &temp_rootfs_dir_)); |
| 30 ScopedDirRemover temp_dir_remover(temp_rootfs_dir_); | 30 ScopedDirRemover temp_dir_remover(temp_rootfs_dir_); |
| 31 | 31 |
| 32 unsigned long mountflags = MS_RDONLY; | 32 unsigned long mountflags = MS_RDONLY; |
| 33 int rc = mount(install_device.c_str(), | 33 int rc = mount(install_device.c_str(), |
| 34 temp_rootfs_dir_.c_str(), | 34 temp_rootfs_dir_.c_str(), |
| 35 "ext4", | 35 "ext2", |
| 36 mountflags, | 36 mountflags, |
| 37 NULL); | 37 NULL); |
| 38 if (rc < 0) { | 38 if (rc < 0) { |
| 39 LOG(INFO) << "Failed to mount install part as ext4. Trying ext3."; | 39 LOG(INFO) << "Failed to mount install part as ext2. Trying ext3."; |
| 40 rc = mount(install_device.c_str(), | 40 rc = mount(install_device.c_str(), |
| 41 temp_rootfs_dir_.c_str(), | 41 temp_rootfs_dir_.c_str(), |
| 42 "ext3", | 42 "ext3", |
| 43 mountflags, | 43 mountflags, |
| 44 NULL); | 44 NULL); |
| 45 } | 45 } |
| 46 if (rc < 0) { | 46 if (rc < 0) { |
| 47 LOG(ERROR) << "Unable to mount destination device " << install_device | 47 LOG(ERROR) << "Unable to mount destination device " << install_device |
| 48 << " onto " << temp_rootfs_dir_; | 48 << " onto " << temp_rootfs_dir_; |
| 49 return; | 49 return; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 void PostinstallRunnerAction::StaticCompletePostinstall(int return_code, | 77 void PostinstallRunnerAction::StaticCompletePostinstall(int return_code, |
| 78 const string& output, | 78 const string& output, |
| 79 void* p) { | 79 void* p) { |
| 80 reinterpret_cast<PostinstallRunnerAction*>(p)->CompletePostinstall( | 80 reinterpret_cast<PostinstallRunnerAction*>(p)->CompletePostinstall( |
| 81 return_code); | 81 return_code); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace chromeos_update_engine | 84 } // namespace chromeos_update_engine |
| OLD | NEW |