Commit graph

78386 commits

Author SHA1 Message Date
Akilesh Kailash
6c462c31f6 libsnapshot: reorder COW ops vector
Reorder COW ops vector based on merge sequence. We don't
need additional vector to be stored in memory.

Memory usage for a full OTA on Pixel:

Without Patch:
RssAnon:       61020 kB

With Patch:
RssAnon:	   51112 kB

Bug: 237490659
Test: OTA on Pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I543dd73acfa7cf4e57379e82bc184e943072e7c8
2022-08-16 17:37:10 +00:00
Trevor Radcliffe
d0a522c9f6 Merge "Point directly to generated c sysprop_library" 2022-08-16 15:09:41 +00:00
Xin Li
5386f6a48e DO NOT MERGE - Merge Android 13
Bug: 242648940
Merged-In: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
Change-Id: I2a0c0961fafa9a6f3beb21bfb10ea1ad5082b874
2022-08-15 22:06:32 -07:00
Treehugger Robot
904e71d2dd Merge "libsnapshot: Use SnapshotManager to delete devices." am: 3de2320e5e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2185322

Change-Id: Ia1e64f5e50652efedc9649d5bd7df3d5ba033531
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-13 10:58:13 +00:00
Treehugger Robot
3de2320e5e Merge "libsnapshot: Use SnapshotManager to delete devices." 2022-08-13 10:39:22 +00:00
David Anderson
97e8a2f0e9 libsnapshot: Remove flaky image creation test.
This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
2022-08-12 23:46:31 -07:00
David Anderson
e02ef9e9ce libsnapshot: Use SnapshotManager to delete devices.
Diagnosing DM_DEV_REMOVE failures in the test harness is quite
difficult, and it's not clear if failures are spurious or not. Instead
use SnapshotManager's helper function, which can retry on failure, and
will self-diagnose issues on legitimate failures.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
2022-08-12 23:46:31 -07:00
Trevor Radcliffe
fcfd725a5c Point directly to generated c sysprop_library
Bug: 226199990
Test: m
Change-Id: I0ea65714f9a27093b37034abde7d59f1951a5cb6
2022-08-12 18:23:40 +00:00
Yi-yo Chiang
ecb064f763 Merge "remount: Remove dev_t checks from tests." am: c38725ce9c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2184639

Change-Id: I2b76ef63a3f72029cbea9f4541c2019c1e1bb022
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 06:30:53 +00:00
Yi-yo Chiang
c38725ce9c Merge "remount: Remove dev_t checks from tests." 2022-08-12 06:11:30 +00:00
David Anderson
e4e51662d9 remount: Remove dev_t checks from tests.
These checks have historically been unreliable, and we make no
guarantees around dev_t with overlayfs.

Bug: 242240650
Test: adb-remount-test.sh
Change-Id: I19e7aabec424a22beb0b56d35b198906841178b0
2022-08-11 21:36:43 -07:00
Kelvin Zhang
682e5b530a Add io_uring support to fastboot
Test: th
Bug: 31712568

Change-Id: If18bd4eb53ffe851c31d7dc61906921da111114f
2022-08-11 18:58:43 -07:00
Thiébaud Weksteen
4f0ad3a9d1 Merge "Remove e2fsdroid and sload_f2fs dep from fastboot" am: 8a6fa3127b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2182995

Change-Id: I16237d9001c5aacd68112d3d4d4b2ddd49afbaf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 23:41:44 +00:00
Thiébaud Weksteen
8a6fa3127b Merge "Remove e2fsdroid and sload_f2fs dep from fastboot" 2022-08-11 23:22:43 +00:00
Treehugger Robot
792984a5b5 Merge "remount: On initial overlay setup, return 0 instead of MUST_REBOOT" am: 60dd4690b3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2183077

Change-Id: I6b85b22d141d156a668a230068a25c4460d1d47d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 18:11:29 +00:00
Treehugger Robot
60dd4690b3 Merge "remount: On initial overlay setup, return 0 instead of MUST_REBOOT" 2022-08-11 17:30:35 +00:00
Yi-yo Chiang
dd5ecb2f12 Merge "set-verity-state: Harden logic of overlayfs setup/teardown" am: 7d294906d9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2176946

Change-Id: I2e95167ca804a3408e5526ab03dd3b8ba4a6d6c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 15:11:18 +00:00
Yi-yo Chiang
7d294906d9 Merge "set-verity-state: Harden logic of overlayfs setup/teardown" 2022-08-11 14:43:52 +00:00
Yi-yo Chiang
c7b2916168 Merge "Fix build breakage on -user build" am: 8959962b22
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2183178

