Commit graph

84742 commits

Author SHA1 Message Date
Daniel Zheng
ce57c58e6b Removing compression bit from v3 op
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
2023-10-09 13:31:20 -07:00
Daniel Zheng
04e4c2a6c2 Add v3 writer
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
2023-10-09 13:31:19 -07:00
Yurii Shutkin
a7dd77670e Merge "acvp: handle flush commond in modulewrapper as stated in BoringSSL." into main 2023-10-09 15:36:47 +00:00
Yurii Shutkin
f75464d65e acvp: handle flush commond in modulewrapper as stated in BoringSSL.
Change-Id: Ife655f0764851cf2d9677abd507daec3f531031e
Bug: 287626912
Test: ACVP test
2023-10-09 15:37:29 +02:00
Steven Moreland
0666c3a632 libutils: remove unused 'CALLSTACKS'
This macro is set, but it doesn't exist.

Bug: 302720583
Test: build
Change-Id: I88032c24b8bc8dc52d521e769149cbd8f619dde8
2023-10-07 00:35:38 +00:00
T.J. Mercier
af5de39039 Merge "libprocessgroup: Don't sleep after last cgroup removal attempt" into main 2023-10-07 00:34:39 +00:00
Steven Moreland
066e625b6b libutils: use log/log.h internally
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
2023-10-07 00:29:44 +00:00
T.J. Mercier
b02f94490d libprocessgroup: Don't sleep after last cgroup removal attempt
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
2023-10-06 23:11:09 +00:00
David Anderson
d8a9a0c81c init: Remove arbitrary delay in async persist writes.
Bug: 297093092
Test: manual test
Change-Id: Ia80b33d2fe87aa5da64b4f156fefeb474e68dc93
2023-10-06 14:52:08 -07:00
Sophia Coldren
d32b562ee9 Merge "Add an include" into main 2023-10-06 21:14:22 +00:00
Sophia Coldren
5880692ae2 Add an include
Change-Id: I0a6c64d9f1ddd9211de994fd4c6c44d53499775f
2023-10-06 18:46:17 +00:00
Xin Li
37e9952c93 Merge "Merge Android 14" into main 2023-10-06 05:34:13 +00:00
Xin Li
4f9ed9366f Merge Android 14
Bug: 298295554
Merged-In: Id86bcb915c8e2857bda26f64738dd5b643048e98
Change-Id: I6315e675753ec07fa1f67b69bcd05b831eeae6f0
2023-10-05 15:45:15 -07:00
Daniel Zheng
ad1ee13cec Merge "Removing is_retrofit code path" into main 2023-10-05 20:58:50 +00:00
Daniel Zheng
7248d1b0d8 Merge "Refactor off V2 Cow Ops" into main am: adad3dbefe
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2736101

Change-Id: I0344daaa43ed555c0bcdd377629c70a167f2afa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 19:39:28 +00:00
Daniel Zheng
3e9b88d504 Removing is_retrofit code path
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
2023-10-05 12:37:57 -07:00
Daniel Zheng
adad3dbefe Merge "Refactor off V2 Cow Ops" into main 2023-10-05 19:12:56 +00:00
Arun Sharma
828d85ae89 Merge "FastbootDevice::boot1_1 null pointer dereference" into main am: 608e33f736
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2768099

Change-Id: Id99a4a6aceaedfdbc67311d6f7234c3334fc0209
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 17:45:17 +00:00
Daniel Zheng
4cda9ec9bb Merge "Adding test for reader compatibility" into main am: 4b3b6e2ff5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2762279

Change-Id: I3720f7f966c54408c1c4dbe72222dac73ef6dbae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 17:45:07 +00:00
Arun Sharma
608e33f736 Merge "FastbootDevice::boot1_1 null pointer dereference" into main 2023-10-05 17:33:34 +00:00
Daniel Zheng
4b3b6e2ff5 Merge "Adding test for reader compatibility" into main 2023-10-05 17:04:17 +00:00
Elliott Hughes
5cc875126a Merge "s/master/main/" into main am: b533f531df
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2772867

Change-Id: Ide151a5572106cb6e071ecdb70d97968d2a4a8a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 16:41:39 +00:00
Arun Sharma
1a3456f0bc FastbootDevice::boot1_1 null pointer dereference
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
2023-10-05 16:35:24 +00:00
Elliott Hughes
b533f531df Merge "s/master/main/" into main 2023-10-05 16:09:46 +00:00
Akilesh Kailash
0d38654b34 Merge "snapuserd: I/O request on overlapping blocks during snapshot-merge." into main am: 743c4cdb1c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2769106

