Commit Graph

360 Commits

Author SHA1 Message Date
Daniel Rosenberg 2722208dd8 resolve merge conflicts of efa8604 to nyc-mr1-dev-plus-aosp
Change-Id: Ibacd9b1e0383887f02a009334aaa7b77b986790c
2016-07-15 19:46:41 -07:00
Daniel Rosenberg e180929866 Add skip-secondary flag
The skip-secondary flag now replaces flash-primary. This flag will
skip over the secondary images for both flashall and update.

Change-Id: I9f380f3195006d325d6c45776bf79ecec17506ad
2016-07-15 16:57:53 -07:00
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
Chih-Hung Hsieh 3f646c24a9 Merge \\\"Fix misc-macro-parentheses warnings in system/core.\\\" am: 495541c5bb am: 65828a0ec9
am: 4a8ab16746

Change-Id: I5ba2a6d0813eb728f5863801a36de6a012a8242a
2016-06-22 23:05:59 +00:00
Chih-Hung Hsieh 65828a0ec9 Merge \"Fix misc-macro-parentheses warnings in system/core.\"
am: 495541c5bb

Change-Id: I021b653779c5119398c31ee354372366ba029328
2016-06-22 22:39:07 +00:00
Chih-Hung Hsieh cdb2ca5d9f Fix misc-macro-parentheses warnings in system/core.
Add parentheses around macro arguments used beside operators.
Bug: 28705665

Change-Id: I9226f319e283be640eddc31687f75b51a8ef0ac6
2016-06-22 14:33:13 -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
Chih-hung Hsieh fb44ca5178 Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

* commit '427d8d840f6ec5ce5767b2ee521e4ac5b7ebd619':
  Fix google-explicit-constructor warnings.

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
2016-04-30 05:16:35 +00:00
Chih-hung Hsieh 7bdd6a8b5a Merge "Fix google-explicit-constructor warnings." 2016-04-30 05:10:05 +00:00
Chih-Hung Hsieh 1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -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
Elliott Hughes 32fed55e81 Merge "GCC compiler warning fix for sprintf into snprintf" am: d2afbe4
am: 3b4af9a

* commit '3b4af9a44dd6ffa724dfb5f40479f817efc74227':
  GCC compiler warning fix for sprintf into snprintf

Change-Id: I76d8892909721d7218112f5d360eca91ae686e84
2016-04-25 21:20:15 +00:00
Raja M 79bf64dc66 GCC compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building.
or
To support error free -D_FORTIFY_SOURCE=2 strict mode compilation.
2016-04-24 09:44:04 +05:30
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
Ying Wang f48503b4a0 Also archive adb.exe/fastboot.exe when building win_sdk.
On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
(cherry picked from commit 71edfc8b9a)
2016-03-03 15:46:50 -08:00
Ying Wang 3905db7616 Merge "Also archive adb.exe/fastboot.exe when building win_sdk." am: f666ba41a7
am: aa88fa5837

* commit 'aa88fa58371930b9b7aef8d942f72d7b9a29c8a7':
  Also archive adb.exe/fastboot.exe when building win_sdk.
2016-03-01 19:50:46 +00:00
Ying Wang 71edfc8b9a Also archive adb.exe/fastboot.exe when building win_sdk.
On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
2016-02-29 19:27:06 -08:00
James Hawkins 22b6f7a559 resolve merge conflicts of 0f5d443d0c to nyc-dev-plus-aosp
Change-Id: I850bda0808ae17ade5bc0e667211a599d284d6e3
2016-02-19 11:10:30 -08:00
James Hawkins 588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
David Pursell 022d8f5885 fastboot: fix TCP protocol version check.
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.

This CL fixes the protocol version check and adds corresponding unit
tests.

Bug: http://b/27220700

(cherry picked from commit aad72a533f)

Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
2016-02-17 13:22:40 -08: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 8bcce68f10 fastboot: add Socket timeout detection.
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914

(cherry picked from commit c742a7f174)

Change-Id: I339d42fc40d853ee48d1b457d06b67faf5799d91
2016-02-17 13:22:17 -08:00
David Pursell 7b3b490fe2 Merge "fastboot: fix TCP protocol version check."
am: bcaeb78f63

* commit 'bcaeb78f63efb1daa83b5ed43aca9775ac1014b3':
  fastboot: fix TCP protocol version check.
2016-02-17 18:25:22 +00:00
David Pursell aad72a533f fastboot: fix TCP protocol version check.
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.

This CL fixes the protocol version check and adds corresponding unit
tests.

Bug: http://b/27220700
Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
2016-02-17 10:00:09 -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 09bd9593f0 Merge "fastboot: add Socket timeout detection."
am: d4ac11a57d

* commit 'd4ac11a57d37c56360e59ba75aa2f6ee777e5ed8':
  fastboot: add Socket timeout detection.
2016-02-08 19:00:39 +00:00