Skip to content

Commit 0852da5

Browse files
committed
cdba: Rely on fastboot completion rather than USB disconnect
The purpose for providing different exit codes (2 vs 110) for timeout before or after fastboot was to allow tools invoking cdba to detect if the device arrived at and performed fastboot or not. In most cases relying on the fastboot (USB) disconnect notification works fine, but in cases where the provided image fails to decompress the standard fastboot implementation will OKAY the transfer, fail to process the image and then return to process further fastboot requests. This has been observed in cases where the image is too big, or when it contains a big endian kernel. Change the logic to rely on the "FASTBOOT_DOWNLOAD" response to determine that we did reach fastboot and where able to upload the image and then something happened - i.e. "there's a problem with the image" vs "there's a setup problem". Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 2f3e661 commit 0852da5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cdba.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,11 @@ static int handle_message(struct circ_buf *buf)
533533
} else {
534534
quit = true;
535535
}
536-
} else {
537-
fastboot_done = true;
538-
// printf("======================================== MSG_FASTBOOT_PRESENT(off)\n");
539536
}
540537
break;
541538
case MSG_FASTBOOT_DOWNLOAD:
542539
// printf("======================================== MSG_FASTBOOT_DOWNLOAD\n");
540+
fastboot_done = true;
543541
break;
544542
case MSG_FASTBOOT_BOOT:
545543
// printf("======================================== MSG_FASTBOOT_BOOT\n");
@@ -556,6 +554,7 @@ static int handle_message(struct circ_buf *buf)
556554
break;
557555
case MSG_FASTBOOT_CONTINUE:
558556
// printf("======================================== MSG_FASTBOOT_CONTINUE\n");
557+
fastboot_done = true;
559558
break;
560559
default:
561560
fprintf(stderr, "unk %d len %d\n", msg->type, msg->len);

0 commit comments

Comments
 (0)