Some OEM commands can take quite a while.
The current 10 second timeout is too small.
Test: fastboot tool
Change-Id: Icf59615919c92dc85807abe3ec5793504cf7a162
When flashing logical partitions, we read the "super" partition metadata
corresponding to the current slot. We then temporarily create a
device-mapper device for that partition, and immediately destroy the
device after all operations are complete. We do not mount partitions
ahead of time, or keep them mounted, because a fastboot operation may
change the layout of the logical partition table (or change which slot
is current).
Bug: 78793464
Test: fastboot flash a logical partition under "super"
Change-Id: Id2a61d3592decabeebfd283c4fd6e6cbe576a18c
Currently a few getvar handlers will return invalid strings when an
error occurs. This change allows those handlers to instead send a proper
failure message.
Bug: 78793464
Test: N/A
Change-Id: I7ff7d036c1e6fb0a3d700ecf21b1103ab77278d2
The size of `fastbootd` goes down from 64088-byte to 38488-byte
(aosp_taimen-userdebug) after the change.
Bug: 78793464
Test: `m -j installclean && m -j fastbootd`. Check that
$OUT/recovery/root/system/lib64/libadbd.so exists and
$OUT/recovery/root/system/bin/fastbootd depends on that.
Change-Id: Ic36c98da1a0dda4e0d86e671f858c42578f53f90
The build system generates a partition name of "product_services" for
the product-services partition, so fastboot's image list must reflect
this.
Bug: 78793464
Test: fastboot flash product_services works with fastbootd
Change-Id: I348f970c9584fd3dd4369e8cded66b6e39eee2b2
Bug: 112108453
Test: fastboot flashall with super.img and product-services.img in $OUT,
fastboot update with super.img and product-services.img in image.zip.
Change-Id: I5718b5e60c546c55af74292895b3f7fe169e4f02
Fastbootd is started by recovery, and communicates
over usb with the fastboot protocol.
Add additional fastboot commands to move in and out of
fastbootd. "fastboot reboot recovery" and "fastboot reboot fastboot"
Bug: 78793464
Test: fastboot reboot recovery, fastboot reboot fastboot
Change-Id: Iffb77b2d3ceefb7335c38aa9fba7bd17821484f0
This CL is largely and adaptation of
Ifd119650dd3316508870df0dfc770099e95ae1d1
Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.
Change-Id: I204a831e052d018018ab124d70ad1ff1610ee007
When host fastboot sends sparse blocks to the device, it tries to only
send blocks in multiples of 1024 bytes. If a block is not aligned to this
size, the excess bytes are prepended to the next write operation. This
is implemented by doing the write in two steps: first the previous
excess from the last write (plus new data up to alignment), then a
second write for the aligned remainder of the new data.
This logic has a bug if the final block plus the previous excess data
contains >= 1024 but < 2048 bytes. In this case the first write will
drain 1024 bytes from the data, and the second write will not have 1024
bytes to write. Instead of retaining this data for the next write, it
tries to write 0 chunks (and thus 0 bytes), which hangs the ioctl() call.
Bug: N/A
Test: "fastboot flash super super.img" where super.img is generated by
lpmake, containing system and product_services partitions and
images.
Change-Id: I9e8523c976ec84d5a57b36a28f4b1ca800edb7e7
USB Reset() allows simulating unplugging and replugging device.
Test: build and run fastboot on mac 10.13.3
Test: glinux build and run fastboot
Change-Id: Id924d063e549a4cca9dda03afd8f8fe266f6d2ab
This reverts commit ceb7cbf5fd.
Reason for revert: Broke mac builds:
system/core/fastboot/usb_osx.cpp:513:35: error: use of undeclared identifier 'USB_TRANSACTION_TIMEOUT'
USB_TRANSACTION_TIMEOUT, USB_TRANSACTION_TIMEOUT);
^
Change-Id: Ibe2f9ff2d5c63f9d33f4bd6d9ba962604cf8caeb
For testing there needs to be a way to simulate unplugging and
replugging a device. This change adds support for a USB reset
method that does this.
Also add timeouts, so USB reads/writes don't block forever
on an unresponsive device.
Test: glinux, fastboot tool still works
Test: Reset confirmed working via wireshark Linux URB captures
Change-Id: I7213a2395d4ef1c0238810e4929ab966e78c8b55
This change creates a nice and clean API for issuing
fastboot commands without using the fastboot tool itself.
Test: fastboot tool itself (now using libfastboot2)
on sailfish, walleye, and other devices.
Test: flash bootloader bootloader.img
Test: flash radio radio.img
Test: -w update img.zip
Test: Manually getvar and reboot commands.
Bug: 111126621
Change-Id: I0022536b204ce0c5ad8329367fd522fa3c57877d
Builtin command "type" in zsh doesn't support -t option and this
is resolved by checking the shell type prior to sourcing them.
Instead of using "type -t" explicitly, check_type() knows the the
type of the current shell and behaves accordingly.
Bug: 110629292
Test: (zsh) source build/envsetup.sh && lunch aosp_arm
(bash) source build/envsetup.sh && lunch aosp_arm
Change-Id: Ie39e130e9cc87135cfd522abedba11ad5ac25261
This allows them to be shared between host and device
implementations.
Test: fastboot works
Bug: 78793464
Change-Id: I79271687850ade2a904fd03d6a97dad1a9ab8e1c