Commit graph

279 commits

Author SHA1 Message Date
JP Abgrall
7e85974fc2 fastboot: support for overriding format fs-type and size
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>
2014-05-06 15:14:15 -07:00
Daniel Rosenberg
73a4ad288f fastboot: Added tos as an optional image
Change-Id: Ibff1f74ee4a949501ceae0b897f896067f022763
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-05-06 12:28:41 -07:00
Daniel Rosenberg
82280594ef fastboot: Fixed optional entries
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>
2014-05-06 12:28:39 -07:00
Dmitry Grinberg
e6f3e9bd26 fastboot: allow format on devices with small buffers
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
2014-05-06 12:28:37 -07:00
JP Abgrall
8e26b25222 Merge "Fastboot: fix fastboot timeout issue of Windows host side" 2014-05-06 02:24:19 +00:00
Mohamad Ayyash
29fd7b1f4f fastboot: Make tags_offset a command line option.
cherry picked from commit bdf513c5f2

Change-Id: I4ceca528f88cc8ede5742f8a67bec972e41eebe7
2014-05-01 20:31:29 +00:00
Jiebing Li
bbb7981e49 Fastboot: fix fastboot timeout issue of Windows host side
Normally fastboot follows the procedure that host sends a command
to device and device sends back response after the command
is executed.

But sometimes device spends too long time to execute the command
so that timeout error occurs before host receives the response.

This patch fixes the issue by aligning with the solution of ADB.
ADB commit id: 1c4b760a5d

Change-Id: I50e6bf428ea38219b64cca6ab82db22af28e0264
Author: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
2014-04-25 14:15:08 +08:00
The Android Open Source Project
66ed50af68 Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEAD
Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
2013-11-22 13:44:43 -08:00
Elliott Hughes
14e28d39f7 Fix a bunch of small system/core bugs.
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
2013-10-29 14:12:46 -07:00
Mark Wachsler
157b00171a Wait for device to disappear after reboot-bootloader.
(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
2013-10-17 20:06:32 +00:00
jp abgrall
e6e5daace5 am edeed28b: am 4a280e3d: Merge "Don\'t use control requests to read device serial numbers."
* commit 'edeed28bd397f863686ba3e5bb7479f881efc657':
  Don't use control requests to read device serial numbers.
2013-09-17 14:17:44 -07:00
Mark Wachsler
bd446c76f3 Don't use control requests to read device serial numbers.
Instead of sending control requests to all devices to read their serial
numbers, read the cached strings from sysfs. This fixes two problems:
1) The control requests sometimes timed out, causing devices to show up
as "????????????????", and 2) a control request could mess up devices
which were in the middle of being flashed.

Also enumerate by walking sysfs rather than devs so that we can avoid
opening host controller devices, which can be slow. On a system with 10
EHCI controllers, fastboot devices now takes 7 msec instead of 700 msec.

Change-Id: I2ad2d58b48268d7950bd279fd6a6753dc2f79514
2013-09-16 18:08:07 -04:00
Rom Lemarchand
622810ceff fastboot: add support for sparse images in flashall and update
Change-Id: I66a73b16a988a65fc91fb22a26d11986025089de
Signed-off-by: Rom Lemarchand <romlem@google.com>
2013-07-01 12:42:58 -07:00
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
88e8f61a9e Revert "fastboot: add preflash command to help with large downloads+flash"
This reverts commit 6f1cd0b2ad.

It causes some devices to fail (b/9581613). Revert for now.

Change-Id: I076158c704c2b4f0459322aa157c19ebd0c4615f
2013-06-26 03:51:29 +00:00
JP Abgrall
6f1cd0b2ad fastboot: add preflash command to help with large downloads+flash
Without the partition name, the bootloader would have to store all
of the data until the next flash command, which potentially wastes
time.
To help the bootloader deal with the data more efficiently, we now
issue a flashing hint ("preflash:%s", partname).
"preflash:" is used to indicate that the following download
should ignore any previous "preflash:%s".

