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

Side by Side Diff: postinstall_runner_action.cc

Issue 6880077: AU: Handle firmware update failure when booted from FW slot B. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « omaha_request_action_unittest.cc ('k') | 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 command.push_back(temp_rootfs_dir_ + kPostinstallScript); 58 command.push_back(temp_rootfs_dir_ + kPostinstallScript);
59 command.push_back(install_device); 59 command.push_back(install_device);
60 Subprocess::Get().Exec(command, StaticCompletePostinstall, this); 60 Subprocess::Get().Exec(command, StaticCompletePostinstall, this);
61 } 61 }
62 62
63 void PostinstallRunnerAction::CompletePostinstall(int return_code) { 63 void PostinstallRunnerAction::CompletePostinstall(int return_code) {
64 ScopedActionCompleter completer(processor_, this); 64 ScopedActionCompleter completer(processor_, this);
65 ScopedTempUnmounter temp_unmounter(temp_rootfs_dir_); 65 ScopedTempUnmounter temp_unmounter(temp_rootfs_dir_);
66 if (return_code != 0) { 66 if (return_code != 0) {
67 LOG(ERROR) << "Postinst command failed with code: " << return_code; 67 LOG(ERROR) << "Postinst command failed with code: " << return_code;
68 if (return_code == 2) {
69 // This special return code means that we tried to update firmware,
70 // but couldn't because we booted from FW B, and we need to reboot
71 // to get back to FW A.
72 completer.set_code(kActionCodePostinstallBootedFromFirmwareB);
73 }
68 return; 74 return;
69 } 75 }
70 if (HasOutputPipe()) { 76 if (HasOutputPipe()) {
71 CHECK(HasInputObject()); 77 CHECK(HasInputObject());
72 SetOutputObject(GetInputObject()); 78 SetOutputObject(GetInputObject());
73 } 79 }
74 completer.set_code(kActionCodeSuccess); 80 completer.set_code(kActionCodeSuccess);
75 } 81 }
76 82
77 void PostinstallRunnerAction::StaticCompletePostinstall(int return_code, 83 void PostinstallRunnerAction::StaticCompletePostinstall(int return_code,
78 const string& output, 84 const string& output,
79 void* p) { 85 void* p) {
80 reinterpret_cast<PostinstallRunnerAction*>(p)->CompletePostinstall( 86 reinterpret_cast<PostinstallRunnerAction*>(p)->CompletePostinstall(
81 return_code); 87 return_code);
82 } 88 }
83 89
84 } // namespace chromeos_update_engine 90 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « omaha_request_action_unittest.cc ('k') | postinstall_runner_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698