Commit Graph

100 Commits

Author SHA1 Message Date
Daniel Rosenberg 906c5574b3 resolve merge conflicts of 786f5de to nyc-mr1-dev-plus-aosp
Change-Id: I64433da7565ad15edb9c572558c4495eeacbf5c7
2016-07-07 19:40:21 -07:00
Daniel Rosenberg 563fcf6f69 Switch fastboot to new A/B spec
Slots are now referred to as a and b instead
of _a and _b. For the moment, _a and _b will
still be supported. For old devices that
support A/B, they are assumed to have 2 slots.

Bug: 29643845
Change-Id: Ieab6bed7b4977d8386dcec0afa434371f54bd63f
2016-07-07 15:36:43 -07:00
Alex Light 2110d0aa08 Fix fastboot flashall
The return value of load_buf was swapped so we were erroneously
failing.

Bug: 29278988
Change-Id: I777bfbc174f50ec0b71e973db36543eb37d160db
2016-06-29 15:37:29 -07:00
Daniel Rosenberg 3f8cacc857 Fix missing newline in Fastboot help.
Change-Id: Ib5cfa562f7655f7905002f7874dccc39aaa41837
2016-06-29 12:17:13 -07:00
Alex Light dba3e995e5 resolve merge conflicts of df9d177 to nyc-mr1-dev-plus-aosp
Change-Id: Ib16c68978eac596587de54a811316e6bdb7fed87
2016-06-29 12:12:39 -07:00
Alex Light 89eb689d5c Revert "Revert "Add Fastboot support for flashing secondary images""
This reverts commit 520573f2bb.

Bug: 29278988
Change-Id: I5bd2de1c1e0e6224a195b566f7dcbe383555a80a
2016-06-29 10:33:09 -07:00
Ed Heyl 520573f2bb Revert "Add Fastboot support for flashing secondary images"
This reverts commit 6c98509c34.

This seems to break flashing of devices without a/b slots (most devices).

Change-Id: I235cfb29a8898920dedf7a5dbb22e2c6dc590244
2016-06-29 12:50:16 +00:00
Elliott Hughes a5dac1a35b Fix build breakage from merge conflict resolution.
Change-Id: Icb623ebfb53a366cdd56674e87fa0781683e144e
2016-06-28 21:59:33 -07:00
Daniel Rosenberg 37ac5e3fda resolve merge conflicts of 3fdcf8c to nyc-mr1-dev-plus-aosp
Change-Id: Idaecc3eb0e30ce8e58b79065598d1866739488f8
2016-06-28 19:20:18 -07:00
Elliott Hughes 6e1ef6432a resolve merge conflicts of cee6305 to nyc-mr1-dev-plus-aosp
Change-Id: Ia81286d9631a6d1206195bd477b3cc577f543cc3
2016-06-28 17:52:57 -07:00
Daniel Rosenberg 6c98509c34 Add Fastboot support for flashing secondary images
Fastboot update and flashall will now flash secondary
images if provided, and if the --slot flag is not set
to 'all'. Also added flash-primary to preserve the
previous behavior, and flash-secondary to just flash
the secondary images.

Bug: 29278988
Change-Id: Ia870e4be55617c0eefa4e1381287f8cd14affe7e
2016-06-28 17:41:46 -07:00
Elliott Hughes 7191a56e96 Merge \"Remove unnecessary ARRAY_SIZE macros.\"
am: c37d8ea22a

Change-Id: Id3443d7247e893ee549ae5b799a8f0bf42088d35
2016-06-29 00:16:44 +00:00
Daniel Rosenberg 190d968414 Handle invalid suffix lists
Some devices will report an error string as a value
when unknown variables are queried. This can lead to
unexpected behavior, so we attempt to detect this case
by seeing if the suffix list doesn't make sense.

Change-Id: I939b1e01c40ddc05d881fd54423406db250cc8e5
2016-06-28 16:01:00 -07:00
Elliott Hughes 749ae2d32f Remove unnecessary ARRAY_SIZE macros.
Use the canonical one instead.

Change-Id: Id80f19455f37fd2a29d9ec4191c1a0af80c5c0e7
2016-06-28 14:48:45 -07:00
Daniel Rosenberg 9c9a6c62e5 Call set_active after flashall and update
If the device has previously failed to boot, and the current slot is
marked as unbootable, we must call set_active to reenable the slot.

Bug: 29827625
Change-Id: I8b723dda80e246b48e5967aff4503c3d120bfb9b
2016-06-28 12:49:37 -07:00
Daniel Rosenberg 8c32da3943 Revert "Make fastboot flash 'B' partitions automatically."
This reverts commit 6c60ea8c45.
2016-06-27 16:46:50 -07:00
Daniel Rosenberg 9d6d096d0c Revert "Fix issue where non-AB-ota devices will cause flashall to fail."
This reverts commit d9ff210e63.
2016-06-27 16:46:29 -07:00
Alex Light be18ac56ae Fix issue where non-AB-ota devices will cause flashall to fail.
am: d9ff210e63