Change-Id: I40418b762f4eab3634814712aeffe656b9f80fc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 11:27:36 +00:00
Yi-yo Chiang
8959962b22 Merge "Fix build breakage on -user build" 2022-08-11 10:51:35 +00:00
Yi-Yo Chiang
258f0237c9 set-verity-state: Harden logic of overlayfs setup/teardown
Refactor set_avb_verity_state() to return tri-state result:
  {.success=false}
    Failed to set verity state.
  {.success=true, .want_reboot=false}
    Success but verity already is requested state, so no need to reboot.
  {.success=true, .want_reboot=true}
    Successfully changed verity state, need reboot to take effect.

Setup overlayfs only if verity is going to be or already disabled.
Teardown overlayfs regardless of enable-verity success of not.
This ensures more robust behavior of setup / teardown overlayfs.

Adjust the log messages for consistent wording.
No point logging the errno of fs_mgr_overlayfs_[setup|teardown]
because the error must already be logged by callee.

Bug: 241688845
Test: adb [disable|enable]-verity
Change-Id: I3a77fe567757ca6173e8c3142e77fef483d9b849
2022-08-11 17:23:13 +08:00
Yi-Yo Chiang
3de7da950d Fix build breakage on -user build
Bug: 242145724
Test: Build any -user product
Change-Id: Id34f14a834919f1e381d0365d50847cb52cedf8d
2022-08-11 16:50:43 +08:00
Yi-Yo Chiang
9d03610680 remount: On initial overlay setup, return 0 instead of MUST_REBOOT
aosp/I212bdb0e97016dec50618962d7c24f46d35764c7 changes
`remount` to return MUST_REBOOT after initial overlay setup.
This causes DsuGsiIntegrationTest to fail because the non-zero exit code
cause the test script to think the `remount` command failed.

Change it so that we return 0 instead, to indicate that we
"successfully" setup a new overlay.
We should only return non-zero on unrecoverable error, like when we
failed to disable verity, failed to setup overlay, failed to perform
MS_REMOUNT.

Bug: 241179247
Test: DsuGsiIntegrationTest
Change-Id: I280ffa988118c59e366cdd5bd1479bb43896c278
2022-08-11 14:53:12 +08:00
Yi-yo Chiang
f3725dcdaf Merge "set-verity-state: Start a threadpool to service waitForService() CB" am: e761510df0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2181315

Change-Id: Ie76d47c31bbb39861ad01a289a9c12582e28a7be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 06:20:38 +00:00
Treehugger Robot
f12ec6fb16 Merge "Promote HWASan tests to presubmit." am: a8fde6445d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2182216

Change-Id: I81c13d0928cac2aa05a62cc6baa7a24d7d99548b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 06:20:28 +00:00
Yi-yo Chiang
e761510df0 Merge "set-verity-state: Start a threadpool to service waitForService() CB" 2022-08-11 06:00:30 +00:00
Treehugger Robot
a8fde6445d Merge "Promote HWASan tests to presubmit." 2022-08-11 05:51:21 +00:00
Thiébaud Weksteen
3c1f230971 Remove e2fsdroid and sload_f2fs dep from fastboot
In commit 5d72d6c, an unused code path for e2fsdroid and sload_f2fs was
removed from fastboot. Remove them from the build dependency list.

Bug: 237960487
Test: m fastboot
Change-Id: Ibee72a86eeb43fcde3a032094bfc1c19de09bc03
2022-08-11 15:36:17 +10:00
Florian Mayer
b68f8a12fd Promote HWASan tests to presubmit.
They have been passing and do not show significant slowdown.

Change-Id: Ie187af5af5defc4738a93140ed840e4a4cd48f55
2022-08-10 19:50:31 +00:00
David Anderson
bd97a1d1f8 Merge changes I7a9e07a4,I3ddab553,I212bdb0e am: 2e007e039b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2175951

Change-Id: Ie30e4e7da2717667e869f3f453bdbd3bd81a9af4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 19:29:10 +00:00
Bart Van Assche
380c12afaf Merge "libprocessgroup: Fix a log message" am: 693ac06a4c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2174782

Change-Id: If85498b868ff992cccd180be3d0aa2d84c8533b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 19:28:48 +00:00
David Anderson
2e007e039b Merge changes I7a9e07a4,I3ddab553,I212bdb0e
* changes:
  remount: Remove the "backing" parameter to fs_mgr_overlayfs_setup.
  remount: Prevent error spam when remounting fails.
  remount: Move more stuff out of do_remount.
2022-08-10 19:13:45 +00:00
Bart Van Assche
693ac06a4c Merge "libprocessgroup: Fix a log message" 2022-08-10 18:33:18 +00:00
Yi-Yo Chiang
1305c15974 set-verity-state: Start a threadpool to service waitForService() CB
Bug: 241688845
Bug: 241739850
Test: adb disable-verity / adb enable-verity
Change-Id: I5871e0e0f3014b2f4beb786fef4dc4f75af3fbf5
2022-08-10 14:47:32 +08:00
Yi-yo Chiang
1c209f8614 Merge "set-verity-state: Refactor & remove even more dead code" am: 2db517703d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2176442

