Commit graph

3344 commits

Author SHA1 Message Date
David Anderson
012a8625bd Merge "snapuserd: Use fixtures in snapuserd_test." am: 9bbe597b59 am: 6be3810b15 am: 1e21b9f11c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2436355

Change-Id: If5e4a0a217813e70a5f81c80bcda41ee584ede93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 20:36:40 +00:00
David Anderson
5169ec88c6 snapuserd: Use fixtures in snapuserd_test.
This refactors snapuserd_test to use SnapuserdTest as a fixture, to
avoid needing a separate harness instance.

Bug: 269361087
Test: snapuserd_test
Change-Id: Iffdc7b621dbe0aff72eff790e7af3f6bb33036ee
2023-02-14 16:59:31 -08:00
David Anderson
b7d8b7e150 Merge "liblp: Fix a crash when adding an image to a partition with no extents." am: 69863bd977 am: 6b4cc0a8ad am: 40fc9593b7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2428712

Change-Id: If858e96872264f3c047b561478375f4a13501a38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 01:50:28 +00:00
David Anderson
69863bd977 Merge "liblp: Fix a crash when adding an image to a partition with no extents." 2023-02-13 23:28:14 +00:00
Akilesh Kailash
71fcb07f4b Merge "libsnapshot: Wait for daemon to terminate after snapshot unamp" am: 1324002fbf am: 9690d12f8b am: 2a14ed409f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2431652

Change-Id: Ia67d92ef34b8ddda4969add6afe089586e3e1868
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-11 02:49:06 +00:00
Akilesh Kailash
d2063ad7dd libsnapshot: Wait for daemon to terminate after snapshot unamp
During verification, update-engine will invoke
SnapshotMap() and Unmap() for every partition verification.

Post Unmap(), update-engine immediately invokes Map()
for next partition. This is a narrow window wherein, daemon
from previous unmap() is still present and init hasn't
terminated it. Thus, when next MapSnapshot() is invoked,
Connect() fails as init may end up terminating the service.

Wait for the daemon to fully terminate and exit
when Detach() is invoked.

Bug: 258514587
Test: OTA on Pixel, Map/Unmap in a loop
Change-Id: I36b7ce183dfa4c89a873118876d195480e28d48c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-02-10 14:31:52 -08:00
David Anderson
8fc623eb63 liblp: Fix a crash when adding an image to a partition with no extents.
Bug: N/A
Test: lpmake --partition=system:readonly:0 --image=system=system.img
Change-Id: I4de616cc1b9ca2838d38518ec24a382f4bc1b1be
2023-02-08 22:09:58 -08:00
David Anderson
adeb7085b3 Merge changes I72cf6f52,I9620e5b4 am: 40bb403c45 am: bb0a97e139 am: 3af14713fa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2423148

Change-Id: Ia02b7a2938565c705fb20b9caa5aff2193387c76
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-08 05:49:32 +00:00
David Anderson
40bb403c45 Merge changes I72cf6f52,I9620e5b4
* changes:
  libsnapshot: Fix crash in cow writer test due to missing ASSERT.
  libsnapshot: Improve low space tests.
2023-02-08 04:03:55 +00:00
Treehugger Robot
d9b0b01919 Merge "UDC: Dm-Bow failed to load when size is not Multiple of 4096" am: 525c8bbc08 am: 6062d29256 am: 6263f499cc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2401132

Change-Id: I49eced12263c0246c5050cb2df5e58a1dbf7a03f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 20:49:34 +00:00
Treehugger Robot
525c8bbc08 Merge "UDC: Dm-Bow failed to load when size is not Multiple of 4096" 2023-02-07 18:44:37 +00:00
David Anderson
bda181a86a libsnapshot: Fix crash in cow writer test due to missing ASSERT.
Bug: N/A
Test: vts_libsnapshot_test
Change-Id: I72cf6f52fc15061da669d14cf5d334b44ad83501
2023-02-07 05:24:27 +00:00
David Anderson
111bec1e90 libsnapshot: Improve low space tests.
These tests have historically been pretty flaky, and have gone through a
few rounds of improvement. This is yet another: remove the
parameterization, so we can test that at least one variant of the test
succeeds, rather than all of them.

