Example log line:
update_engine: Block device was lazily unmounted and is still in-use:
/dev/block/dm-28; possibly open file descriptor or attached loop device.
This will help diagnose bugs such as b/184715543 in the future.
Bug: N/A
Test: manual test
Change-Id: Ia6b17fe9bd1796d59be7fc0b355218509acfd4af
Allow using --force to bypass flashing requirements
from android-info.txt.
We often provide builds to deviceholders who don't have
an exact matching bootloader or radio image and it is
unimportant. Having the option to override is useful.
This shouldn't affect bootloader.img so should never
prevent a device from returning to fastboot in case of
gross error.
Test: Downloaded a build w/ different radio.
Got the following output:
...
Checking 'version-baseband' FAILED
Device version-baseband is 'xyz'.
Update requires 'abc' or '123'.
requirements not met! but proceeding due to --force
Setting current slot to 'a' OKAY [ 0.065s]
Bug: 184661990
Change-Id: I8680b8275b854304026cff3b2e663b7ef2594383
for GSI XTS self-test, we need to mount filesystem(/metadata) in fastbootd mode. so we add a qualification since there is no overlayfs on user build anyway.
bug: 181097763
Change-Id: Ie36bd2f5b3981e6774dc4a2123c33180cddb99d1
We shall rely on Android property instead of parsing kernel
command line directly: parameters could be originated from
kernel command line or bootconfig.
Bug: 183237066
Bug: 183719613
Signed-off-by: Oleg Matcovschi <omatcovschi@google.com>
Change-Id: Ia70d286646a83a95967ca4293168a6550ffff7f0
Change mkbootimg() to return void, as we already have a |out| parameter.
Bug: 183455415
Test: Presubmit
Change-Id: I51439e273752ab9e21f8d7138e900ea55bdfdfc0
Boot v4 is mostly compatible with boot v3, so these minimal changes
should be sufficient.
The newly introduced field of v4, signature_size, is left zero because
this field is only meant to be read by VTS testcases, so the value
doesn't matter for the debugging purposes of boot and flash:raw.
Bug: 183455415
Test: Manual
Change-Id: I5c2737ce35dd25f318b19a429de805ea16c46607
Do not use the implicit cast from unique_fd to int so
that it is clearer to the reader what the ownership model
is.
Test: pass
Change-Id: I66563eb2bd06f6a712a5afd4c6009f9b25a55de6
Do not use the implicit cast from unique_fd to int so
that it is clearer to the reader what the ownership model
is.
Test: pass
Change-Id: Iaf40a6eed3fcfd001651980c865ed5efb85ac0eb
load_sparse_files assumes that the client maintains
the lifetime of the input fd is longer than
the output sparse_file handle.
Bug: 183409401
Bug: 183223098
Test: flash super image
Change-Id: I295b912c665577b5767a133f3148e58a22733998
Added SPDX-license-identifier-Apache-2.0 to:
fastboot/testdata/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: I32847c8706facb4fe46ea8d4d6089a629cee2321
When a user issues `fastboot flash vendor_boot:foo ramdisk.img`, the fastboot driver
fetches the vendor_boot image from the device,
determines if `foo` is a valid vendor ramdisk fragment,
repacks a new vendor boot image, then
flash the vendor boot image back.
This requires vendor boot header V4.
As a convinent alias, `fastboot flash vendor_boot:default ramdisk.img`
flashes the whole vendor ramdisk image. This works on vendor boot header
V3 & 4.
Fixes: 173654501
Test: pass
Change-Id: I42b2483a736ea8aa9fd9372b960502a642934cdc
If fastboot flash vendor_boot:default, only
call has-slot on the first token, and append slot
to the first token only.
Test: fastboot flash vendor_boot:default
Bug: 173654501
Change-Id: I8ff7b3a0bafb964792ab8a788d64d14bc47ae83d
The `fastboot fetch` command is a wrapper around
the fetch protocol. It:
- getvar max-fetch-size
- get the size of the partition
- read the data by chunks, chunk size = max-fetch-size.
The name of the partition is passed directly to the device
(with the usual has-slot magic for flashing etc.) If we support
fetching partitions other than vendor_boot in the future, no change
in the driver is needed.
Bug: 173654501
Test: manual
Change-Id: Ie576eea668234df236b096a372e65c5e91c1e48c
Instead of allocating the buffer for the whole
upload (which can be arbitrary number of bytes as
the device determines), read 1 MiB at a time.
Test: pass
Bug: 173654501
Change-Id: Ib601b0341b10b7dccbb429cd21aad86a2d3bfda8
Refactor UploadInner and add a new RunAndReadBuffer helper function
that handles the generic procedure of:
1. Sending a command
2. Receiving a DATA response with N bytes
3. Receiving another response
Test: pass
Bug: 173654501
Change-Id: I568bea127315e42d8a111c23602fc582e7bc935b
fastboot_buffer owns the fd. Make ImageSource::Open()
returns a unique_fd and pass ownership all the way
down to the fastboot_buffer to avoid leaking fds.
Test: none
Change-Id: I9e7e176fc1da74c532a86d0fdba0113bdc81a166
O_CLOEXEC ensures fastbootd does not leak fds to the parent
process (recovery).
O_BINARY has no effect in Linux, but it is explicit that
the file (partition) to read is a binary file.
Test: pass
Bug: 173654501
Change-Id: Idba922965ce666af1b7ee460ec7449fabd511c35
When Write() is called on data > 256K, the written data
repeats every 256K because of the buggy line in this change.
Test: fastboot fetch vendor_boot.img
Fixes: 180654366
Change-Id: I33b129de27000d3f32f284469998daf540d4f856
Some devices, such as the Essential PH-1, don't have an
updated bootloader and the bootloader is appending an extra
underscore.
This patch works around that issue by sanitizing the slot to be
inline with modern expectations.
Offending commit: 42b18a518b
Most of the commit above is not needed because an underscore + slot
is automatically appended when flashing to a partition. Normally, this
would result in something like boot__b instead of boot_b, where b is the
current slot.
Test: flash an image on mata without specifying slot, boots
Change-Id: Ia0b7cee603a4f9ba2e3a61ce6e369ca8c07a7caf
* Only add owned header directories.
* Do not add extra quotes around -header-filter argument,
or the quotes will be part of the regex and fail to
match header file paths.
Bug: 179530304
Test: make with WITH_TIDY=1
Change-Id: Icea867cb22264fb2dbbff079a1fc914bf48bbdef
SnapshotManager::New() is now preferred in recovery. Previously we used
NewForFirstStageMount(), which is technically incorrect as that enables
code paths specifically for first-stage init.
We also explicitly label the snapuserd context, since rootfs in recovery
has unlabelled files.
Finally, we add a timeout to internal calls to
CreateSnapshotsAndLogicalPartitions. Without this, WaitForDevice() calls
will terminate immediately, which breaks VABC given the more complex
device stacking that is created.
Bug: 168258606
Test: fastboot snapshot-update merge
Change-Id: I3a663b95c0b1eabaf14e6fde409c6902653c3c5e
The pvmfw partition holds the protected VM firmware that is used by
Protected KVM to bootstrap the trust in protected VMs. Teach fastboot
about the partition so it gets flashed with flashall.
pvmfw is an AVB chained partition so is marked as BootCritical to allow
ABL's AVB verification to pass.
Test: tab complete and flashall
Bug: 171280178
Change-Id: Ie4cc478de25a945bc510488d87c2bee3aa5031f2