Bug: 6045918
Change-Id: I4e9708f64f28a4781bde14eb3714d36b281ec5be
2013-06-25 11:52:05 -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
Colin Cross
fa341f5b66 Merge commit '35d5b7e6' into master 2013-01-23 21:20:23 -08:00
Colin Cross
c86396eba2 am 5fc4fdc6: am 2447afdb: Merge "fastboot: use better exported api from libext4_utils"
# Via Android Git Automerger (1) and others
* commit '5fc4fdc6a06cfa151d29f751d9d9beb8cb781a6a':
  fastboot: use better exported api from libext4_utils
2013-01-23 20:52:29 -08:00
Colin Cross
81c632e4da fastboot: add errno.h to fix windows build
The removal of extra headers from ext4_utils.h removed an indirect
include of errno.h that breaks building with USE_MINGW=1.

Change-Id: Ic8448db97b5c056a139dc836e1d6f3aaafb917c9
2013-01-23 19:13:43 -08:00
Colin Cross
2aaf5e84f0 fastboot: use better exported api from libext4_utils
Switch fastboot to use an exported api from libext4_utils that
will change less often, and remove some of the implementation
details from fastboot.

Change-Id: I85a10c8f58abe8093d0c781e1a0e100c348ef0d9
2013-01-23 15:43:41 -08:00
Scott Anderson
9bfecb0e34 Add old fastboot_protocol.txt
fastboot_protocol.txt used to live in bootable/bootloader/legacy
which was old, obsolete code.  However, fastboot_protocol.txt is
a useful file and belongs with the fastboot code.

Change-Id: Iea50c3219f9ff9dd0c394fc6028c456fa948ffd9
Signed-off-by: Scott Anderson <saa@android.com>
2012-12-06 09:34:34 -08:00
Kenny Root
efb5e3c709 resolved conflicts for merge of 20f5daa8 to master
Change-Id: Ie3e67696d265a56dfa4d089c777506f27783a9a6
2012-10-16 18:00:29 -07:00
Kenny Root
20f5daa865 resolved conflicts for merge of 44f4f8a4 to jb-mr1-dev-plus-aosp
Change-Id: I66988d8e87a8110ca9ab3da19870b80bbaf06eba
2012-10-16 17:51:14 -07:00
Kenny Root
b83c09812f Remove HAVE_SELINUX guards
Change-Id: Idef0a784a1d237257ff4135bb1df62ff8a67ded3
2012-10-16 12:34:06 -07:00
Ken Sumrall
656a24cae7 am e17c821e: am 608634a1: am 48f3b576: Merge "Update fastboot to wipe ext4 partitions before flashing" into jb-mr1-dev
* commit 'e17c821e36163695f6d5024a71f8e706bda65fd6':
  Update fastboot to wipe ext4 partitions before flashing
2012-10-03 14:02:38 -07: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
Kenny Root
d5d6d97def Host builds: add fastboot and adb
Add fastboot and adb host utilities to debug builds for debugging
and development purposes.

Change-Id: If77699a27497b8641998930f14d4ee418b856080
2012-09-26 10:01:40 -07:00
Colin Cross
80f9867431 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-09-10 14:12:37 -07:00
Colin Cross
ae807aaa02 Merge "fastboot: move help command before usb connect" into jb-mr1-dev 2012-09-10 14:11:44 -07:00
Ying Wang
96535ba620 Dist fastboot and adb for the sdk build.
So they can be downloaded from the build page.
Bug: 7109694

Change-Id: Ibc60d0acbc5d2445c01010fd0bd4654a240b0a88
2012-09-05 10:26:43 -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
Joe Onorato
ab163a9a17 am c56f4285: am a11f4bcf: Merge changes I5006b467,I0118cebf,Ibc792367
* commit 'c56f428530a307c850dc99024d23f7e5ebbf92d3':
  Support for multiple modules with the same name is going away.
  Fix build by removing TAGS from host module
  libext4_utils on host is now called libext4_utils_host so there is no name conflict
2012-08-17 00:53:14 -07:00
Joe Onorato
5069b01e21 Support for multiple modules with the same name is going away.
Change-Id: I5006b467978071f9107babe532efa71d05061580
2012-08-15 19:52:52 -07:00
Joe Onorato
2ffe3c8ac4 libext4_utils on host is now called libext4_utils_host so there is no name conflict
Change-Id: Ibc7923676925ed6942b3f672ee764cfaa98ee96e
2012-08-15 19:52:52 -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
80f2d036a9 fastboot: add fb_getvar
Add an fb_getvar helper that can be used to get values from the
target.