Change-Id: Ice8f096b5a4aecc015c7001e278984fd6324d47c
2016-06-17 00:31:14 +00:00
Alex Light d9ff210e63 Fix issue where non-AB-ota devices will cause flashall to fail.
We now check that a device has slots before trying to get the name of
any of them.

Bug: 29278988

Change-Id: I50f3596e467afae20177ce4e458e697435223c51
2016-06-16 15:22:22 -07:00
Alex Light a32dc7fe23 Merge \"Make fastboot flash \'B\' partitions automatically.\" into nyc-mr1-dev
am: a3ffde1402

Change-Id: I634486ddffcf7d734cf20341c364addd465304c7
2016-06-15 23:13:51 +00:00
Alex Light 6c60ea8c45 Make fastboot flash 'B' partitions automatically.
Also add ability to specify --slot active to suppress this behavior.

Bug: 29278988

Change-Id: I3ff184be74f9e2d1cb3abc80bd206b4b9faf8a35
2016-06-15 14:42:22 -07:00
Elliott Hughes 7f80f04a2c Merge "Report errno more often in fastboot." am: 8c5384e50b
am: 272b2694cd

* commit '272b2694cd3556120a3e39b88a0702103e2ed58a':
  Report errno more often in fastboot.

Change-Id: Ie26d2c70e65b70c08017f848f21fb91d6f20e3a4
2016-05-11 21:50:07 +00:00
Elliott Hughes 53ec495b40 Report errno more often in fastboot.
Change-Id: I4b4b47c584a146b38876a379f26ceb20d071c643
2016-05-11 12:39:27 -07:00
Elliott Hughes a73dfe0cf9 Merge "Use more std::string in fastboot." am: 17f3b1bad7
am: 05ec41963d

* commit '05ec41963d7e219a78ef9ffad6d1b1dcf5f4135c':
  Use more std::string in fastboot.

Change-Id: I819aefd792b1c3cd98403f0b25afa21717086e44
2016-04-29 17:58:07 +00:00
Elliott Hughes 2810d00dd9 Use more std::string in fastboot.
Change-Id: Ic8c77eac1e0088627ab650050d9c97c5749e5c39
2016-04-29 08:30:13 -07:00
Alex Deymo 1b245719f1 Merge "fastboot: Minor fix to help text."
am: 92a7043

* commit '92a70439d6767f577546ccf7baf215b113265ae0':
  fastboot: Minor fix to help text.
2016-03-25 04:49:37 +00:00
Alex Deymo f62d0cd943 fastboot: Minor fix to help text.
Help text had some missing end of line markers.

Bug: None
TEST=make out/host/linux-x86/bin/fastboot; fastboot

Change-Id: Iaa9e4e0a2d70c7d427f5e99e72fe1c2e2c26ee92
2016-03-24 19:51:05 -07:00
David Pursell 5a0ec81e97 fastboot: add UDP protocol.
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.

This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.

Usage:
  fastboot -s udp:<hostname>[:port] <command>

Bug: http://b/26154914

(cherry picked from commit 4601c978ca)

Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
2016-02-17 13:22:30 -08:00
David Pursell 22317f2b5a Merge "fastboot: add UDP protocol."
am: c7f43c6ae1

* commit 'c7f43c6ae16a475627e6b3da44dde1cad17ab45a':
  fastboot: add UDP protocol.
2016-02-10 20:03:48 +00:00
David Pursell 4601c978ca fastboot: add UDP protocol.
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.

This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.

Usage:
  fastboot -s udp:<hostname>[:port] <command>

Bug: http://b/26154914
Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
2016-02-10 10:21:30 -08:00
David Pursell bafd9f7e63 Merge "fastboot: add TCP protocol." am: 80dc9d8584
am: 6e2adac0c7

* commit '6e2adac0c76b6485ad7eda85f731bfb3f132658a':
  fastboot: add TCP protocol.
2016-02-03 22:07:22 +00:00
David Pursell 2ec418a4c9 fastboot: add TCP protocol.
This CL implements a TCP protocol for use with fastboot. Protocol
description is given in fastboot_protocol.txt, some examples of
expected behavior can also be found in tcp_test.cpp.

Usage is:
  fastboot -s tcp:<hostname>[:port] <command>

Bug: http://b/26558551
Change-Id: If53a514a534489c617db32c4fea8819949121282
2016-02-03 13:57:45 -08:00
Josh Gao 08550d5cc9 Merge "fastboot: show progress when sending sparse images." am: 6a27196516
am: 69c9274c3e

* commit '69c9274c3ea023a7d3505592fab99f87144a61dd':
  fastboot: show progress when sending sparse images.
