summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2019-05-17 14:24:19 -0700
committerHridya Valsaraju <hridya@google.com>2019-05-20 09:37:22 -0700
commit83d856e4c59b6c02eeb7d468892b157a13f7cbf5 (patch)
treeee78bb01c2a5519bc6329949f2f0968e3fe42aaa /fastboot/fastboot.cpp
parent56311071fec472ab546a6722295e84e4b4920c85 (diff)
Get max-download-size from device during fastbootd for flashall/update
Currently, during a 'fastboot flashall/fastboot update', the 'getvar max-download-size' command is issued once to the device when it is in bootloader mode and the same value is used even after the device boots into fastbootd. If the max-download-size returned by bootloader is greater than the max-download-size in fastbootd, this could break flash as large images are broken down into chunks before downloading by using the max-download-size variable. This will cause fastbootd to return an error since it checks whether the buffer being downloaded has a size greater than the max-download-size limit. Test: fastboot flashall Bug: 536870912 Change-Id: Ife7c1ec0583d80d4a31ecf01f1fc14a8365afe0d
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index f8f7eb36e..c8caa67f4 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1177,6 +1177,10 @@ static void reboot_to_userspace_fastboot() {
if (!is_userspace_fastboot()) {
die("Failed to boot into userspace fastboot; one or more components might be unbootable.");
}
+
+ // Reset target_sparse_limit after reboot to userspace fastboot. Max
+ // download sizes may differ in bootloader and fastbootd.
+ target_sparse_limit = -1;
}
class ImageSource {