Commit graph

524 commits

Author SHA1 Message Date
Aaron Wisner
794fb0107b Merge "Minor fixes to fastboot_driver"
am: 8cf510ff81

Change-Id: I358512c168fbe19c164bb201cf57accdb613f1a3
2018-08-02 17:49:30 -07:00
Treehugger Robot
8cf510ff81 Merge "Minor fixes to fastboot_driver" 2018-08-03 00:41:16 +00:00
Aaron Wisner
c771ae0fd4 Minor fixes to fastboot_driver
- Make RCString() static
- Add clearer error message for 0 length upload error
- Fix regex hex matching for partition-size
- Move ZLP packet checking to SparseWriteCallback()

Test: build fastboot on glinux
Change-Id: I51a040e07b9698a41f64b35a9e2baa8d575527a9
2018-08-02 17:47:38 -05:00
Hridya Valsaraju
cb10dca496 Merge "Flash super partition with fastboot flashall"
am: 10601fd512

Change-Id: Ibd1b1ba6ccd16ff82c7c050fb6bdf0121e851268
2018-08-01 13:57:11 -07:00
Treehugger Robot
10601fd512 Merge "Flash super partition with fastboot flashall" 2018-08-01 20:47:53 +00:00
Hridya Valsaraju
94943ee331 Flash super partition with fastboot flashall
Bug: 111763923
Test: fastboot flashall
Change-Id: I9b89825bac00d1237972a61715da05f933ac35ce
2018-08-01 18:30:36 +00:00
Dario Freni
586282a771 Merge "Add product-services.img for fastboot flashall."
am: 8b8d7d67f2

Change-Id: I698a75c06e6041ddf403aba2ae5e894308bce2c3
2018-07-31 19:15:00 -07:00
Treehugger Robot
8b8d7d67f2 Merge "Add product-services.img for fastboot flashall." 2018-08-01 02:00:40 +00:00
Dario Freni
c7ea1afe90 Add product-services.img for fastboot flashall.
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
2018-08-01 00:08:52 +01:00
David Anderson
64465fde9f Merge "fastboot: Fix hang when sparse images end in small chunks."
am: d0d7d0a6b9

Change-Id: Ia98cc2ed8f09ad99aa8d00ba7edb16553827556c
2018-07-30 16:50:32 -07:00
David Anderson
0c7bde8de6 fastboot: Fix hang when sparse images end in small chunks.
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
2018-07-30 14:48:13 -07:00
Chris Fries
c6e9a94ed0 Merge "Add support for fastboot transport timeouts and USB Reset() on linux"
am: d6f97d67e0

Change-Id: I3da3a3a9679c375572de0a35e40a86f9476918fa
2018-07-26 13:05:34 -07:00
Aaron Wisner
acf78d462f Add support for fastboot transport timeouts and USB Reset() on linux
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
2018-07-26 11:19:44 -05:00
Tobias Thierer
c526c79b37 Merge "Revert "Add derived UsbTransport class with USB reset method""
am: f6ee8fe515

Change-Id: Ia50999004b5505566051e3927daa646a2024687b
2018-07-25 08:34:14 -07:00
Tobias Thierer
f6ee8fe515 Merge "Revert "Add derived UsbTransport class with USB reset method"" 2018-07-25 15:24:54 +00:00
Tobias Thierer
ec1542f22d Revert "Add derived UsbTransport class with USB reset method"
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
2018-07-25 10:41:24 +00:00
Chris Fries
34bdf4e824 Merge "Add derived UsbTransport class with USB reset method"
am: 56795ac483

Change-Id: I0203e059f415ee63600a7f55c42107c21569d96e
2018-07-24 12:41:55 -07:00
Chris Fries
56795ac483 Merge "Add derived UsbTransport class with USB reset method" 2018-07-24 19:30:02 +00:00
Aaron Wisner
ceb7cbf5fd Add derived UsbTransport class with USB reset method
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
2018-07-24 11:24:15 -05:00
Elliott Hughes
99fea016f4 Merge "fastboot: add tomcherry to OWNERS."
am: b13c49b1b0