2016-01-19 23:08:28 +00:00
Josh Gao 9da9ac5b2a fastboot: show progress when sending sparse images.
Bug: http://b/25443220
Change-Id: Ica0c88aea2a0661f39ff1415ebba464c037651da
2016-01-19 14:50:18 -08:00
Daniel Rosenberg ba3e38f9e1 Merge "fastboot: Add "--slot other"" am: 6bb8f752ec
am: abf108f6b2

* commit 'abf108f6b2cbcc4aaf7cea9719aff8b569245d60':
  fastboot: Add "--slot other"
2016-01-06 20:56:13 +00:00
Daniel Rosenberg ed60d0706e Merge "fastboot: correct set_active behavior" am: 275d091441
am: f88b8cbe15

* commit 'f88b8cbe157b4372d4f1277e85ed25315ecd6c30':
  fastboot: correct set_active behavior
2016-01-06 19:49:25 +00:00
Daniel Rosenberg c1743ba0d4 fastboot: Add "--slot other"
This allows you to flash to a slot other than the current one
without needing to enter the name of the slots.

Change-Id: I6bf8c29817be0a29b1abb005f1e72056cee126df
2016-01-06 19:42:01 +00:00
Daniel Rosenberg 15174d9bc7 fastboot: correct set_active behavior
Removed automatic reboot attached to set_active,
and fixed documentation error.

Change-Id: Idbb1639dc80870c17a6622dc78a7d78c88e268ab
2016-01-05 19:35:54 -08:00
Elliott Hughes 2e83684537 Merge "Share the new adb USB diagnostic code with fastboot." am: efd8c3289e
am: 40f80e25d3

* commit '40f80e25d3f399ece26d5f1ac145921ccb7f5f80':
  Share the new adb USB diagnostic code with fastboot.
2015-12-14 12:47:44 -08:00
Elliott Hughes 1b708d368f Share the new adb USB diagnostic code with fastboot.
Bug: http://b/26134129
Change-Id: Ieaf0651c7b3f8a028760982091ec63a21a5484ba
2015-12-14 10:50:21 -08:00
Daniel Rosenberg 589500fe2e resolve merge conflicts of b940309ec7 to master.
Change-Id: Icd6daa7385b8cd8c19f52dbc6805142e81b93dc9
2015-12-09 17:58:00 -08:00
Daniel Rosenberg 98a8257313 Merge "fastboot: Re-add set_active as a command." 2015-12-10 00:54:01 +00:00
Elliott Hughes ef119a14b8 Merge "Track rename of base/ to android-base/." am: 912ed3d8ca am: e2a9563be1
am: 3608ee5e90

* commit '3608ee5e903689ea7c433587be664649689816e1':
  Track rename of base/ to android-base/.
2015-12-07 23:59:44 +00:00
Daniel Rosenberg 9b432054dc fastboot: Re-add set_active as a command.
It turns out that adding a -- allows suffixes
starting with - to work fine, and there are
edge cases where calling set_active twice in
a command is useful, so the command version
has been re-added.

Change-Id: I528c258bf23ade61db530eb27586c1a1721896bc
2015-12-07 13:42:48 -08:00
Elliott Hughes 4f71319df0 Track rename of base/ to android-base/.
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-04 22:00:26 -08:00
Paul Crowley 8f7f56e25b Add --wipe-and-use-fbe option to fastboot for FBE userdata marker.
With this option, userdata is wiped and recreated with the
"convert_fbe" file in the root, which triggers conversion to FBE.

Bug: 25898323
Change-Id: I9347b7057b6278e7e6437504896b22c82dd01d89
2015-12-03 18:02:25 +00:00
David Pursell 0b15663830 fastboot: create Transport object (take 2).
(Second upload of this CL; original upload had the wrong version of
usb_windows.cpp that caused a compilation error. Fixed error and
re-tested.)

This CL creates a Transport object to provide a generic interface for
various transports. Specifically this is designed to be able to add UDP
support to fastboot in an upcoming CL without changing the main program
logic.

Also includes some minor code style fixes and replaces malloc/free
in the USB implementation files with smart pointers and std::string.

Bug: http://b/22029765
Change-Id: I1175bbce08690fbd15f51e68166be9b3e9973ea0
2015-11-16 09:31:07 -08:00
David Pursell 44c58471e4 Merge "Revert "fastboot: create Transport object."" 2015-11-14 00:18:43 +00:00
David Pursell c0504e1873 Revert "fastboot: create Transport object."
This broke some stuff, will look into it Monday.

This reverts commit 6f233a7799.

Change-Id: I155bc85d21fda3b0ba1e5e17839059797fb15509
2015-11-14 00:15:57 +00:00
David Pursell f131772a79 Merge "fastboot: create Transport object." 2015-11-13 22:49:08 +00:00