This code path was never invoked. is_logical will return false on
secondary partitions in retrofit devices, so nothing actually is ever
deleted. If we manage to call the delete, the device side code will
fail with "cannot open the super partition"
Test: fastboot flashall on sargo device
Change-Id: I20b430c5c30bf992506190ea4e00b0b69c7b1005
FastbootDevice::boot1_1 attempts to dereference a null pointer when the
boot_control_hal_ is not set. It needs a guard statement to prevent
that.
Test: Manually tested on device without BootControl.
Bug: 301682120
Change-Id: Id86bcb915c8e2857bda26f64738dd5b643048e98
This fixes the case when all the following conditions are true:
1: Incremental OTA
2: When there are sequence of overlapping COPY operations within one merge-window
(510 blocks)
3: Device is rebooted when snapshot-merge is in-progress of this
merge-window. When device reboots, the state of merge-window (of 510 blocks) was
merge-in-progress (aka - only partial set of blocks were merged in
this window thereby the state of the base device is in-complete for
this window)
4: During the next boot, if there any I/O request from the filesystem
which maps to the merge-window in (3):
a: The data has to be retrieved from the scratch space of the
COW until the snapshot-merge for that window is completed.
b: Once the snapshot-merge is complete for that window, data
has to be retrieved from base device.
The bug was in step 4(a) wherein I/O request was getting routed to base
device.
This patch addresses the above flow by fixing step 4(a).
A new vts test has been added to explicitly track this issue.
Additionally, there is no need to re-scan the partition if partition is in merge resume path. This should cut down the overhead of the scan.
Bug: 275296365
Test: 1: 100 iterations of ./vts_snapuserd_test --gtest_filter=SnapuserdTest.Snapshot_COPY_Overlap_Merge_Resume_IO_Validate_TEST
2: Incremental OTA on Pixel 6 Pro with multiple iterations of device
reboot when merge is in progress
Change-Id: Ib53be7f07ff192a84ec7f7049b2c6be01dad1041
Signed-off-by: Akilesh Kailash <akailash@google.com>
Refactor writer, reader + parser to work off v2 version of
CowOperations.
Test: m libsnapshot. ota on cuttlefish
Change-Id: Iec59be91e5f54782272b37702d645942df38c771
Reader + Parser v3 should be able to read V2 cow format written to disk.
This test reads in a small cow file written by basic_v2_cow_writer and
parses it to ensure this compatibility checks out.
Test: cow_api_test
Change-Id: I46ebf4e3f12cdb3e4716ca5b624aab5836086733
This is similar to inspect_cow --extract-to, except it uses snapuserd.
It is a diagnostic host tool and uses the tooling added for host
testing.
Usage: snapuserd_extractor -cow COW_FILE -base BASE_FILE -out OUT_FILE
-num_sectors NUM_SECTORS
Unlike inspect_cow, this supports xor/copy operations.
The extractor code is separated into a utility file so we can use it for
additional tests later on.
Bug: N/A
Test: manual test
Change-Id: Ib7509508cba45e6c3a0db8c75454e33c2a503e03
This adds an --extract-to argument to inspect_cow to verify that full
OTA snapshots contain correct data. It does not yet work for ordered
ops.
Test: inspect_cow
Bug: N/A
Change-Id: I9014da3e83fd4fb5ea54ac1d36e527b3e3e6c9d5
Change-Id: I7e256e8ddec626980cdcf8680bbeac3c2e9d8de1
The current code keeps a pointer to a local variable which doesn't
work too well. Change this to a unique_ptr and allocate the source
object that will be used instead.
Test: All unit tests pass.
Test: fastboot -w flashall on a mokey which crashed without this change.
Change-Id: Ief5437374181e514928c45dd540b42898901a137
We've updated the glibc header (and musl will just use the bionic uapi
headers), so this is obsolete (and getting in the way of someone trying
to use the PERFMON capability).
Test: treehugger
Change-Id: Ife7ee076179e1db6246738aa41c2b82bd8546265
libbinder_rpc_unstable is in the list of system required libs, but the
library is already located in the system/{LIB}, and this creates link to
the self namespace. Remove libbinder_rpc_unstable from system required
libs as it doesn't make sense to have require and provide same library
in a single image.
Bug: 298333253
Test: Cuttlefish build and boot succeded
Change-Id: Idb40e1dbc1053d4882093c188a36b2cc8d86e918
We should change should_flash_in_userspace to work without
$ANDROID_PRODUCT_OUT being set and fall back on $OUT directory when
source isn't specified
This also fixes the flashing issue of flashing retrofit devices without
$ANDROID_PRODUCT_OUT set. If we
call fastboot update on a retrofit device, copy_avb_footer will resize
buf->sz of secondary partitions to the partition size, causing us to
send the unsparsed payload to the device -> "Invalid Size" issue.
This is because secondary partitions are considered physical partitions
on retrofit devices && should_flash_in_userspace wouldn't work if
$ANDROID_PRODUCT_OUT is set, so our first return clause in
copy_avb_footer doesn't catch this edge case causing us to resize the
buf-> sz incorrectly.
Did some testing, and also observed a case where flashing is able to
succeed despite $ANDROID_PRODUCT_OUT not being set before, so there
might still be some other edge case that we are still missing.
Test: fastboot update on sargo without $ANDROID_PRODUCT_OUT
Change-Id: I0e4781d96709b712f7d71657ec0d16d99b90214d
Adding small binary to write a simple COW for version 2. We will then
use updated reader to make sure we can read this version 2 cow. Think it
would be a good idea to keep the binary here to see how exactly we
generated the cow (useful for debugging and if we ever need to recreate
this cow)
Test: m basic_v2_cow_writer
Change-Id: I28435025b7a8280fc5c4574876cc9110b391cb0e
This doesn't help the person who wants CAP_BPF, but we can fix that
better by adding it to our stale glibc (and our future switch to musl
will mean we'll never have similar problems again).
I think this just dates from when we still supported building the OS on
darwin, but those days are long gone, and I think this hack can be put
to rest now...
Test: treehugger
Change-Id: I3c2e56c68a5b00c1ad0aed422c6ce60886063f50
Current libcutils checks if memfd is supported with vendor VNDK version,
but this is no longer valid if VNDK is deprecated. As we can assume that
any vendor using this code is supported as long as it is treblelized,
simplify logic to check if memfd is valid to vendor only with
'ro.treble.enabled' property.
Bug: 290159430
Test: Cuttlefish with VNDK deprecated worked without error from
libcutils
Change-Id: I351f0798da99cb4827bc3e424b63a2eaee5c7461
Target block hash was in-correctly getting added to map thereby
overriding the source-hash.
Bug: 299011882
Test: Flash Pixel 6 Pro from A->B and from B->A
Change-Id: Ib3887c29cd6b8f2abd50e932273a5cfc2a096bd5
Signed-off-by: Akilesh Kailash <akailash@google.com>