Change-Id: I72b43f9e162a3e10fc92b9d5c7be8534ba3dfbdd
2018-07-20 17:11:09 -07:00
Treehugger Robot
b13c49b1b0 Merge "fastboot: add tomcherry to OWNERS." 2018-07-20 22:16:42 +00:00
Chris Fries
40cd9e03c9 Merge "Refactor libfastboot"
am: 767506fc5a

Change-Id: I1e20f30872969dd847fe67a23ebc5975dcb743e7
2018-07-20 14:06:46 -07:00
Chris Fries
767506fc5a Merge "Refactor libfastboot" 2018-07-20 20:52:58 +00:00
Elliott Hughes
4239aa7b75 fastboot: add tomcherry to OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie2a367b7fbf1dd5319a3506d09951d571512f438
2018-07-20 13:20:09 -07:00
Josh Gao
6a928587f8 Merge "fastboot: fix USB_TRACE, make it better."
am: a570644b7d

Change-Id: I1d88e012d14af45e5a7332a1f3f675132c1f8ed4
2018-07-20 13:10:13 -07:00
Treehugger Robot
a570644b7d Merge "fastboot: fix USB_TRACE, make it better." 2018-07-20 20:01:05 +00:00
Jim Tang
a3024ba1fa Merge "Adb and fastboot completion supports zsh users."
am: 74be24d696

Change-Id: I9cc9fdfe875479eb1f6aa2fce7b896fd9d656630
2018-07-20 03:36:23 -07:00
Aaron Wisner
db511207ed Refactor libfastboot
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
2018-07-19 15:16:47 -05:00
Jim Tang
0bd3432c5b Adb and fastboot completion supports zsh users.
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
2018-07-17 14:19:35 +08:00
Jerry Zhang
8666830fb1 Merge "fastboot: Refactor string constants to constants.h"
am: fcc16c53e1

Change-Id: I97770eed7cb35989fac6bc51dfb5ec1c33e3872a
2018-07-16 17:16:43 -07:00
Jerry Zhang
769a9c1d11 fastboot: Refactor string constants to constants.h
This allows them to be shared between host and device
implementations.

Test: fastboot works
Bug: 78793464
Change-Id: I79271687850ade2a904fd03d6a97dad1a9ab8e1c
2018-07-16 14:18:41 -07:00
Elliott Hughes
1f40b2c171 Merge "Simplify __attribute__((__printf__)) use."
am: 2aa50ff56d

Change-Id: Idbbad879ce10878aef55c4ead9ecaee40a4c1a71
2018-06-26 17:17:48 -07:00
Elliott Hughes
d8a4c60276 Simplify __attribute__((__printf__)) use.
We don't need this now everyone's using clang...

Bug: http://b/69933068
Test: ran tests
Change-Id: I88f0cf03981ade47e210387fd6f3a2706dfeb9b8
2018-06-26 13:07:21 -07:00
Pirama Arumuga Nainar
057fb5bede Merge changes from topic "mingw-clang"
am: b8f4fe4fd4

Change-Id: Ic3fff5a3f8801d9df3b6304cec9b055d6d582949
2018-06-26 12:57:37 -07:00
Pirama Arumuga Nainar
a2df1ef441 Do not customize __format__ for Windows/MinGW to gnu_printf
Bug: http://b/69933090
Bug: http://b/69933068

MinGW uses gnu_printf to force C99 printf analysis with GCC, but clang
does not support gnu_printf.  So just use the default that's used for
other platforms.  This also mirrors upstream commit
015e637b4b/.

Test: m native-host-cross with Clang.
Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1
2018-06-25 11:52:54 -07:00
Josh Gao
f22e953272 fastboot: fix USB_TRACE, make it better.
Fix some bit-rotten instances of printf("%d", size_t), add more
logging for device selection.

Test: fastboot.exe devices
Change-Id: I4683fab8f88805e1ac88e193a1e84821be8bfa4c
2018-06-01 13:05:49 -07:00
Elliott Hughes
7337fd1802 Merge "Clarify 'fastboot flash' help." am: f90137da60
am: 06d71a71fa