Change-Id: I0da088fcbc8d40076c7bf5ef6e5bbd97fae61471
2012-07-09 22:16:57 -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
JP Abgrall
f8ff3a5ae2 fastboot: Keep borked bootloaders happy by shrinking URB len.
Some devices will fail to return the requested data if the final
URB len of the request to > 255.
So shrink the current data buffer from 128 to 127 in the acse of getting
the serial number seems to work just fine.

Change-Id: Ic24e6c86ec93f002dc721d92309b3f880f281f20
2012-04-18 15:31:23 -07:00
Kenny Root
82fd659667 Tweak makefile to let SELinux build
fastboot now needs SELinux support when not on Windows.

Change-Id: Ib32404ef5c9a1a183d7ae319cc94eaf7f12620d9
2012-04-08 11:27:06 -07:00
Kenny Root
1ecb8681c3 fastboot: add support for SELinux and fs_config_func
There were some changes to make_ext4fs to add SELinux context. Also, we
changed the "android" argument to an fs_config_func that allows you to
customize the permissions put into a ext4 filesystem.

Change-Id: If23152c40659122a91771fcbd094f713b38e321e
2012-03-30 20:46:16 -07:00
Anatol Pomazau
5ae3f93f3b Remove trailing whitespaces
Change-Id: I6f83333a6ee0fbc562a12bb9555c43a44c98768e
2012-02-28 07:21:08 -08: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
7806e56485 Merge "Revert "Implement 'fastboot format' command"" 2012-02-03 11:18:43 -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
e9f6e00c19 Merge "Implement 'fastboot format' command" 2012-02-03 10:13:31 -08:00
Jean-Baptiste Queru
0fe24c96be am 142e895a: am e83cd37e: am 0458d373: Merge "fastboot: set the language local string"
* commit '142e895a1d5030a4e032f08fa5814ebd42b964b6':
  fastboot: set the language local string
2012-01-27 21:09:21 -08:00
Jean-Baptiste Queru
142e895a1d am e83cd37e: am 0458d373: Merge "fastboot: set the language local string"
* commit 'e83cd37e58b00fb6b9eb50464067864ca0cb2ff7':
  fastboot: set the language local string
2012-01-27 14:00:21 -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
mgross
c840653efd fastboot: set the language local string
Set the language local string to 0x409 (English US / en-us) such that
fastboot will successfully read the usb descriptor serial number string.
The usbdevfs ioctl fails when the wIndex is not initialized with the
local for the unicode of the usb descriptor string.  usbdevfs is an
obsolete interface and fastboot probably needs a re-write to use libusb
like what is in adb.

Change-Id: I3687f84643f53c736f14b3ae7793185d9b5cccc0
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2012-01-23 13:12:23 -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
Conley Owens
66acffad76 am c4eaebbe: am ab6e55f7: Merge "Enlarge USB bulk transfer size for faster downloads"
* commit 'c4eaebbe7a0c125663f74e3961b62de8d3611a51':
  Enlarge USB bulk transfer size for faster downloads
2011-04-27 11:38:29 -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
David Krause
913eb8bf87 Enlarge USB bulk transfer size for faster downloads
The default USB transfer bulk is fixed as 4096 in fastboot util code for
Windows and Linux. Enlarging the bulk size can greatly improve the image
download speed via USB.

For Windows, adjust the max bulk size to 1MB to maximize the USB transfer
speed. With this change, the USB transfer speed can be doubled to 20MB/s.

For Linux, adjust the max bulk size to 16384 to maximize the USB transfer
speed according to MAX_USBFS_BUFFER_SIZE definition in drivers/usb/core/devio.c.

For OSX, the maxLenToSend is already 1MB in code.

Change-Id: If6af8c6301f6f6c2ef345e37241706f16d8f5cda
2011-03-28 11:45:21 -05: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
Ying Wang
1c061b9ea9 dist for dist_files
Change-Id: I665572a2212f1239b02b7816e37ada210afbdb48
2010-12-09 10:33:27 -08:00
Jean-Baptiste Queru
69f2d3ce91 am 42b871f1: am c37ba1c9: Merge "Check fastboot oem command line length"
Merge commit '42b871f1bfc116d53d1bff9d7497415494b2e0e0'