Filesystems (especially F2FS) have a lot going on underneath the hood,
and there's no guarantee that precise free space can be allocated,
measured, or relied upon in the ways this test expects. And all that we
really need to test is that some kind of out-of-space error can be
triggered.

Bug: 266645706
Test: vts_libsnapshot_test
Change-Id: I9620e5b496d5020b21cc37074e87dd21fc419ed2
2023-02-07 05:24:26 +00:00
Kelvin Zhang
373610601d Merge "Set output value in error case" am: a0427c41c1 am: 1e3d01abb3 am: e72eeb31b2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2417979

Change-Id: Ibd273ba1cb07102e75bf483f627f99b65f89acb4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:43:32 +00:00
Greg Kaiser
451dfee3c7 Set output value in error case
We want to set the contents of "out_size_num_byte", and not
the pointer value, in the error case.

Bug: 266757931
Change-Id: I02edddcbcc4fc80dbb61efe8dc7c45bd3ce1c904
Test: TreeHugger
2023-02-02 00:05:21 +00:00
David Anderson
e24abcb57c Merge changes Ib744d763,I74278bb5,I3d240d6e,I1b41d233 am: 7cf627bac9 am: d60cb43eee am: 7c09c785ba
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2403583

Change-Id: I1aca8161b1157494c642e1e55769d7cf20257b75
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 23:44:32 +00:00
David Anderson
758ba19148 Merge "OTA: make lp_metadata write more atomic" am: 4c96a1673e am: cf2af64b4d am: 36c10953ed
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2387982

Change-Id: I52138b17667fd5efa8a411d40d6d5702348440cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:08:24 +00:00
David Anderson
7cf627bac9 Merge changes Ib744d763,I74278bb5,I3d240d6e,I1b41d233
* changes:
  fastboot: Move some helpers into util.h/.cpp.
  fastboot: Allow using LOG().
  fastboot: Use RAII for sparse_file objects.
  liblp: Add a helper class for building sparse-compatible super image layouts.
2023-02-01 21:27:03 +00:00
Zhou Xuezan
45eee7fe52 OTA: make lp_metadata write more atomic
Powerloss of OS failure occurs when super is merging,
then the device can't bring up again for no lp_metadata sync,
so make lp_metadata sync in time.

Change-Id: I1ea31662b838e35022a566b614796f2d5e05df4b
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
2023-02-01 08:17:38 +00:00
David Anderson
e6cef616f1 liblp: Add a helper class for building sparse-compatible super image layouts.
This class helps export a list of regions comprising a super partition,
and what the contents of those regions should be. It is very similar to
ImageBuilder, except that it does not require actual partition image
files, nor does it actually write an image file to disk.

The goal is to support building an in-memory super image that uses as
little memory and backing storage as possible. For example, fastboot can
use this to upload a super image without having to read and write
gigabytes of unnecessary data.

Since the goal is to optimize fastboot, we've taken some shortcuts here.
Retrofit devices and other edge-casey behavior are safely rejected. We
also don't rely on libsparse behavior here, and attempt to make the
translation to sparse records as trivial as possible, by explicitly
declaring where fill/dontcare gaps are, and only exporting 4KB aligned
regions. Hopefully this will allow the code to be portable to
non-fastboot consumers.

Bug: 266982466
Test: liblp_test
Change-Id: I1b41d233bc4512c4b62e19603e8e77bc5867cfab
2023-01-31 18:46:35 -08:00
Treehugger Robot
cfc0c8935f Merge "Report partition sizes to avb" am: 06a150b9f5 am: 496ac99974 am: 65add37e41
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2400820

Change-Id: If5c89e66ab44c89fb8a6cccf36a8f530e1c79643
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-31 22:39:04 +00:00
Treehugger Robot
06a150b9f5 Merge "Report partition sizes to avb" 2023-01-31 20:07:54 +00:00
Kelvin Zhang
dbc4a788f7 Report partition sizes to avb
This might allow avb to save some memory by only allocate as much memory
needed to hold the partition data, instead of allocating for maximum
possible partition size(64K).