Change-Id: Ie1a475c23a62dda9891f7fb70e3f539c63ef7100
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 04:09:58 +00:00
Yi-yo Chiang
2db517703d Merge "set-verity-state: Refactor & remove even more dead code" 2022-08-10 03:48:04 +00:00
David Anderson
e9e3f6e01b remount: Remove the "backing" parameter to fs_mgr_overlayfs_setup.
This is unused.

Bug: 241179247
Test: remount
Change-Id: I7a9e07a4cf397c6fc8909a9959e08d1aefa3216a
2022-08-09 12:14:00 -07:00
David Anderson
63432cd317 remount: Prevent error spam when remounting fails.
Cuttlefish's combined fstab has two entries for every partition, which
causes a lot of error spam when remount fails. Fix this by only
remounting entries that match an actual mount point (if such a mount
point exists).

Bug: 241179247
Test: remount on broken kernel
Change-Id: I3ddab553706f98b45f83221fd195f481dfdcc5c0
2022-08-09 12:13:59 -07:00
David Anderson
9e8c41c511 remount: Move more stuff out of do_remount.
This moves more logic out of do_remount and into main(). This eliminates
some redundant code.

Bug: 241179247
Test: remount
Change-Id: I212bdb0e97016dec50618962d7c24f46d35764c7
2022-08-09 12:13:59 -07:00
Treehugger Robot
742c3c5eeb Merge "set-verity-state: Simplify args parsing logic" am: f78b2d1725
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2176945

Change-Id: I33035c8c62dce83c01ee48cc52bd8c3450d675e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 09:45:22 +00:00
Treehugger Robot
f9c8dce0d7 Merge "fs_mgr: Copy the blk_device from start_idx to current index" am: 3eb67e8829
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2177122

Change-Id: I58bb21ac51764238ebd63e846b674aafe282bd1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 09:45:12 +00:00
Treehugger Robot
f78b2d1725 Merge "set-verity-state: Simplify args parsing logic" 2022-08-09 09:29:03 +00:00
Treehugger Robot
3eb67e8829 Merge "fs_mgr: Copy the blk_device from start_idx to current index" 2022-08-09 09:21:01 +00:00
Yi-Yo Chiang
6bb1acb2a4 set-verity-state: Refactor & remove even more dead code
Remove even more VB1.0 handling dead code.
Log to both logd and stderr.
Print all debug messages to LOG.
Move all non-externals to annonymous namespace.

Bug: 241688845
Test: adb shell set-verity-state [0|1]
Change-Id: Icda795f185f7bc97607b48d0b529ee02a4580b70
2022-08-09 14:34:24 +08:00
Yi-Yo Chiang
7fd9d4f222 set-verity-state: Simplify args parsing logic
Bug: 241688845
Test: adb [disable|enable]-verity
Test: adb shell set-verity-state [0|1]
Change-Id: I751e6b79c690d986a9cde7fc94c81c5b3ce884f0
2022-08-09 14:27:42 +08:00
Bart Van Assche
ccaac4ad21 libprocessgroup: Fix a log message
Fix the function name in a log message inside CgroupSetup().

Bug: 213617178
Change-Id: I897c831f5e53093df2664e0e8ceefadf9a89369c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-08 11:07:02 -07:00
chenyc5
ec07ce6811 fs_mgr: Copy the blk_device from start_idx to current index
If next same mount point also is logical partition, but its blk_device
is not updated yet and still is logical partition name not a mapper
device (/dev/block/dm-X) to cause mount failed.

To support the below fstab configs in fstab.postinstall.
system /postinstall ext4  ro,nosuid,nodev,noexec slotselect_other,logical
system /postinstall erofs ro,nosuid,nodev,noexec slotselect_other,logical

Error logs:
system_b: Can't open blockdev
init: [libfs_mgr]__mount(source=system_b(missing),target=/postinstall,type=erofs)=-1: No such file or directory

Bug: b/241716684
Test: After factory device reset, ensure system_b is mounted as EROFS
Change-Id: I02f20f3dfd8c42be9981915eaff88a5948482724
2022-08-08 11:04:36 +00:00
Yi-yo Chiang
2aa2e7f981 Merge "set-verity-state: Simplify code path around overlayfs_setup()" am: b3e303caad
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2173964

Change-Id: I1f286ddf3b75bcc50a2885c4df175659b6ee6bbd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 05:51:01 +00:00
Yi-yo Chiang
6467eeddbd Merge "set-verity-state: Remove dead code that was used by AVB 1.0" am: 83b12a5c07
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2173963

Change-Id: I0c347cb9d2389e93706d5824f8c66cd59cf595ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 05:50:52 +00:00
Yi-yo Chiang
b3e303caad Merge "set-verity-state: Simplify code path around overlayfs_setup()" 2022-08-08 05:31:07 +00:00