Trusty Benchmarks need to be evaluated in ABL which is much more
controlled than linux. However fastboot prints evry atomic message from
trusty/abl on its own line starting with "(bootloader)"
Bug: 263454481
Test: - "fastboot oem trusty runtest trusty.hwrng.bench"
Change-Id: I99847a8cc54457c8ec809e219736325dce0ac891
This test checks that the sparsing logic matches a canonical sample
output.
Bug: N/A
Test: fastboot_test
Change-Id: Ic7bad08a79e4223f8352db2397b741c2179e76bb
Use introduced FileLock and network-connected devices storage entities
to introduce fastboot connect / disconnect commands
Test: everything works like discussed here go/fastboot-connect-disconnect on windows/linux
Bug: 267507450
Bug: 267506875
Change-Id: I2d6495ad567a3ddadd471a89b82d78c8c36a3d52
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
Bug: 267507577
Bug: 267505625
Test: tested file lock api works on linux/windows
Test: tested storage api works on linux/windows
Change-Id: I33dda819370900310ae7fc63cbf6b00ba22ad4e8
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
So fastboot_driver.h includes <android-base/logging.h>, but that
file has a dependency on <android-base/endian.h>. So if
fastboot_driver.h gets included somewhere before
<android-base/endian.h>, it results in *very* opaque error
message:
system/core/fastboot/fastboot.cpp:1490:9: error: expected unqualified-id
LOG(VERBOSE) << "Cannot optimize flashing super on non-AB device";
^
system/libbase/include/android-base/logging.h:221:23: note: expanded from macro 'LOG'
^
system/libbase/include/android-base/logging.h:227:4: note: expanded from macro 'LOGGING_PREAMBLE'
(WOULD_LOG(severity) && \
^
system/libbase/include/android-base/logging.h:202:40: note: expanded from macro 'WOULD_LOG'
(UNLIKELY(::android::base::ShouldLog(SEVERITY_LAMBDA(severity), _LOG_TAG_INTERNAL)) || \
^
system/libbase/include/android-base/logging.h:174:26: note: expanded from macro 'SEVERITY_LAMBDA'
using ::android::base::ERROR; \
^
prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/include/wingdi.h:75:15: note: expanded from macro 'ERROR'
^
This patch includes <android-base/endian.h> before
<android-base/logging.h> to avoid this issue.
Reported-by: Daniel Zheng <zhengdaniel@google.com>
Signed-off-by: John Stultz <jstultz@google.com>
Change-Id: I8752f2cdbef5b13901f0f4e8adfe60a21db785b6
Reboots to fastbootd (userspace fastboot) take a long time, particularly
due to the orange AVB screen and the likelihood of devices having uart
enabled. For "flashall", there is rarely a need to actually go into
userspace, because all of super is getting thrown away. We can just
flash super in the bootloader.
In the past we didn't do this because computing super.img is expensive -
both in terms of time (due to reading dependent images) and in terms of
space (it's easily over 5GB).
But we don't actually need to fully compute super.img. We can build a
sparse_file containing the metadata/headers, with additional references
to each image file containing partition data. Liblp provides the API to
do that, and here, we simply need to translate the layout to libsparse.
On Pixel, this reduces flashall time by around 35-50 seconds, or around
20% of total time, depending on whether uart is in use.
There are some caveats, in which case we'll fall back to normal
fastbootd. This does not work on non-A/B devices, on retrofit dynamic
partition devices (Pixel 3), and in some other edge-casey scenarios. If
it fails, -v will add logging information about why.
Bue: 266982466
Test: fastboot flashall on Pixel 5+
Change-Id: Ie040da597d739faa7f834202184cec8f8e412076
The die() and verbose() macros are not really standard for AOSP. To
allow a gradual transition off them, call InitLogging on startup. This
will also allow seeing liblp logs when -v is passed.
Bug: 266982466
Test: builds
Change-Id: I74278bb5f698edb0dc81477a575b130b0bd11cdf
Copy the AVB footer of the recovery.img to the end of the recovery
partition, so that it can be found when loading a recovery image
from a partition that is larger than the image.
Bug: 261673286
Test: m and flashing recovery image and bootloader can now detect
AVB footer.
Change-Id: Ib93da33c72f3a96eb8d9bcedaab5ef0c3a4d418d
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
AServiceManager_getService waits unncessarily waits for 5 seconds if
service is not available. Use isDeclared() and waitForService() instead.
Bug: 261759425
Test: build and flash
Change-Id: I20a5f422ca0c26c6e9e183e6636b30a2f19e76d3
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
EXPECT_NONFATAL_FAILURE(statement, ...) expands to
do {
... statement ...
} while (::testing::internal::AlwaysFalse());
Clang analyzer cannot see into AlwaysFalse(),
and gives a false warning assuming that the
do loop can be done twice.
Use a unique_ptr::reset to call delete,
because reset can be called multiple times..
Bug: 259999410
Test: make tidy-system-core-fastboot_subset
Change-Id: Ie536f76635dd55f4e47b80eed6498fd1193b88ee
Export ro.force.debuggable property so that the user can check image
compatibility prior to running fastboot flash.
For example, if is-force-debuggable is yes, then the "system" and
"vendor" build fingerprint must match.
Bug: 191649082
Test: fastboot getvar is-force-debuggable
Change-Id: I772d98253f58ba208d5803e18b589ff693deebd0
This patch addresses Fastboot/Fastbootd connection issues seen on ARM Mac devices.
Original ADB patch: https://android-review.googlesource.com/c/platform/packages/modules/adb/+/1699250/
Bug: 238779161
Test: 'fastboot update <path_to_update_archive>.zip' now works on ARM Mac.
Signed-off-by: Nicolas Gagnon <nicolasgagnon@google.com>
Change-Id: Id67904d91abc8b66ef1a00962e1fd57c97df98a7
updates the relevant unit tests.
BUG=182864081
Test: Update the size check to the existing unit tests
Change-Id: I66b08884a5228e164c22c575a6f6c82a236fece2
In commit 5d72d6c, an unused code path for e2fsdroid and sload_f2fs was
removed from fastboot. Remove them from the build dependency list.
Bug: 237960487
Test: m fastboot
Change-Id: Ibee72a86eeb43fcde3a032094bfc1c19de09bc03
fastboot uses the internal functions generate_ext4_image and
generate_f2fs_image when called via the `format` subcommand. An option
for populating the newly created fs with an initial directory exists,
but it is not exposed to the command line interface (initial_dir is
always ""). Remove the unused codepaths for this preloading.
Test: atest --host fastboot_test
Bug: 237960487
Change-Id: I7acfe6352cf26b5cbe0e5553b288c3798e96a893
Thew new client will use AIDL if available, and fallback to HIDL
otherwise.
Test: th
Bug: 227536004
Change-Id: I9af21037a76a4a6db00144f5b2774ea23f3a5cc2
Add lz4 support in CowWriter/CowReader. Lz4 should offer faster
read/write performance but slightly larger COW sizes.
Download time: Reduced from 1264s to 825s (~35% faster)
Filesystem verification time: from 69s to 59s (~15% faster)
COW Size: 2.59GB to 3.21GB, (~25% regression)
Merge time: 37046ms to 27690ms (~25% faster)
Boot time: LZ4 is 2.7% faster
Overall, LZ4 offers faster read/write performance at the cost of 25%
space regression.
Test: th
Bug: 228478555
Change-Id: Ie521852fb3c9ff8a12e55b764c1eb1838f7b2181
This adds "fastboot getvar dmesg", usable only in userspace fastboot,
and only on unlocked devices. This is to debug flashing failures when
serial log access is not available.
Bug: 230269532
Test: fastboot getvar dmesg
Change-Id: Ic57881e362efe3f0687f41ab986d30b3a59dc4e4
If vendor image size is less than what the header claims,
there is OOB access.
And it did not check page size equal to zero also.
Bug: 234208198
Test: fastboot_fuzzer
Change-Id: Iec08acf9bb354db4c4cd25e3a0c581974fee7eed
This allows OEM commands to print messages in fastboot output.
Test: run fastboot oem getprop ro.boot.rf_version
and observe property value being printed in console
Change-Id: Id9bd5a107861a790cd02dc87057600de5bb94d42