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

Side by Side Diff: postinstall_runner_action.cc

Issue 6347053: Try to mount new filesystem w/ ext2 first, then ext3. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fix comment for review Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | postinstall_runner_action_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | postinstall_runner_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698