* commit '42b871f1bfc116d53d1bff9d7497415494b2e0e0':
  Check fastboot oem command line length
2010-07-29 11:11:07 -07:00
Jean-Baptiste Queru
42b871f1bf am c37ba1c9: Merge "Check fastboot oem command line length"
Merge commit 'c37ba1c916d73fbf35c6faba1e252e2916d2d41d' into gingerbread-plus-aosp

* commit 'c37ba1c916d73fbf35c6faba1e252e2916d2d41d':
  Check fastboot oem command line length
2010-07-29 11:08:02 -07:00
Nick Pelly
286d50fe34 Allow OSX fastboot to work with more devices.
ClearPipeStallBothEnds() appears to fail on some devices, but if we ignore
that error then fastboot does work. So ignore the error.

Change-Id: Ic866ece28a57c081e34079e1a032fa8155301ddf
2010-07-22 10:59:55 -07:00
Bruce Beare
50b3995d02 Check fastboot oem command line length
Change-Id: I301af09c4ec460c9049b75cc7f4d2c50cfe00ceb
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
2010-07-15 08:52:01 -07:00
Brian Swetland
587c286f98 am beb72464: am 63e5205c: fastboot: make it so I can actually see the bootloader chatter
Merge commit 'beb72464ff8c501597cd7e098090f7d131dc5ccb'

* commit 'beb72464ff8c501597cd7e098090f7d131dc5ccb':
  fastboot: make it so I can actually see the bootloader chatter
2010-07-13 17:18:39 -07:00
Brian Swetland
63e5205cd2 fastboot: make it so I can actually see the bootloader chatter
- prefix bootloader messages with (bootloader)
- remove the fancy right justified no newline business

Change-Id: Ica16ebe6a25971db423c5db06300a280d93faf3e
Signed-off-by: Brian Swetland <swetland@google.com>
2010-07-01 13:54:13 -07:00
Werner Johansson
4272a7ad70 am a8c74049: am 931bdcc0: Set explicit timeout on USB control transfer
Merge commit 'a8c7404956b4370162a87ae09b851266a4933b54'

* commit 'a8c7404956b4370162a87ae09b851266a4933b54':
  Set explicit timeout on USB control transfer
2010-06-30 21:52:19 -07:00
Werner Johansson
931bdcc09a Set explicit timeout on USB control transfer
This attempts to solve the intermittent issues with serial number
showing up as all question marks when issuing "fastboot devices"
2010-06-30 21:03:46 -07:00
Jeff Brown
f6e83f7eb8 am dc594284: Merge "Fix kernel panics in fastboot on OS X." into kraken 2010-05-21 14:08:41 -07:00
Jeff Brown
b64063737e Fix kernel panics in fastboot on OS X.
The kernel panic seems to be related to the driver trying to allocate
too many pages from the IO mapper.  That may be caused by the fact
that we try to perform a 100+ MiB transfer in a single IO operation.
This change breaks the transfer down into 1 MiB chunks.

So far after a day of testing, no kernel panics have occurred compared
to 5 in the previous 24 hours!

Change-Id: I8d27a546e0c0bf4fe2f0fc7fcad65a88d3e6bee0
2010-05-21 13:24:25 -07: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
Raphael
b419c35c66 Fix adb, fastboot to compile in Windows SDK under Linux.
(Merged from master Change I3d0e4cab)

Change-Id: Ib3fd566bdaf09d5893a6b0c66168c76c6b0d92eb
2010-04-23 13:07:17 -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
Raphael
fab167850d Fix adb, fastboot to compile in Windows SDK under Linux.
Change-Id: I3d0e4cabd65d9de17036901a22ec3277a6d58e64
2010-04-13 15:28:26 -07:00
Daniel Sandler
cb6e22b687 Add wall-clock timing for each fastboot Action.
(For diagnosing slow flashes.)

