The command will be used by RMA tool to skip
device wiping when it is already in GSI mode.
This change also makes it easier to add more
gsi commands in the future without needing to
update the host side tool (fastboot).
Bug: 298130522
Bug: 298138572
Test: 1. reboot into fastboot mode
2. fastboot gsi status
Change-Id: Ic81f89a93b854f9ec70aebe2d209bfd1f98e3645
Existing code has transport memory leaks. Use smart pointers
for transport to get rid of those cases and manual memory
management
Test: atest fastboot_test
Test: manually checked transport isn't leaking anymore
Bug: 296629925
Change-Id: Ifdf162d5084f61ae5c1d2b56a897464af58100da
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
Adding a hard pattern check for optimized task formation. To keep
behavior consistent, we will remove the old initialization path and add
resize tasks after attempting optimization.
Test: fastboot_test
Bug: 297085098
Change-Id: Ie0e656af9be7abdd130290fe547ffbf385ce75d6
adding documentation on how to use fastboot-info inside of fastboot
README
Test: na
Bug: 297084293
Change-Id: Ic2d17c92a776f1cae9ef80f6b615ddbc841afb74
aosp/2452605 might've accidentally omitted force flash functionality
from fastboot. Some users need to flash dynamic partitions from
bootloader, so we are readding this feature back into fastboot
Test: adb reboot bootloader, fastboot flash system --force
Change-Id: I37a51ebbe38b27ed428c38068d30c0febd7db09c
* With platform-tools-34.0.4 if you try to wipe data
as apart of the fastboot update command it will not
work, will just reboot to userspace without running
the wipe task.
Test: fastboot -w update image.zip, observe that data
gets wiped. Also verified 'fastboot update image.zip'
does *not* wipe data.
Change-Id: I57a2c64029fd4f78968324bdf60251e1e962b3fd
adding include to functional since we use it in this file. Some users
are reporting build issues due to missing this include
Test: m fastboot
Change-Id: I9ba11bdaf7dcedf5f9ebfb6fa50013be50738f48
adding in --exclude-dynamic-partitions to flash only bootloader
partitions and skip the rest. Super optimization will be turned off as
well when this flag is enabled
Test: fastboot flashall --exclude-dynamic-partitions
Change-Id: I4b9d70b7f6179bf079991bf3a20aade64cfe9935
adding --help documentation to fastboot for --disable-super-optimization
and --disable-fastboot-info
Test: fastboot -h
Change-Id: Ia8993b3894d302a63cc97796d66e0af3fb004eef
Adding flag to override fastboot_info for a quick fix in case
fastboot_info format is wrong
Test: fastboot flashall
Change-Id: I1f41646f14d747ce7ac7636ca9ced7279e13f7b0
adding test to compare task list formed from fastboot-info vs list
formed from image list. To test, we need to set sparse_limit in flashing
plan and turn off update-super-optimization. The list of partitions to
be flashed by parsing fastboot-info should be a superset of the
partitions flashed by the hardcoded list. Changing is_retrofit_device()
to also take in a fastboot driver so we can pass in a mock
Test: fastboot_test
Bug: 194686221
Change-Id: Ib860c24c85779de1fbaa6bec8778e1f5ebb9475a
Adding check to ensure flashing plan is used in do_flash. FlashingPlan
should never be null
Test: fastboot flashall -w
Change-Id: I8e69326c59b31c7b54d6d2e04c8ce5c0f12693a7
Changing implementation to have mock fastboot driver return a the
sparse_limit rather than modifying the variable inside of flashing plan
Test: fastboot_test
Change-Id: I850ccd5bd09b6a8479ccc8cf7bf1d227abb87e3a
OptimizedFlashSuper makes more sense and is more consistent with
should-optimize-super
Test: m fastboot
Change-Id: I6ceb31144dce591e0a53faec68b932112d9cd360
Changing Hardcoded FLash to add flash tasks, also modifying do_flash to
download signature data if a source is provided
Test: fastboot flashall
Change-Id: Ic33bc4076f269d0d48146a3de457a72eedd5e6df
Have get_sparse_limit() return FlashingPlan's sparse limit if set. Used
for testing to compare task lists
Test: fastboot_test
Change-Id: I7ac1eb4dc83a53b3d7aa59aa668a780b4b550664
Adding flag to turn off the super optimization. Makes for easier testing
as dynamic partitions flash tasks won't be replaced by one flash super
layout task
Test: fastboot flashall --disable-super-optimization
Bug: 194686221
Change-Id: I9142490ecfe587725872e4b734486d3db1728aa7
The initial logic for adding this in was incorrect. This changed had
allowed us to do fastboot flash dts dt.img on command line. But really
we should enforce that we pass in the path to the image. This change was
added so the command line tool with resemble fastboot-info format which
will support flash dts dt.img (situation where image name and partition
name don't match).
Test: fastboot flash {partition}, fastboot flashall
Bug: 194686221
Change-Id: I62f170e14860d865453ab52793e346fe4066c6d4
Moving zipImageSource and localImageSource to header file to be used for
testing purposes
Test: m fastboot
Bug: 194686221
Change-Id: I689e73eb0102d3b2cdd0c4fc232b2b60b9022c47
When IOServiceGetMatchingServices returns an invalid
iterator, IOIteratorReset doesn't help. Break the loop
to prevent being stuck in the reset loop forever.
This should be fine as the open_device() call in the
upper layer is already doing retries.
Bug: 286495045
Test: fastboot update
Change-Id: Ia58fa9285640be34aa22cd77e4f58cc9092679a4
images are being flashed twice, because of an additional collectImages.
This is resulting in a ~50% increase in flashing time
Test: fastboot flashall -w
Change-Id: I6c271e1e1456cd789f37ebd67cefd221cabc6e7a
This fixes the following compiler errors with gcc
storage.cpp:45:20: error: 'ostream_iterator' is not a member of 'std'
storage.cpp:50:10: error: 'istream_iterator' is not a member of 'std'
Change-Id: I570e332d100bb18e445644a9d57dc14d80f104b5
This fixes the following compiler error with gcc
fastboot_driver.h:51:10: error: ‘function’ in namespace ‘std’ does not name a template type
Change-Id: I3a4d9b48bfdc2c76e443e2efe1761ec9503c6dc5
The ANDROID_SERIAL env is useful for managing multiple
directly connected devices at one time.
Unfortunately for network connected devices, its harder to use.
This is because both adb and fastboot use the same ANDROID_SERIAL
environment value to identify the device to use, and while that
one value works for directly connected devices, when using
network connected devices, the fastboot and adb port numbers may
differ for the same device.
So if I set: `ANDROID_SERIAL="tcp:127.0.0.1:44403"`
fastboot will work, but when I type `adb shell`, I'll get:
adb: device 'tcp:127.0.0.1:44403' not found
As `adb devices` outputs:
List of devices attached
localhost:36697 device
To resolve this, we need separate environment variables,
so introduce a FASTBOOT_DEVICE variable for fastboot.
If FASTBOOT_DEVICE is set, it will use that, and if not
it will fall back to the ANDROID_SERIAL if it is set.
Using an explicit -s argument will still override both.
Change-Id: Icd7db6f29e51ed2decd219e35537f6ed98d698b8
Signed-off-by: John Stultz <jstultz@google.com>
Using for easier debugging. Replacing old getter methods in flash task
with GetInfo(key)
Test: fastboot_test
Change-Id: If42df86c4b0278c3dc5525b1058f1947f0b34794
if we call -w and a reboot task runs beforehand, we don't actually wipe
the given partitions. We want the wipe to occur before reboots.
Test: fastboot flashall -w
Change-Id: If327c5de0858e222cf5fc14531bc20fb741c2960
Falling back on old flashing code until fastboot-info is fixed
Test: m fastboot, fastboot flashall
Change-Id: I10146ec75f75d57d4a4049d35def370533619401
Old should_flash_in_userspace doesn't work if $ANDROID_PRODUCT_OUT is
not set. Also adding in a check to see if resizetasks were added
correctly
Test: fastboot update update.zip without $ANDROID_PRODUCT_OUT and
removing the flashsuperlayout code.
Bug: 283330320
Change-Id: Ib72f6a1cf07745daf70fffae3d1a6b8352e3f79c
This check isn't needed as super_flash_helper.cpp calls a different
should_flash_in_userspace that isn't reliant on $ANDROID_PRODUCT_OUT
being set. Current code will fail when calling fastboot update
Test: fastboot update update.zip without calling lunch
Bug: 283330320
Change-Id: Icefe6092befb747b7f419ea997e0834602808d69
Old changes didn't actually take into account sources. fastboot update
{update.zip} should read fastboot-info from the update package. It was
instead flashing local images + reading local fastboot-info.txt
Test: m fastboot, fastboot update, fastboot flashall
Bug: 283330320
Change-Id: I9587a7735ddfbfb661153eb12ebc3caa7c32f141