summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
AgeCommit message (Collapse)Author
2017-01-25Fix a crash when parsing fastboot command-line argumentsPavlin Radoslavov
Fix a crash when running "fastboot reboot bootloader" Test: Manual run "fastboot reboot bootloader" and "fastboot reboot emergency" Change-Id: I6d163a5b640afcae1dfa606f409e23ec5f499184
2017-01-24fastboot: add EDL mode supportAlexey Polyudov
reboot device into emergency download mode (if HW supports it) Change-Id: If068fdd041c5bdc7bf65515a78aabf18082cba2a Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-12-15fastboot: fix set_active for legacy A/B.David Pursell
Legacy A/B implementations use _a and _b slot names, but currently the set_active command is unconditionally stripping the _ prefix. This CL adds some code to add the _ back in if connected to a legacy A/B implementation. This isn't a complete fix (there are other places in the code that also unconditionally strip the prefix) but is sufficient for Android Things use case, and we want to keep this change as small and safe as possible to avoid breaking anything else. Bug: http://b/32996227 Test: `fastboot set_active _a` and `fastboot set_active a` works on both AndroidThings Edison board and Marlin. Test: AndroidThings Edison flashall script now completes successfully. Change-Id: I1a07e48b9e2726f386e9ece5267a9f1d8edefe22
2016-11-14Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for.Elliott Hughes
Bug: http://b/32878766 Test: boots Change-Id: Ie0ddfb7e60f2da5f6eefbb10c83a92e88c137ae3
2016-10-13Move off std::sto* function which abort on failure.Elliott Hughes
Bug: http://b/31403370 Test: builds, boots, libbase tests pass Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
2016-09-26Add fastboot --skip-reboot flagMitchell Wills
Add a flag to fastboot that will cause it to not reboot the device after performing commands like update and flashall. Fixed: 31743001 Test: run fastboot update with and without --skip-reboot flag Change-Id: I7f4056249a52779c7fc752c9d1009a58a44762df
2016-09-01Add android::base::GetExecutablePath, switch adb and fastboot over.Elliott Hughes
We'd long had two copies of this stuff, so rather than rewrite both Linux versions to use android::base::Readlink, let's kill the duplication too... Bug: http://b/30988271 Change-Id: I4de58a94a22a4b1faf969a6fc70ca1560a4d5121
2016-08-22resolve merge conflicts of 40eff95 to stage-aosp-masterDaniel Rosenberg
Change-Id: I91935ba9603ffd41af2009adc13a024701619c52
2016-08-19Add skip-secondary flagDaniel Rosenberg
The skip-secondary flag now replaces flash-primary. This flag will skip over the secondary images for both flashall and update. Change-Id: I9f380f3195006d325d6c45776bf79ecec17506ad (cherry-picked from commit e180929866b218b901ba2069615794f076d06b13)
2016-08-19Switch fastboot to new A/B specDaniel Rosenberg
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 (cherry-picked from commit 563fcf6f697c898cf35fa4a1b5672d6b4890c283)
2016-08-19Add Fastboot support for flashing secondary imagesAlex Light
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. Fixes from: I5bd2de1c1e0e6224a195b566f7dcbe383555a80a Bug: 29278988 Change-Id: Ia870e4be55617c0eefa4e1381287f8cd14affe7e (cherry-picked from commit 6c98509c34d152007cf953c2cacb5750745dd464)
2016-08-19Handle invalid suffix listsDaniel Rosenberg
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 (cherry-picked from commit 190d968414b3889441843e1bbebdf7acc2dc88c8)
2016-08-19Call set_active after flashall and updateDaniel Rosenberg
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 (cherry-picked from commit 9c9a6c62e5a6dde562a291a11602d4f32b2c1c80)
2016-08-12Merge "fastboot: Don't leak file in error case"Greg Kaiser
am: 3a197b3799 Change-Id: Ieaab2ed5c1619f75fa4c334d61afaf858ad7d46c
2016-08-12fastboot: Don't leak file in error caseGreg Kaiser
This is probably not very significant in this standalone tool, but makes it easier for us to find leaks in our other system code via static analysis. (cherry-pick of 407a2195391685627e6be947491041ae3c8cbe61.) Change-Id: I4e14cadc1e53bac0848e0e0c7f531f920e43cb0a
2016-08-01Merge \"Fix clang-tidy performance warnings in syste/core.\"Chih-Hung Hsieh
am: 4efbce14b5 Change-Id: I84f6b0134fae6e9f40710f243f4825e3f31fa15f
2016-08-01Fix clang-tidy performance warnings in syste/core.Chih-Hung Hsieh
* Use const reference type for parameters to avoid unnecessary copy. * Suppress warning of not using faster overloaded string find function. Bug: 30407689 Bug: 30411878 Change-Id: I6cfdbbd50cf5e8f3db6e5263076d3a17a9a791ee Test: build with WITH_TIDY=1 Merged-In: Ie79dbe21899867bc62031f8618bb1322b8071525
2016-06-29Merge \"Remove unnecessary ARRAY_SIZE macros.\"Elliott Hughes
am: c37d8ea22a Change-Id: Id3443d7247e893ee549ae5b799a8f0bf42088d35
2016-06-28Remove unnecessary ARRAY_SIZE macros.Elliott Hughes
Use the canonical one instead. Change-Id: Id80f19455f37fd2a29d9ec4191c1a0af80c5c0e7
2016-05-11Merge "Report errno more often in fastboot." am: 8c5384e50bElliott Hughes
am: 272b2694cd * commit '272b2694cd3556120a3e39b88a0702103e2ed58a': Report errno more often in fastboot. Change-Id: Ie26d2c70e65b70c08017f848f21fb91d6f20e3a4
2016-05-11Report errno more often in fastboot.Elliott Hughes
Change-Id: I4b4b47c584a146b38876a379f26ceb20d071c643
2016-04-29Merge "Use more std::string in fastboot." am: 17f3b1bad7Elliott Hughes
am: 05ec41963d * commit '05ec41963d7e219a78ef9ffad6d1b1dcf5f4135c': Use more std::string in fastboot. Change-Id: I819aefd792b1c3cd98403f0b25afa21717086e44
2016-04-29Use more std::string in fastboot.Elliott Hughes
Change-Id: Ic8c77eac1e0088627ab650050d9c97c5749e5c39
2016-03-25Merge "fastboot: Minor fix to help text."Alex Deymo
am: 92a7043 * commit '92a70439d6767f577546ccf7baf215b113265ae0': fastboot: Minor fix to help text.
2016-03-24fastboot: Minor fix to help text.Alex Deymo
Help text had some missing end of line markers. Bug: None TEST=make out/host/linux-x86/bin/fastboot; fastboot Change-Id: Iaa9e4e0a2d70c7d427f5e99e72fe1c2e2c26ee92
2016-02-10Merge "fastboot: add UDP protocol."David Pursell
am: c7f43c6ae1 * commit 'c7f43c6ae16a475627e6b3da44dde1cad17ab45a': fastboot: add UDP protocol.
2016-02-10fastboot: add UDP protocol.David Pursell
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-03Merge "fastboot: add TCP protocol." am: 80dc9d8584David Pursell
am: 6e2adac0c7 * commit '6e2adac0c76b6485ad7eda85f731bfb3f132658a': fastboot: add TCP protocol.
2016-02-03fastboot: add TCP protocol.David Pursell
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-01-19Merge "fastboot: show progress when sending sparse images." am: 6a27196516Josh Gao
am: 69c9274c3e * commit '69c9274c3ea023a7d3505592fab99f87144a61dd': fastboot: show progress when sending sparse images.
2016-01-19fastboot: show progress when sending sparse images.Josh Gao
Bug: http://b/25443220 Change-Id: Ica0c88aea2a0661f39ff1415ebba464c037651da
2016-01-06Merge "fastboot: Add "--slot other"" am: 6bb8f752ecDaniel Rosenberg
am: abf108f6b2 * commit 'abf108f6b2cbcc4aaf7cea9719aff8b569245d60': fastboot: Add "--slot other"
2016-01-06Merge "fastboot: correct set_active behavior" am: 275d091441Daniel Rosenberg
am: f88b8cbe15 * commit 'f88b8cbe157b4372d4f1277e85ed25315ecd6c30': fastboot: correct set_active behavior
2016-01-06fastboot: Add "--slot other"Daniel Rosenberg
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-05fastboot: correct set_active behaviorDaniel Rosenberg
Removed automatic reboot attached to set_active, and fixed documentation error. Change-Id: Idbb1639dc80870c17a6622dc78a7d78c88e268ab
2015-12-14Merge "Share the new adb USB diagnostic code with fastboot." am: efd8c3289eElliott Hughes
am: 40f80e25d3 * commit '40f80e25d3f399ece26d5f1ac145921ccb7f5f80': Share the new adb USB diagnostic code with fastboot.
2015-12-14Share the new adb USB diagnostic code with fastboot.Elliott Hughes
Bug: http://b/26134129 Change-Id: Ieaf0651c7b3f8a028760982091ec63a21a5484ba
2015-12-09resolve merge conflicts of b940309ec7 to master.Daniel Rosenberg
Change-Id: Icd6daa7385b8cd8c19f52dbc6805142e81b93dc9
2015-12-10Merge "fastboot: Re-add set_active as a command."Daniel Rosenberg
2015-12-07Merge "Track rename of base/ to android-base/." am: 912ed3d8ca am: e2a9563be1Elliott Hughes
am: 3608ee5e90 * commit '3608ee5e903689ea7c433587be664649689816e1': Track rename of base/ to android-base/.
2015-12-07fastboot: Re-add set_active as a command.Daniel Rosenberg
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-04Track rename of base/ to android-base/.Elliott Hughes
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-03Add --wipe-and-use-fbe option to fastboot for FBE userdata marker.Paul Crowley
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-11-16fastboot: create Transport object (take 2).David Pursell
(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-14Merge "Revert "fastboot: create Transport object.""David Pursell
2015-11-14Revert "fastboot: create Transport object."David Pursell
This broke some stuff, will look into it Monday. This reverts commit 6f233a7799a681e65c539e9c8287db0814c8948f. Change-Id: I155bc85d21fda3b0ba1e5e17839059797fb15509
2015-11-13Merge "fastboot: create Transport object."David Pursell
2015-11-13Fix fastboot to not add '-' before suffixDaniel Rosenberg
Change-Id: I9351b385412151498f47ab46a2620f21b9ac38b8
2015-11-13fastboot: create Transport object.David Pursell
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: I68641af0da7d13db4647f5e20a18d04d67f0b327
2015-11-12Merge changes I8fb6b513,I6dd16245,I0c2753e2Daniel Rosenberg
* changes: Update fastboot help command with long options Changed set_active to be a flag Fix fastboot variable name