Change-Id: Ibbcbd080db551c8590ca8bfe50e9ddb45eea5661
2010-02-25 14:05:33 -05: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
Xavier Ducrohet
af82f21df7 Add Dell's vendor ID to fastboot.
Change-Id: I1d88d2a8b3f5c0a9bade2a207b5d9c5a0b776655
2010-01-21 17:39:25 -08:00
Erik Gilling
37e9e90436 fastboot: add Nvidia vendor id to fastboot
Signed-off-by: Erik Gilling <konkers@android.com>
2010-01-20 17:40:30 -08:00
Jean-Baptiste Queru
c923980e78 am ef063fe3: merge from open-source master
Merge commit 'ef063fe3066153dab5389b6baba6cb4e36888106'

* commit 'ef063fe3066153dab5389b6baba6cb4e36888106':
  Add support for Acer devices
  FreeBSD support for usb-connected devices in adb
  Make get_my_path() safer
  Fix use of memset function
2009-11-09 12:07:42 -08:00
Jean-Baptiste Queru
ef063fe306 merge from open-source master 2009-11-09 09:40:48 -08:00
Jean-Baptiste Queru
436db2e382 merge from open-source master 2009-11-08 16:11:17 -08:00
Robert CH Chou
e25ff1c682 Add support for Acer devices 2009-11-03 10:48:17 -08:00
Android (Google) Code Review
44a0270c1e Merge change I31dbed7b
* changes:
  Add adb's ANDROID_SERIAL to fastboot too.
2009-10-08 11:30:10 -04:00
Elliott Hughes
c500be926c Fix flashstation breakage.
We need to reset 'writable' each time round the loop (i.e. for each device).
2009-10-07 17:24:39 -07:00
Elliott Hughes
31dbed7b60 Add adb's ANDROID_SERIAL to fastboot too.
We noticed this when trying to script on-device testing for the dalvik
continuous build.

Also fix a typo in adb's help.
2009-10-07 15:38:53 -07:00
Elliott Hughes
b4add9b745 Make fastboot say "no permissions" for non-writable devices.
Without this patch, "adb devices" will say "no permissions" when it sees
a device it can't write to, but "fastboot devices" will silently ignore it.
This is confusing to n00bs, especially since it doesn't seem to be widely
known that a device's USB id might be different in the bootloader (meaning
two udev rules are needed). It can also be confusing if you're sshed in,
when you can't access the device because you won't be in the "plugdev"
group, but "fastboot devices" won't make this clear.

I'm not sure about the Mac OS and Windows changes. AIUI, devices are always
writable on those platforms, but I don't use either, so I can't test this.
This patch shouldn't alter the behavior on either of those platforms.
2009-10-06 18:07:49 -07:00
Mathias Agopian
3969080e23 get rid of utils/executablepath.h, which now lives in the simulator 2009-08-26 14:46:18 -07:00
Dan Murphy
b2de4db941 fastboot: Add retry to USB read call.
If the USB connection to the device is reset but is still there
the code should retry to re-connect the device and continue.

This is a short term fix for a bootloader issue.
We should revisit and look for a better solution.

Signed-off-by: Dan Murphy <D.Murphy@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-19 14:32:01 -04:00
Mike Lockwood
09070d9e86 fastboot: Add support for Motorola USB vendor ID.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-05 17:04:36 -04:00
Mathias Agopian
89ac364c54 get rid of utils/executablepath.h, which now lives in the simulator 2009-05-31 18:50:09 -07:00
Dima Zavin
95ec983887 fastboot: Update the help message with -b argument
Signed-off-by: Dima Zavin <dima@android.com>
2009-04-30 15:03:05 -07:00
Brian Swetland
2a63bb7abf fastboot, mkbootimg: support alternate base addresses
Add the --base flag to mkbootimg and -b flag to fastboot, to allow
the default kernel base address (0x10000000) to be changed.

Signed-off-by: Brian Swetland <swetland@google.com>
2009-04-28 16:05:07 -07:00
The Android Open Source Project
f614d64d4b auto import from //branches/cupcake_rel/...@140373 2009-03-18 17:39:49 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
13f797da7f auto import from //branches/cupcake/...@130745 2009-02-10 15:44:07 -08:00
The Android Open Source Project
35237d1358 Code drop from //branches/cupcake/...@124589 2008-12-17 18:08:08 -08:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00