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>
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>
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
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>
(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
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
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>
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
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
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
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
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>
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
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
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
* 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
Change-Id: I7390867abd00036f19eb4d1a1ce23aa0aca50674
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
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
"fastboot -w" would segfault because *argv was invalid when no
non-option arguments were specified. Check argc > 0 before
dereferencing argv.
Change-Id: I822a799e6a38e4e5c0a4eca48c6343b8a08a6185
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
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
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