summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2018-12-07 16:39:07 -0800
committerDavid Anderson <dvander@google.com>2018-12-07 16:39:55 -0800
commit11d6d278cd8141a5bdb3ca25576039124c44fa6e (patch)
treec107fbd983ff15b8fabf82f2056928ff1eb2d41b /fastboot/fastboot.cpp
parent5ae47e10c82be1889a8d86f28f37302aaefcd306 (diff)
fastboot: Wait for reboot-fastboot to complete before signaling success.
Bug: N/A Test: manual test Change-Id: I07495c1befcf63607c9996d6da6b4df05c060641
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index fee08577c..c77b3f713 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1158,6 +1158,10 @@ static void reboot_to_userspace_fastboot() {
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
fb->set_transport(open_device());
+
+ if (!is_userspace_fastboot()) {
+ die("Failed to boot into userspace fastboot; one or more components might be unbootable.");
+ }
}
class ImageSource {
@@ -1314,9 +1318,6 @@ void FlashAllTool::UpdateSuperPartition() {
if (!is_userspace_fastboot()) {
reboot_to_userspace_fastboot();
}
- if (!is_userspace_fastboot()) {
- die("Failed to boot into userspace; one or more components might be unbootable.");
- }
std::string super_name;
if (fb->GetVar("super-partition-name", &super_name) != fastboot::RetCode::SUCCESS) {
@@ -1962,8 +1963,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
fb->RebootTo("recovery");
fb->WaitForDisconnect();
} else if (wants_reboot_fastboot) {
- fb->RebootTo("fastboot");
- fb->WaitForDisconnect();
+ reboot_to_userspace_fastboot();
}
fprintf(stderr, "Finished. Total time: %.3fs\n", (now() - start));