Bug: 266757931

Change-Id: I82a4b1ba3544910072050e45a7cb91e0dcbc4d05
2023-01-31 10:20:25 -08:00
Yi-yo Chiang
6b0a47fdcf Merge "fs_mgr: Add one space between [libfs_mgr] tag and log msg" am: 1946945ac0 am: 96c372f125 am: 9a79458487
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2294139

Change-Id: Ifbe02922510808560884600aeaa46d1325cd8086
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-31 16:58:58 +00:00
Yi-Yo Chiang
bc851b6dbf fs_mgr: Add one space between [libfs_mgr] tag and log msg
This is but a cosmetic change. Before:

> [libfs_mgr]__mount(...

After:

> [libfs_mgr] __mount(...

Also change liblp, libfs_avb and libvbmeta.

Bug: 241688845
Test: Presubmit
Change-Id: I7d408a94a7fe279d9b65d699e22159b167f34526
2023-01-31 09:41:43 +00:00
David Anderson
5bcc69afd3 Merge "libdm: Remove dm_linear_fuzzer." am: 09545d1454 am: 05e84122c2 am: 4ee9d87e30
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2400933

Change-Id: Ia1d3c05cb1c88c27911e7890d231e5578ad012c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 20:11:02 +00:00
David Anderson
09545d1454 Merge "libdm: Remove dm_linear_fuzzer." 2023-01-25 18:05:25 +00:00
David Anderson
b888430f15 libdm: Remove dm_linear_fuzzer.
This fuzzer can only mutate the numerical inputs to a dm-linear table,
which is unlikely to find kernel bugs, and very unlikely to find libdm
bugs. There are a number of automated notifications from it due to
making ASSERT_EQ a no-op, which causes misuse of libdm API calls. None
of these appear to be real bugs.

Bug: 174907083
Test: N/A
Change-Id: Iaa8955eaa4423e4315b8cb74741e6425a56cc303
2023-01-24 21:37:18 -08:00
David Anderson
47e60712d5 Merge "libsnapshot: Test more configurations in presubmit." am: 0c1d449f29 am: 6e1e77c660 am: 911897134c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2169029

Change-Id: I79663540fc399ca6cc3c7dd611ffc78d9eaef6e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 03:07:08 +00:00
David Anderson
3753107a54 Merge "libdm: Fix failing test on older kernels." am: f723ef3043 am: eec0f740a6 am: e09878e2cd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2400932

Change-Id: I6c6185f8b5d5f85613dbfda7b15a1feb3ac02694
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 03:03:07 +00:00
David Anderson
0c1d449f29 Merge "libsnapshot: Test more configurations in presubmit." 2023-01-25 00:07:43 +00:00
David Anderson
f723ef3043 Merge "libdm: Fix failing test on older kernels." 2023-01-24 23:51:08 +00:00
David Anderson
124d980aad libsnapshot: Test more configurations in presubmit.
Take 2: remove the shell script, which wasn't working very well, and
just provide different builds of the same binary.

Bug: 208944665
Test: presubmit
Change-Id: I994a93e4e364bc210ddd2eb60025c656caa86b1c
2023-01-24 14:11:00 -08:00
Swapneel Mashalkar
d3d6b84552 UDC: Dm-Bow failed to load when size is not Multiple of 4096
BUG : 240098675

Skip Dm-Bow load incase size is not a Multiple of 4096.
Rounding down does not hurt, since ext4 will only use full blocks

Change-Id: Ie4e6634b2c49762e4669e66d94effc91d8e581ca
Signed-off-by: Swapneel Mashalkar <quic_smashalk@quicinc.com>
2023-01-24 09:59:32 +00:00
David Anderson
717b97a201 libdm: Fix failing test on older kernels.
This test was added only for behavior introduced in the 5.15 kernel, where uevents are delayed until a table is laoded.

Bug: 263291020
Test: libdm_test
Change-Id: I6236c4304d8e6b780704df405290f7361d5827cc
2023-01-24 05:20:57 +00:00
Eric Biggers
0d94252d13 Merge "Clean up references to FDE in documentation and comments" am: 381c884a96 am: 9955283151 am: b12ab4f1ae
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2389159

Change-Id: I24fa4c5f05db00c54aad4c6142a97a68d63cc188
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-18 21:22:23 +00:00
Eric Biggers
5265b8d425 Clean up references to FDE in documentation and comments
Bug: 208476087
Change-Id: I328026d68c9dd7a5042ef4b5369f34af93760b37
2023-01-18 02:17:43 +00:00
Treehugger Robot
c6574f462b Merge "Find a zoned partition automatically" am: b9e1821201 am: 86cde046cf am: 5effe931fe
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2385375

Change-Id: Id484558b0f32a8c292b55096b264eab32dbf6792
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-18 00:28:33 +00:00
Treehugger Robot
b9e1821201 Merge "Find a zoned partition automatically" 2023-01-17 22:22:26 +00:00
Treehugger Robot
c07bab6cb5 Merge "TEST_MAPPING: add vts core lib tests" am: aaa402ae6a am: 3960126eb1 am: ce3a092e46
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2381872

Change-Id: I096f4c670c5ffe4799002a8b1f6b26f14acaaaf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-17 21:11:23 +00:00
Treehugger Robot
aaa402ae6a Merge "TEST_MAPPING: add vts core lib tests" 2023-01-17 18:40:24 +00:00
Jaegeuk Kim
b92e5b5c48 Find a zoned partition automatically
Since we cannot create a gpt table on zoned LU, we cannot make a generic symlink
from it. Instead, let's make it by uevent, "/dev/block/by-name/zoned_device".
Note that, we support only one zoned device in the system.

Bug: 265180564
Change-Id: Ie62b0fd68b77e3e43cf0f5c5cad9503150174271
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-01-14 10:29:31 -08:00
Akilesh Kailash
69e6289abc Merge "init: Wait for daemon to fully spin up all threads" am: 545870e53a am: 3aabed9e77 am: 3726d0de46
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2373312

Change-Id: I27fcda71d877f83348e57441fa6c2925e8c56e84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-13 08:37:29 +00:00
Akilesh Kailash
545870e53a Merge "init: Wait for daemon to fully spin up all threads" 2023-01-13 06:35:33 +00:00
Treehugger Robot
72ab563beb Merge "remount: Add checkpoint instructions with warning" am: 99b26cf41b am: 4e9c95a361 am: 9d88ff33de
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2385292

Change-Id: Ic0fcb316a3209d1468c4d3ec1a5cdb09d755acf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 03:05:14 +00:00
Treehugger Robot
5f2af72b95 Merge "Do not create worker thread if threading isn't enabled" am: a4dae3c6f5 am: 4ed3c3bf6d am: 89d563975b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2378128

Change-Id: I50f8b20d6a6b1d29e66d2c081012b049164b3009
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 03:04:49 +00:00
Treehugger Robot
99b26cf41b Merge "remount: Add checkpoint instructions with warning" 2023-01-12 01:44:03 +00:00
Treehugger Robot
a4dae3c6f5 Merge "Do not create worker thread if threading isn't enabled" 2023-01-12 01:12:06 +00:00
Daniel Rosenberg
61b2304ffb remount: Add checkpoint instructions with warning
When debugging an issue before boot complete, it may be necessary to
remount before checkpointing can finish. This gives instructions on
ending checkpointing early, allowing a remount, along with a warning to
not do that unless you know what you are doing.

Bug: 252989722
Test: Displays text in log
Change-Id: Ibdd39464b980ec531a900e162469a884f9096904
2023-01-12 00:04:54 +00:00
Akilesh Kailash
ce2820675e Merge "init: Avoid killing all processes during reboot if update is in progress" am: 717ee9120a am: f4e4e6e624 am: 5bf79d0f87
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2373311

Change-Id: I7b00c1d51870de26eecbc31bc8fc789d2c8749b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-11 23:14:05 +00:00