Commit graph

67 commits

Author SHA1 Message Date
Rom Lemarchand
c9cce4b981 fastboot: Remove legacy MINGW workarounds
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>
2013-06-28 17:00:41 -07:00
JP Abgrall
7b8970c577 fastboot: add support for some obscure args.
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
2013-03-07 17:06:41 -08:00
Ken Sumrall
5ee5d389d6 Update fastboot to wipe ext4 partitions before flashing
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
2012-10-02 19:10:51 -07:00
Colin Cross
c7b75dcc1a fastboot: move help command before usb connect
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
2012-08-29 18:21:06 -07:00
Jean-Baptiste Queru
bb0d0721e6 am 94938c9d: am ed2e672f: Merge "Print strerror for file read errors during flashing"
* commit '94938c9d60d6467ec40df4254beadc50bb787934':
  Print strerror for file read errors during flashing
2012-08-20 10:29:39 -07:00
Jean-Baptiste Queru
ed2e672f3b Merge "Print strerror for file read errors during flashing" 2012-08-20 09:19:09 -07:00
Matt Gumbel
64ba258b7a Print strerror for file read errors during flashing
Change-Id: I7390867abd00036f19eb4d1a1ce23aa0aca50674
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-07-26 10:19:05 -07:00
Colin Cross
a7a64579c2 am 36f2e2ac: am 23ee469c: Merge "fastboot: change default sparse limit to disabled"
* commit '36f2e2ac96f8b2163a37773f5cb92cfff75dede2':
  fastboot: change default sparse limit to disabled
2012-07-24 18:54:18 -07:00
Colin Cross
a2b3ded589 am cecc3186: am f650c075: Merge "fastboot: check argc before using argv"
* commit 'cecc3186ca18ddf7a2d43a12353c45a81ab2baca':
  fastboot: check argc before using argv
2012-07-24 18:54:17 -07:00
Colin Cross
0bbfb3976e fastboot: change default sparse limit to disabled
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
2012-07-24 18:07:18 -07:00
Colin Cross
8fb6e06ba4 fastboot: check argc before using argv
"fastboot -w" would segfault because *argv was invalid when no
non-option arguments were specified.  Check argc > 0 before
dereferencing argv.

Change-Id: I822a799e6a38e4e5c0a4eca48c6343b8a08a6185
2012-07-24 16:37:52 -07:00
Colin Cross
9a70e5c338 resolved conflicts for merge of 4d72d881 to master
Change-Id: Ic092d27d3fc2bcc4db8a375bbcb5b86c111bf062
2012-07-17 23:35:49 -07:00
Colin Cross
f838788e6a fastboot: add support for auto-resparsing large files
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
2012-07-09 22:17:58 -07:00
Colin Cross
8879f988ba fastboot: use getopt_long
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
2012-07-09 22:16:55 -07:00
JP Abgrall
a032dedefe fastboot: Let "fastboot devices" work in all cases
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
2012-06-06 11:53:33 -07:00
Scott Anderson
dd32794a29 am 866b1bd5: fastboot: Make the format of "devices -l" match adb\'s
* commit '866b1bd5051db4f22b634df1f8a06bc1c9aa2e26':
  fastboot: Make the format of "devices -l" match adb's
2012-06-05 16:21:04 -07:00
Scott Anderson
866b1bd505 fastboot: Make the format of "devices -l" match adb's
Change-Id: Iec7b02fee8298a4437d1827623e9f61688a73f42
Signed-off-by: Scott Anderson <saa@android.com>
2012-06-05 11:13:45 -07:00
JP Abgrall
3447b11d3e am 177a74ac: am c1f88106: Merge "fastboot: Change -w to format after the erase of userdata & cache" into jb-dev
* commit '177a74aced971b89c319fb61ee12da0ca40f0c12':
  fastboot: Change -w to format after the erase of userdata & cache
