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
This commit is contained in:
David Anderson 2018-10-25 12:01:17 -07:00
parent 551efd11f7
commit 0444a8cbd9
1 changed files with 3 additions and 0 deletions

View File

@ -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";