Change-Id: Ie5a42ec523a948382b25200d92cfb1105d972138
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 14:18:31 +00:00
Akilesh Kailash
743c4cdb1c Merge "snapuserd: I/O request on overlapping blocks during snapshot-merge." into main 2023-10-05 13:42:30 +00:00
Harry Pan
7fa8dd655a Add new fastbootd battery-soc variable
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>
2023-10-05 12:08:02 +00:00
Akilesh Kailash
cffa413de4 snapuserd: I/O request on overlapping blocks during snapshot-merge.
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>
2023-10-05 05:32:31 +00:00
Harsh Abichandani
4ac5b76d96 Added liblp_apis_fuzzer
exec/s: 9393
Test: ./liblp_apis_fuzzer
Bug: 285829660

Change-Id: I9830baf7ffbcffa7571aea75e69d1ced64fe613a
2023-10-05 05:03:32 +00:00
Kiyoung Kim
bf65cd213e Merge "Remove libbinder_rpc_unstable from system required libs" into main am: 7cf712ab3b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2762986

Change-Id: I73895850a5c23318f309895a0e91802e7231a270
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 04:27:36 +00:00
Kiyoung Kim
7cf712ab3b Merge "Remove libbinder_rpc_unstable from system required libs" into main 2023-10-05 03:54:36 +00:00
Daniel Zheng
c9770b29b9 Refactor off V2 Cow Ops
Refactor writer, reader + parser to work off v2 version of
CowOperations.

Test: m libsnapshot. ota on cuttlefish
Change-Id: Iec59be91e5f54782272b37702d645942df38c771
2023-10-04 18:09:35 -07:00
Treehugger Robot
72ba5c12be Merge changes Ib7509508,I7e256e8d into main am: 310e7ae496
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2767639

Change-Id: I7a3c878979b3d47963549b78df7d95509ec467a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 00:42:27 +00:00
Christopher Ferris
448b784898 Merge "Change source to be a unique_ptr." into main am: e9f4feaf7e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2768490

Change-Id: I754a47b102834e1a20ca1091af36854a0c6ec33f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 00:42:02 +00:00
Daniel Zheng
a16436d5d7 Adding test for reader compatibility
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
2023-10-04 17:37:26 -07:00
Treehugger Robot
310e7ae496 Merge changes Ib7509508,I7e256e8d into main
* changes:
  snapuserd: Add an extractor tool.
  inspect_cow: Add an --extract-to argument.
2023-10-05 00:25:50 +00:00
Christopher Ferris
e9f4feaf7e Merge "Change source to be a unique_ptr." into main 2023-10-05 00:13:19 +00:00
Elliott Hughes
716ff7b55a s/master/main/
Test: treehugger
Change-Id: Iabb23436d92686b934f2f2609217714b64ae75de
2023-10-04 23:31:09 +00:00
David Anderson
c942daf179 snapuserd: Add an extractor tool.
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
2023-10-03 19:54:28 -07:00
David Anderson
8a28163d33 inspect_cow: Add an --extract-to argument.
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
2023-10-03 16:02:26 -07:00
Steven Moreland
5248c5d72a libvndksupport: log sphal namespace fallback
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
2023-10-03 17:13:10 +00:00
Christopher Ferris
9dabc9ef32 Change source to be a unique_ptr.
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
2023-10-02 17:02:51 -07:00
Treehugger Robot
95879d3e8b Merge "Log the CowOperation when decompression failed" into main am: e877885533
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2768488

Change-Id: Ic4b424caa8183140e53dc28c89990f5883f1e163
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 21:18:27 +00:00
Treehugger Robot
e877885533 Merge "Log the CowOperation when decompression failed" into main 2023-10-02 20:45:38 +00:00
Kelvin Zhang
ab4c9621d4 Log the CowOperation when decompression failed
Test: th
Bug: 302992208
Change-Id: I617062d75a79ae73dfdff13c2e9d2a62c5dfcfc0
2023-10-02 11:08:18 -07:00
Elliott Hughes
fd605f23d1 Merge "Remove obsolete <linux/capabilities.h> workarounds." into main am: b0bff22429
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2770138

Change-Id: I15862cbef6b2c0cdf0a70d2ba636a63b5e98c708
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 16:25:38 +00:00
Elliott Hughes
b0bff22429 Merge "Remove obsolete <linux/capabilities.h> workarounds." into main 2023-10-02 15:09:26 +00:00
Treehugger Robot
63a7d5bcbf Merge "Adjust unit tests for supporting chain partition with no ab" into main am: b90cd3b5ab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2765270

Change-Id: I42ca902df13dd623561dcab721c73c45be153cdc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 04:49:23 +00:00
Treehugger Robot
b90cd3b5ab Merge "Adjust unit tests for supporting chain partition with no ab" into main 2023-10-02 03:28:37 +00:00
Elliott Hughes
7d46c3fd7a Remove obsolete <linux/capabilities.h> workarounds.
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
2023-09-29 22:45:59 +00:00