2012-05-14 08:35:13 -07:00
JP Abgrall
30ae5806e9 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>
2012-05-07 20:25:24 -07:00
Scott Anderson
a61bcad58b resolved conflicts for merge of 13081c69 to master
Change-Id: I631e466fc53e9b0f4a39f24f959b4ae9b626bdda
2012-05-01 18:34:22 -07:00
Scott Anderson
13081c6915 fastboot: Add ability to specify device path
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>
2012-04-19 11:59:09 -07:00
Ramanan Rajeswaran
c4ddca25e0 am f1ab88c2: am 73c019b3: Add asus vendor id
* commit 'f1ab88c23460a608cd6d6f6492fb2b039405c0f2':
  Add asus vendor id
2012-02-27 12:00:45 -08:00
Ramanan Rajeswaran
f1ab88c234 am 73c019b3: Add asus vendor id
* commit '73c019b30a7c70c50d2a854982143d5eb8c74f8c':
  Add asus vendor id
2012-02-27 11:59:20 -08:00
Ramanan Rajeswaran
73c019b30a Add asus vendor id
Change-Id: I6d10b1788903aba526af7f654b12c302c3e9fc89
2012-02-24 13:00:34 -08:00
Anatol Pomazau
c8ba5366da Implement 'fastboot format' command
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: I8529bc3485739487f0d91312f7c0ab1a6e5d8b44
2012-02-17 16:29:58 -08:00
Mike J. Chen
714052ba4d DO NOT MERGE
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>
2012-02-16 09:32:42 -08:00
Mike Lockwood
ca2074b78d Revert "Implement 'fastboot format' command"
until Windows support is done

This reverts commit 452e11885a.
2012-02-13 09:57:19 -08:00
Anatol Pomazau
452e11885a Implement 'fastboot format' command
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: Ifa42deaa66c3cb96ff786a73c3fadad92658f395
2012-02-11 11:02:40 -08:00
Anatol Pomazau
6f53225ef9 Revert "Implement 'fastboot format' command"
This reverts commit 230d160a71
2012-02-03 18:20:02 -08:00
Anatol Pomazau
230d160a71 Implement 'fastboot format' command
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: I8529bc1dc64237f1f0d91312f7c0ab1a6e5d8b44
2012-02-03 16:07:18 -08:00
Anatol Pomazau
21311f87c6 Revert "Implement 'fastboot format' command"
This reverts commit 049dff53ef
2012-02-03 10:57:46 -08:00
Anatol Pomazau
65cf84f3ff Implement 'fastboot format' command
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
2012-02-03 10:29:56 -08:00
Anatol Pomazau
049dff53ef Implement 'fastboot format' command
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
2012-01-25 13:55:39 -08:00
Xavier Ducrohet
46f86f11d4 am 0c054095: am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.
* commit '0c05409510037fd7372c3fe7ab240ebf33b15831':
  Add USB vendor IDs for Quanta, INQ and Sony.
2012-01-24 11:32:19 -08:00
Xavier Ducrohet
0c05409510 am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.
* commit '746f3243f6d30ab51a36dcfea76eac3ba29ac625':
  Add USB vendor IDs for Quanta, INQ and Sony.
2012-01-24 11:29:50 -08:00
Xavier Ducrohet
746f3243f6 Add USB vendor IDs for Quanta, INQ and Sony.
Change-Id: I224e067d9a64e8e9e7afbad0760a4b07f965bf83
2012-01-24 11:18:50 -08:00
Jean-Baptiste Queru
38412163da am 70580b20: am 149ae11f: Merge "adb,fastboot: add USB support for Intel Vendor ID"
* commit '70580b20bc8485002df0b3e89e42754c8c9796ff':
  adb,fastboot: add USB support for Intel Vendor ID
2012-01-24 08:49:05 -08:00
Wu, Hao
f60e863828 adb,fastboot: add USB support for Intel Vendor ID
This patch adds Intel USB Vendor ID into the support
list for adb and fastboot.

