summaryrefslogtreecommitdiffstats
path: root/fastboot/fastboot.c
Commit message (Collapse)AuthorAgeFilesLines
* am fafbd329: am ba1552bd: Merge "Clarify the strcmp() with the empty string."Stephen Hines2014-11-271-1/+1
|\ | | | | | | | | * commit 'fafbd329cb1685dc91172230a0671175e80ca8b3': Clarify the strcmp() with the empty string.
| * Clarify the strcmp() with the empty string.Stephen Hines2014-11-261-1/+1
| | | | | | | | Change-Id: Ie246b3c2de3f19b95693f634b0ebd46bdcf3962b
* | am 8d49c8b0: am f66486ef: Merge "Fix incorrect path name check."Stephen Hines2014-11-271-1/+1
|\ \ | |/ | | | | | | * commit '8d49c8b0bfdc7bed855acec603bacc355b5bcb8c': Fix incorrect path name check.
| * Merge "Fix incorrect path name check."Stephen Hines2014-11-261-1/+1
| |\
| | * Fix incorrect path name check.Stephen Hines2014-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was caught by clang 3.6's -Wpointer-bool-conversion. The device_path field is a char[256], and thus never NULL. The intention for this code was to check whether or not there is a named path at all. Checking whether this is an empty string matches the original intent. Change-Id: I5ccedc03167e6a457e472089de26130aff7f96e3
* | | am 87fdfc71: am cb321921: Merge "fastboot: add parameter for unbuffered ↵Elliott Hughes2014-11-251-1/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | stderr/stdout" * commit '87fdfc718e9eccdd9c40e7bca7a48af40b6bf732': fastboot: add parameter for unbuffered stderr/stdout
| * | fastboot: add parameter for unbuffered stderr/stdoutFlorian Bäuerle2014-11-241-1/+9
| |/ | | | | | | | | | | | | | | This is useful for writing Windows GUIs that want to parse the output of fastboot before it exits. Change-Id: Ic0171fe379fc4db7b65b1501e5f2e771ac7c62c4 Signed-off-by: Florian Bäuerle <florian.bae@gmail.com>
* | am 24e834ab: am 81b857f3: Merge "fastboot: Remove tos from flashall" into ↵Daniel Rosenberg2014-09-161-4/+1
|\ \ | |/ | | | | | | | | | | lmp-dev * commit '24e834ab6037cee0d3e8569d5fd45695f86865bd': fastboot: Remove tos from flashall
| * fastboot: Remove tos from flashallDaniel Rosenberg2014-09-151-4/+1
| | | | | | | | | | | | bug: 17498561 Change-Id: I0190c1a5ac635375404799c040e4be523fa29622 Signed-off-by: Daniel Rosenberg <drosen@google.com>
| * fastboot: add the support of the second stage image [DO NOT MERGE]Jeremy Compostella2014-08-151-13/+32
|/ | | | | | | | | | The AOSP bootimage format allows the use of a second stage image however the fastboot boot and flash:row commands do not allow the "secondstage" optional argument. This patch adds the support of this argument for both commands. Change-Id: I00403a95d7460a00233841ba0fe0e8a69d78c7b4 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
* am 47050442: am 31132182: am 07703339: Merge "Wait for device to disappear ↵JP Abgrall2014-06-251-0/+1
|\ | | | | | | | | | | | | after "fastboot reboot"." * commit '4705044243225ffde88910154485a84c27a33709': Wait for device to disappear after "fastboot reboot".
| * Wait for device to disappear after "fastboot reboot".Mark Wachsler2014-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | This is a follow-up to commit 157b00171a06f9ac2fd25ee3a86e801e896713d6. After "fastboot reboot", "fastboot devices" was still showing the device as connected even though it was starting to reboot; now "fastboot reboot" will wait until the device has disconnected. The wait timeout is 3 seconds. Change-Id: I8066741f0be91e53f3e3f5bc968bc1b9de31db05
* | Added support for vendor partition and imageDaniel Rosenberg2014-06-241-2/+5
|/ | | | | | | | Modified fastboot to flash vendor.img as well. Moved symlink for /vendor to occur after mounting partitions. Changed mount to also create the mount point. Change-Id: I78e1ba24e6bb8b4af96a67ee0569af579439e682 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* Fix host 64-bit build.Ying Wang2014-05-161-1/+2
| | | | | Bug: 13751317 Change-Id: Ib42d24408d053bacc24142ed18fc5f3181d2345b
* fastboot: turn on -WerrorMark Salyzyn2014-05-141-21/+15
| | | | | | | | | - Deal with a missing initializer issue - Deal with some -Wunused issues - Deal with some signed/unsigned issues - switch to usleep from sleep to facilitate win_sdk compile Change-Id: I64e32a5b0782aeed9582f489e866173c4df1afbf
* Revert "System: Fastboot: warning fixit, misc bugs and cleanup."Alexander Levitskiy2014-05-071-49/+50
| | | | | | This reverts commit 782111b3bc5d372afc8d66ab6023e834b7c23b88. Change-Id: Ib66400dfaeef7f01e6461a57b9f09be08de2f1fe
* System: Fastboot: warning fixit, misc bugs and cleanup.Sasha Levitskiy2014-05-071-50/+49
| | | | | Change-Id: Ib8517a852977962de3f05c879ba7dce89bcef644 Signed-off-by: Sasha Levitskiy <sanek@google.com>
* fastboot: support for overriding format fs-type and sizeJP Abgrall2014-05-061-14/+63
| | | | | | | | | | This changes allows overriding the fs-type and size that are normally returned by the booloader. This is in preparation for supporting other FSes. Change-Id: I8d141a0d4d14df9fe84d3b131484e9696fcd8870 Signed-off-by: JP Abgrall <jpa@google.com>
* fastboot: Added tos as an optional imageDaniel Rosenberg2014-05-061-2/+5
| | | | | Change-Id: Ibff1f74ee4a949501ceae0b897f896067f022763 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* fastboot: Fixed optional entriesDaniel Rosenberg2014-05-061-1/+1
| | | | | | | | | Previously, if an image was listed as optional, but was not found, flashall would fail. Now it will proceed if optional images are not present. Change-Id: Ic82595cf0cd6ddce4c676de590f03f1a95f32040 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* fastboot: allow format on devices with small buffersDmitry Grinberg2014-05-061-3/+74
| | | | | | | | | | Formatting large partitions on devices with small transfer buffers did not work before since format used a strange path through the code to send data. It now uses the normal path. Also cleaned up a bit. FS code now lives in a separate file and the custom path for format is gone. Change-Id: If4e01cabc2e250b7c02ca7ce8c268e51d49e1529
* fastboot: Make tags_offset a command line option.Mohamad Ayyash2014-05-011-1/+5
| | | | | cherry picked from commit bdf513c5f25b3c2051af737c37a7734c4559208e Change-Id: I4ceca528f88cc8ede5742f8a67bec972e41eebe7
* Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEADThe Android Open Source Project2013-11-221-100/+171
|\ | | | | | | Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
| * fastboot: add support for sparse images in flashall and updateRom Lemarchand2013-07-011-95/+171
| | | | | | | | | | Change-Id: I66a73b16a988a65fc91fb22a26d11986025089de Signed-off-by: Rom Lemarchand <romlem@google.com>
| * fastboot: Remove legacy MINGW workaroundsRom Lemarchand2013-06-281-9/+4
| | | | | | | | | | | | | | | | The version of MINGW we compile with has more advanced POSIX support. Removing legacy MINGW workarounds as those are not needed anymore. Change-Id: Id5d67176b719db6c3667be6d63c41432e0ba9f30 Signed-off-by: Rom Lemarchand <romlem@google.com>
* | Fix a bunch of small system/core bugs.Elliott Hughes2013-10-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing frees in: adb/file_sync_client.c fastboot/fastboot.c libsparse/output_file.c Missing closedirs in: adb/file_sync_service.c cpio/mkbootfs.c libcutils/dir_hash.c Potential buffer overrun in: gpttool/gpttool.c Incorrect NULL check in: libsparse/backed_block.c Bug: https://code.google.com/p/android/issues/detail?id=61564 Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
* | Wait for device to disappear after reboot-bootloader.Mark Wachsler2013-10-171-12/+1
|/ | | | | | | | | | | | | | | | (Linux only for now) With fastboot reading serial numbers from sysfs, it had become possible for a fastboot command issued immediately after rebooting the bootloader to fail, because sysfs still thought the device was online. To prevent this, after reboot-bootloader we wait for the device to disconnect. Also made usb_read and usb_write fail immediately if the descriptor has been closed; this prevents an incorrect error message ("Bad file descriptor") when errors from fb_getvar are ignored (e.g., by fb_format_supported). Also removed unused fd param from filter_usb_device, and simplified logic in usb_write by using do/while instead of a special case for len == 0. Change-Id: I799b857eab411fd8ad25f5777fc61c685152ea86
* fastboot: add support for some obscure args.JP Abgrall2013-03-071-45/+67
| | | | | | | | | | | | Some devices use mkbootimg with weird args for which fastboot only a hardcoded value. Now fastboot recognizes those args. Made handling of global vars more consistent. Bug: 8341331 Change-Id: Ic09f148ccd0249f49935fdc63e517cf8ab2229bc
* Update fastboot to wipe ext4 partitions before flashingKen Sumrall2012-10-021-7/+55
| | | | | | | | | | To prevent false error reports from e2fsck, update fastboot to erase a partition identified as being ext4 partition before flashing an image to it. bug: 7259359 Change-Id: I85e9963aa8247b4b33fdd57f994cdb3ee72b670f
* fastboot: move help command before usb connectColin Cross2012-08-291-3/+5
| | | | | | | | Move the help command handling before the call to open_device so that is doesn't block when no device is connected. Bug: 7078873 Change-Id: I4e9a4317bd72b4ceb4b9fc838eafd2e57b17a473
* am 94938c9d: am ed2e672f: Merge "Print strerror for file read errors during ↵Jean-Baptiste Queru2012-08-201-8/+11
|\ | | | | | | | | | | | | flashing" * commit '94938c9d60d6467ec40df4254beadc50bb787934': Print strerror for file read errors during flashing
| * Merge "Print strerror for file read errors during flashing"Jean-Baptiste Queru2012-08-201-8/+11
| |\
| | * Print strerror for file read errors during flashingMatt Gumbel2012-07-261-8/+11
| | | | | | | | | | | | | | | | | | Change-Id: I7390867abd00036f19eb4d1a1ce23aa0aca50674 Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com> Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* | | am 36f2e2ac: am 23ee469c: Merge "fastboot: change default sparse limit to ↵Colin Cross2012-07-241-4/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | disabled" * commit '36f2e2ac96f8b2163a37773f5cb92cfff75dede2': fastboot: change default sparse limit to disabled
| * | fastboot: change default sparse limit to disabledColin Cross2012-07-241-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change the default sparse limit to disabled to prevent resparsing files unless the bootloader or user specifies a sparse limit. Some bootloaders issue an erase before every flash command, which causes earlier parts of the downloaded image to get erased. Change-Id: Iac6f3b05580aba8b82ed0f2f800979a49c33c691
* | | am cecc3186: am f650c075: Merge "fastboot: check argc before using argv"Colin Cross2012-07-241-1/+1
|\ \ \ | |/ / | | | | | | | | | * commit 'cecc3186ca18ddf7a2d43a12353c45a81ab2baca': fastboot: check argc before using argv
| * | fastboot: check argc before using argvColin Cross2012-07-241-1/+1
| |/ | | | | | | | | | | | | | | "fastboot -w" would segfault because *argv was invalid when no non-option arguments were specified. Check argc > 0 before dereferencing argv. Change-Id: I822a799e6a38e4e5c0a4eca48c6343b8a08a6185
* | resolved conflicts for merge of 4d72d881 to masterColin Cross2012-07-171-56/+257
|\ \ | |/ | | | | Change-Id: Ic092d27d3fc2bcc4db8a375bbcb5b86c111bf062
| * fastboot: add support for auto-resparsing large filesColin Cross2012-07-091-5/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to fastboot for automatically using libsparse to break large files, whether they are in sparse or normal format, into multiple sparse files that can each fit into the target's memory. Allows flashing images that are larger than the size of the available memory on the target. By default, any file over 512MB will be sparsed into 512MB chunks. The limit can be modified with the -m argument, or sparsing can be forced with -S or avoided with -N. If -m is not specified, the target can override the default by implementing getvar:max-download-size Change-Id: I6c59381c3d24475c4f2587ea877200b96971cbd7
| * fastboot: use getopt_longColin Cross2012-07-091-46/+62
| | | | | | | | | | | | | | | | | | | | | | Modify the fastboot argument parsing to use getopt_long. This simplifies argument parsing, and permutes all the commands to the end of argv to allow parsing them later. Also moves usb initailization between argument and command processing, to allow commands to query parameters over usb. Change-Id: I883572f52c4190c80ee3b4aa4511ea2061a6b734
* | fastboot: Let "fastboot devices" work in all casesJP Abgrall2012-06-061-3/+8
| | | | | | | | | | | | | | | | | | | | | | Ignore ANDROID_SERIAL when requesting to list devices, or else it is impossible to list devices without unsetting the env var. Even ANDROID_SERIAL= fastboot devices or fastboot -s "" devices won't work. Change-Id: Ie92f35bda852c6ecea4ebaefb75b8f18c10b6d0c
* | am 866b1bd5: fastboot: Make the format of "devices -l" match adb\'sScott Anderson2012-06-051-6/+4
|\ \ | | | | | | | | | | | | * commit '866b1bd5051db4f22b634df1f8a06bc1c9aa2e26': fastboot: Make the format of "devices -l" match adb's
| * | fastboot: Make the format of "devices -l" match adb'sScott Anderson2012-06-051-6/+4
| | | | | | | | | | | | | | | Change-Id: Iec7b02fee8298a4437d1827623e9f61688a73f42 Signed-off-by: Scott Anderson <saa@android.com>
* | | am 177a74ac: am c1f88106: Merge "fastboot: Change -w to format after the ↵JP Abgrall2012-05-141-1/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | erase of userdata & cache" into jb-dev * commit '177a74aced971b89c319fb61ee12da0ca40f0c12': fastboot: Change -w to format after the erase of userdata & cache
| * | fastboot: Change -w to format after the erase of userdata & cacheJP Abgrall2012-05-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the bootloader doesn't support formatting of those partitions (either because it doesn't support the getvar commands needed or the partition type is not supported), the errors are printed but doesn't halt processing of subsequent commands. Change-Id: I816ac2e5e7593846fcb4fd39c793a8dbdd996f6f Signed-off-by: Mike J. Chen <mjchen@google.com>
* | | resolved conflicts for merge of 13081c69 to masterScott Anderson2012-05-011-10/+30
|\ \ \ | |/ / |/| / | |/ Change-Id: I631e466fc53e9b0f4a39f24f959b4ae9b626bdda
| * fastboot: Add ability to specify device pathScott Anderson2012-04-191-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For manufacturing and testing, there is a need to talk to whatever device is connected to a given port on the host. This change modifies fastboot's "-s" option to take either a serial number or a device path. The device paths of the connected devices can be listed using "fastboot -l devices" whose output will resemble: 016B75D60A00600D usb:2-5 fastboot AD3C12020173 usb:1-4.3 fastboot The second column lists the device paths. If the -l option is not given, the output from "fastboot devices" will be the same as it used to be (i.e. the paths will not be printed). Finally, note that the format of the device paths are platform dependent. The example above is from Linux. On OS-X, the paths will be "usb:" followed by hex digits. For Windows, the device paths will be printed as "????????????" and the -s option will not be able to select a device until someone implements the underlying functionality in usb_windows.c. Change-Id: I1f01b8f47acd32edb0ac18db107316a2c923bbde Signed-off-by: Scott Anderson <saa@android.com>
| * DO NOT MERGEMike J. Chen2012-02-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | fastboot: Change -w to format after the erase of userdata & cache If the bootloader doesn't support formatting of those partitions (either because it doesn't support the getvar commands needed or the partition type is not supported), the errors are printed but doesn't halt processing of subsequent commands. Change-Id: I816ac2e5e7593846fcb4fd39c793a8dbdd996f6f Signed-off-by: Mike J. Chen <mjchen@google.com>
| * Implement 'fastboot format' commandAnatol Pomazau2012-02-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some filesystems (e.g. ext4) require flushing an initial fs image, right after erasing it the partition is unusable. Doing erase,flush emptyfs is a little bit scaring so we have a separate command that performs it as atomic step: - get size of partition - create an empty filesystem image - erase the partition - flush empty fs to the partition This command applicable only for ext4 filesystem and checks the partition type before formatting it. Change-Id: I8529bc1dc64698f1f0d91312f7c0ab1a6e5d8b44
* | am f1ab88c2: am 73c019b3: Add asus vendor idRamanan Rajeswaran2012-02-271-0/+1
|\ \ | | | | | | | | | | | | * commit 'f1ab88c23460a608cd6d6f6492fb2b039405c0f2': Add asus vendor id