Change-Id: I2ebcb2e389abe78329f457b68b23ae4af6e2622f
2018-05-24 22:29:15 -07:00
Elliott Hughes
07fc6828a8 Clarify 'fastboot flash' help.
Bug: http://b/80206492
Test: `fastboot --help`
Change-Id: Idd4305628836eb0bcbcf3d217db0a9fc54a1d6d6
2018-05-24 18:30:58 -07:00
Elliott Hughes
db4c182063 Merge "fastboot: better temporary file errors." am: 9971005cd3
am: 301b6b39c8

Change-Id: I34e9ad732b605bda7239e6f9940ba996c0fbb62c
2018-05-22 11:12:46 -07:00
Elliott Hughes
da1dbd6e6a fastboot: better temporary file errors.
Bug: http://b/80082652
Test: N/A
Change-Id: Ib9f34342157ea3a15fd48504d03f4f3a2c710579
2018-05-21 23:02:26 -07:00
android-build-prod (mdb)
a1ece0bf7f Merge "Make fastboot host builds match adb." am: b004620f80
am: f270f31d72

Change-Id: I9f9d619bf4328db2bab978e457c019b2753ac421
2018-05-08 13:19:11 -07:00
Elliott Hughes
645b50e75d Make fastboot host builds match adb.
Bug: http://b/79131183
Test: builds
Change-Id: I572362e8d1c52ebbfb78f84fd2af5428711317d7
2018-05-08 11:30:07 -07:00
Tao Bao
d5a261670c Merge changes from topic "libsparse-callback" am: 49b7f296b9
am: b2cacbb983

Change-Id: If7807fcc8b33f9a404c25ea53917462b3a320a32
2018-04-30 16:18:51 -07:00
Tao Bao
49b7f296b9 Merge changes from topic "libsparse-callback"
* changes:
  fastboot: Track the libsparse API change.
  libsparse: Use 'size_t' for the 'len' parameter in callbacks.
2018-04-30 21:48:46 +00:00
Paul Crowley
edb12341ac Merge "Wipe metadata when we wipe userdata and cache." am: f88905d231
am: 9f5aa032f8

Change-Id: I001d86a509e46b313bfaf116479ccea3b175cdc1
2018-04-25 14:02:49 -07:00
Paul Crowley
4d17006b57 Wipe metadata when we wipe userdata and cache.
Bug: 78469699
Test: Run "fastboot -w" and see that metadata is wiped
Change-Id: I2d795281c48b59c87d4f8f010037d95186f55684
2018-04-25 10:51:05 -07:00
Tao Bao
7d27ffdd45 fastboot: Track the libsparse API change.
Bug: 78432315
Test: Successfully flash a previously failing (huge) sparse image.
Test: `fastboot update` existing marlin-img.zip.
Change-Id: I09c9a06109769882d26be56d4a0d2a2b7b62cb5f
2018-04-25 10:37:01 -07:00
Tao Bao
c3177b0094 Merge "fastboot: sparse_file_len() returns int64_t." am: 9249f4bc41
am: a1b308e288

Change-Id: I08114ba90aaea4c18e479dbff6f0507b4da239d0
2018-04-25 06:46:11 -07:00
Tao Bao
41cf35f8b2 fastboot: sparse_file_len() returns int64_t.
Check that the value fits in uint32_t that's supported by the current
protocol.

Also fix and sanity check the max_size before passing it to
sparse_file_resparse(), which accepts `unsigned int`. This shouldn't
happen in practice because of RESPARSE_LIMIT (1 GiB).

Test: `fastboot flash` with small and large images.
Change-Id: I0a8279fc14c54c40a70ddce65c3b25173c0d0a40
2018-04-24 18:10:42 -07:00
Elliott Hughes
30b408c6f0 Merge changes I1f55c6e1,Ib2adcf0a am: 395131df7b
am: 4a9a08183e

Change-Id: Ib571c60a499dd349358d7019d8004906b2acdaee
2018-04-20 13:31:45 -07:00