Signed-off-by: Wu, Hao <hao.wu@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
2012-01-17 12:08:06 -08:00
Jean-Baptiste Queru
d7608a40d6 Flash cache partition with cache.img by default.
Bug: 5153694
Change-Id: If322d13286e9b0f14877d1a4f03f6bd288ee71f3
2011-09-30 14:39:25 -07:00
Wink Saville
b98762f782 Teach fastboot to allow required variables per product.
This is needed for products like xoom-cdma and xoom-cdma-lte.
The xoom-cdma-lte product requires an lte baseband binary but
it's not needed for xoom-cdma.

This is implemented by allowing an optional product parameter
to "required" statements. The parameter is separated from
"required" by a colon so the version-baseband-2 requirment in
board-info.txt for stingray becomes:

 require-for-product:xoom-cdma-lte version-baseband-2=ltedc_u_03.25.00|ltedc_u_03.19.00

In the above statement, only xoom-cdma-lte requires version-baseband-2
and the baseband can be lte_u_03.25.00 or lte_u_03.19.00. For other
products version-baseband-2 will be ignored.


Change-Id: I786bec5f5661c2243d87925b064fc6124d3cffa1
2011-04-04 17:54:59 -07:00
JP Abgrall
2d13d1408b fastboot: fix arg handling causing no-op.
Change-Id: I89d4a6d14e542d8f2d7832d94b0a7cee6eb88305
2011-03-01 23:35:07 -08:00
Tsu Chiang Chuang
ee52055ae5 Add explicit 'help' command to fastboot.
Change-Id: I350feab372e105755509c81604d57b2de1a69163
2011-02-25 18:38:53 -08:00
Jean-Baptiste Queru
512405a421 am f1c2a735: Merge "fastboot: Add help message for continue command"
* commit 'f1c2a7352f19cf729f91bf2559fc93ef12c74dca':
  fastboot: Add help message for continue command
2010-12-29 16:01:55 -08:00
Bruce Beare
24ce4bc8d7 fastboot: Add help message for continue command
Change-Id: I578b1b7c2d74d09d44ce9100bfe582aaa25c31b1
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2010-12-29 13:11:53 -08:00
Dima Zavin
c09b7cf1c9 am 509f7399: fastboot: Add more vendor usb ids 2010-05-14 14:52:40 -07:00
Dima Zavin
509f7399b8 fastboot: Add more vendor usb ids
Change-Id: Ied48302b50412f27dcf49d40913e4b900f3bd153
Signed-off-by: Dima Zavin <dima@android.com>
2010-05-14 14:48:39 -07:00
Brian Carlstrom
eb31c0bdc0 fastboot should return non-zero exit code on error
When using fastboot in scripts, it currently is necessary to parse the
output for FAILED messages and possible other indications of
error. This happens relatively often, for example when there are radio
update issues. Fortunately, fb_execute_queue already has a notion that
an error has occured which is used to abort the queue execution.

This change makes the status value be returned from fb_execute_queue
to main which can then return it as an exit status. usage cases were
also changed to return 1.

Note the code already returned 1 for error in one other case when
there was a problem with boot, so there is a precedent for return 1 on
error in this program.

Change-Id: Ib0463b08c8f2569495e248dd84e331f7e3691039
2010-04-23 12:45:38 -07:00
Dima Zavin
931175a1c5 fastboot: add nand page size param, used for boot and flash:raw commands
Change-Id: I07451363f4d4ac8665598722491968e6ee0953ee
Signed-off-by: Dima Zavin <dima@android.com>
2010-02-16 09:40:05 -08:00
Jean-Baptiste Queru
2f3d96ee5b resolved conflicts for merge of 20f410a4 to master
Change-Id: I187f29848c223c8c548323e0fa20ea0f3b8a3909
2010-01-28 07:38:15 -08:00
Android Git Automerger
20f410a418 resolved simple conflict with dc9cf66c 2010-01-21 18:06:39 -08:00