From 0444a8cbd96c3dbb75399886b13ece5dc3d6ffa9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 25 Oct 2018 12:01:17 -0700 Subject: [PATCH] fastboot: Check that reboot to userspace succeeded. After rebooting to userspace fastboot, the first command issued is "update-super". If we wound up in the bootloader by accident (as happened to a few users with a busted vbmeta_system), the resulting error message will be very misleading ("update-super" will be an unrecognized command). Instead, this patch explicitly errors if we did not successfully boot into fastbootd. Bug: N/A Test: fastboot flashall Change-Id: I7d5bd64db540978bd0bae884f40ce8c3df48f856 --- fastboot/fastboot.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 6b6e659c6..f9dd6b5e1 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1316,6 +1316,9 @@ 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."); + } fb->Download("super", fd, get_file_size(fd)); std::string command = "update-super:super";