We don't need the compression bit in v3 op since all operations will
have the same compression per COW Device and it will be stored within the COW header.
We can check to see if an operation contains compressioned data by
checking data_length and see if it's less than BLOCK_SZ
Test: 4 critical OTA paths
Change-Id: I3f86756d83bf54bf6efd15d9cb7ac064eefdd949
Adding v3 writer that works off of Cow Operation v3. Adding test file
that will test this new writer. Adding in stub implementations to v3 writer. None of these functions
have to work yet, we just need the implementations here to compile.
Test: m libsnapshot
Change-Id: If86437d5ceb2c33520d4ca26dea5193984f86546
utils/Log.h is one less file we need if we're
splitting up this library for binder.
Bug: 302720583
Test: build
Change-Id: Ibc7ec5402df342627f465354d7cf59e98f450a31
Currently we sleep for 5ms before decrementing retries for the last
time. This is a waste of time, so bail out of the loop if the last
rmdir attempt fails.
Change-Id: Ia20840d27592b4eb3d9762647b19c111ff94209f
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
Introduce new battery-soc variable to read battery
SSOC, this benefits manufacturing to better track
the SSOC after FSI image flashing in the userspace
fastbootd using the same approach as Android space,
otherwise it is difficult to implement the entire
battery SW stack from Android to fastboot bootloader
and generate the same test experience monotonically.
Bug: 303561559
Test: fastboot getvar battery-soc # in fastbootd
Change-Id: Ia3f68e314263d7dd4d4c45a908a0a49db6e761f9
Signed-off-by: Harry Pan <gspj@google.com>
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
If someone is trying to use the sphal namespace, but it
isn't available, we should probably fix this code or add an
sphal namespace there or similar. Add log for more clarity.
Bug: N/A
Test: boot cuttlefish, this doesn't get logged
Change-Id: I2fd2cddc90f529218c99ede8daf2891d84ceb94c
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