Commit graph

86236 commits

Author SHA1 Message Date
Akilesh Kailash
12449ed672 Merge "libsnapshot: Wait for COW path" into main am: 9eeebf7043
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2810376

Change-Id: Id87d7ff48f35ff1ea83f227a56a216db2bf221ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 17:57:05 +00:00
Akilesh Kailash
9eeebf7043 Merge "libsnapshot: Wait for COW path" into main 2023-10-31 17:44:36 +00:00
Treehugger Robot
d7095f37f9 Merge "Initialize the appcompat system property folder" into main am: 1f5e877185
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2786943

Change-Id: Id48871f6813e0501e9ff112d841c8a27ca7a304f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 02:54:00 +00:00
Treehugger Robot
1f5e877185 Merge "Initialize the appcompat system property folder" into main 2023-10-31 02:29:56 +00:00
Akilesh Kailash
8fb49bc0a2 libsnapshot: Wait for COW path
After mapping COW device, wait for the device to appear
before initializing it.

Bug: 305829996
Test: OTA on Pixel
Change-Id: If9e0e1ce684aa15bc9f3fd5a01e4f0421de87e81
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-10-30 12:14:15 -07:00
Kiyoung Kim
05c59f1233 Merge "Deprecate Vendor Overlay when VNDK is deprecated" into main am: dfe80e48f9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2806073

Change-Id: Ib45734e98b4ef8deea7cb093691eaaef34d3b6cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 05:45:26 +00:00
Kiyoung Kim
dfe80e48f9 Merge "Deprecate Vendor Overlay when VNDK is deprecated" into main 2023-10-30 05:12:37 +00:00
Kiyoung Kim
260e48f07e Deprecate Vendor Overlay when VNDK is deprecated
Vendor overlay was introduced to enable system-only update with small
changes on the vendor, but this is no longer required with same reason
of VNDK deprecation - more frequent Vendor update than expected, and
makes system-vendor interface unstable. This change adds more comments
to explain that Vendor overlay will be deprecated along with VNDK, and
skip test if VNDK is deprecated.

Bug: 307925435
Bug: 307902290
Test: fs_mgr_vendor_overlay_test passed with CF trunk-staging device
Change-Id: I7b9359a5754e8740e749c48f6265a1b0f92f13af
2023-10-30 13:19:12 +09:00
Tomasz Wasilczyk
eca183277d Merge "Allow disabling callstack" into main am: 3f214d7a09
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2806231

Change-Id: I23e7d13eb1581abbe751867c3f05bb5b91440d46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-29 01:06:19 +00:00
Tomasz Wasilczyk
3f214d7a09 Merge "Allow disabling callstack" into main 2023-10-29 00:46:54 +00:00
Treehugger Robot
1b152f4337 Merge "Create integration test for fastboot CLI" into main am: fe72eca034
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2803255

Change-Id: If6063150d6776f36364072e0a54e24ec1cf36922
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-27 19:18:25 +00:00
Treehugger Robot
fe72eca034 Merge "Create integration test for fastboot CLI" into main 2023-10-27 18:52:47 +00:00
Tomasz Wasilczyk
b6f459abbc Allow disabling callstack
Bug: 302723053
Test: mma
Change-Id: Idea326cc9914d4c81d75dad287e169c09a736486
2023-10-27 10:48:43 -07:00
William Hester
bdf0b1bb83 Create integration test for fastboot CLI
We rely on parsing the `fastboot devices` output in device labs, and a
format change previously broke us. This test will ensure that the output
is exactly what we expect.

Test: atest --host fastboot_integration_test

Change-Id: I7606e7b3e4a1edfe487ff14bb06cbd3c0a3aa777
2023-10-26 16:51:33 -07:00
Automerger Merge Worker
f1a1d53058 Merge "Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev am: 76a9eb4374" into main am: 8fbaaa33a1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2800753

Change-Id: I1833b29cc2badeea85d8ba80df11e910601d3450
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-26 21:55:22 +00:00
Automerger Merge Worker
8fbaaa33a1 Merge "Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev am: 76a9eb4374" into main 2023-10-26 21:26:53 +00:00
Treehugger Robot
54f2e06cf5 Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev am: 76a9eb4374
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2800753

Change-Id: I403f0915937a0c8b24a54b5b265b70b1ce529ff2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-26 21:26:48 +00:00
Christopher Ferris
cf8cd918ab Merge "Fix indices in fuzzer." into main am: 268c408310
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2803177

Change-Id: Ie148a568af931c7ba08d4edc0aa1270eefe513ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-26 19:08:18 +00:00
Christopher Ferris
268c408310 Merge "Fix indices in fuzzer." into main 2023-10-26 18:37:06 +00:00
Steven Moreland
99dcd84512 Merge "libutils_binder: isolate headers" into main am: f1168c7b0b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2798774

Change-Id: I5e7693d621a63a52bff723200cfc2274931ae385
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 23:48:17 +00:00
Steven Moreland
f1168c7b0b Merge "libutils_binder: isolate headers" into main 2023-10-25 23:13:59 +00:00
Treehugger Robot
76a9eb4374 Merge "vts_fs_test: Do not check /metadata for automotive" into android14-tests-dev 2023-10-25 16:56:56 +00:00
Yi-Yo Chiang
79e5c4f419 Merge "remount: If checkpoint is in progress, wait for it to complete" into main am: a93795deae
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2801314

Change-Id: I97b10cbef0b71e93d46698ca4da990f8b312feab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 06:45:17 +00:00
Yi-Yo Chiang
a93795deae Merge "remount: If checkpoint is in progress, wait for it to complete" into main 2023-10-25 06:22:12 +00:00
Steven Moreland
c738370273 libutils_binder: isolate headers
This isolated all libutils_binder headers from libutils
except for RefBase use of CallStack.h. This header can
be disabled with a macro option easily.

Bug: N/A
Test: N/A
Change-Id: I83af091fc17b5418ab9e4d7fc41fb43792ec547d
2023-10-24 23:45:01 +00:00
Christopher Ferris
14e997fe43 Fix indices in fuzzer.
There are a few places where an index is randomly generated, but the
max is incorrectly set to the size of the value not one less than
the size.

All of these occurrences have been fixed.

Bug: 306230574

Test: Ran fuzzer instance that failed, no longer fails.
Change-Id: I20dfbc19a0df9cb160f8c861e072f083e24a4fab
2023-10-24 14:38:49 -07:00
Yi-Yo Chiang
50dca4a77b remount: If checkpoint is in progress, wait for it to complete
Instead of having the user to retry the `remount` command until success
(manual poll). Just block the remount command until checkpoint is
complete, and then continue.

Bug: 252989722
Test: adb remount on a cold device, remount command would block for a
  few dozens of seconds and then continue.
Test: adb remount on a warm device, remount command would process
  immediately. Do not show "force end checkpointing" instructions.
Change-Id: I65f3a5ade4c9538a55892345c75b45ac3a1755fd
2023-10-24 13:15:03 +00:00
Philip Chen
35817eeb55 vts_fs_test: Do not check /metadata for automotive
This aligns with GAS req 4.0.

Bug: 307215040
Test: build
Change-Id: I2115e147d484d066f892ea50eeca626e64beebfc
2023-10-23 21:43:23 +00:00
David Anderson
0f3636f28f Merge "Refactor off COW header v3" into main am: d1e286f12f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2789989

Change-Id: I928880a8204626e2569a76620a4281589e1816cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 18:49:18 +00:00
David Anderson
d1e286f12f Merge "Refactor off COW header v3" into main 2023-10-23 18:25:46 +00:00
David Anderson
ee64b2df4f Merge "fastboot: Fix flashing failure when a sparse image has an avb footer." into main am: ee4c926247
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2798383

Change-Id: I474c1f3d1549abe62cd6f1c5c0cc8a710b471dd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 17:17:51 +00:00
David Anderson
ee4c926247 Merge "fastboot: Fix flashing failure when a sparse image has an avb footer." into main 2023-10-23 16:44:07 +00:00
Yi-Yo Chiang
469089e100 Merge changes I6debf849,I6cdbe8c5 into main am: 3609bf706c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2798355

Change-Id: I4568aa09f859c8ac883504ec106f4280546faf78
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 08:26:54 +00:00
Yi-Yo Chiang
3609bf706c Merge changes I6debf849,I6cdbe8c5 into main
* changes:
  fs_mgr_overlayfs: Remove temp dir under /dev when aborting
  fs_mgr_overlayfs: Support remounting submounts
2023-10-23 07:58:02 +00:00
Yi-Yo Chiang
05d3adb713 fs_mgr_overlayfs: Remove temp dir under /dev when aborting
When aborting from fs_mgr_overlayfs_mount, we should remove any temp dir
we created under /dev before aborting the program.

Bug: 306124139
Test: adb-remount-test
Change-Id: I6debf84935e39d884f2f5b3e9720fdfd4332465c
2023-10-23 07:57:28 +00:00
Yi-Yo Chiang
c78df87fad fs_mgr_overlayfs: Support remounting submounts
The move mount motions logic are built on top of heuristics and allow
non-fatal failures.
If the overlay was setup and mounted without reboot (this could happen
if AVB is disabled), the mount state (especially the MS_SHARED and
MS_PRIVATE flags) can still get skewed somehow, due to unforeseen errors
or resource race.
It is always advised to reboot after initial overlay setup, as the
overlay mount logic is less likely to require moving submounts when
executed by `init`, this provides the greatest chance of success.

Below is an example of the expected outcome of remounting submounts:
[precondition]
* AVB is already disabled, so overlay is setup and mounted w/o reboot
* No existing overlay; is initial overlay setup

0. /proc/self/mountinfo would contain something like:
<id> <parent id> <mountpoint> <shared/private> <filesystem>
2    1           /product     shared:2         erofs
3    2           /product/app shared:3         erofs

1. adb remount /product/app
(note how the mount flag of <3> changes to private so <30> can be
MS_MOVE later)
2    1           /product     shared:2         erofs
3    2           /product/app private          erofs
30   3           /product/app shared:30        overlay

2. adb remount /product
(note how the parent of <30> changes to <40> as the result of MS_MOVE)
(note that <3> is _not_ moved)
2    1           /product     private          erofs
3    2           /product/app private          erofs
30   40          /product/app shared:30        overlay
40   2           /product     shared:40        overlay

Bug: 306124139
Test: adb-remount-test
Test: Verified with a remount submount scenario by editing the fstab.
Test: remount /system/bin then /system and verify the submount overlay
  (/system/bin) is moved under the parent mount overlay (/system).
Change-Id: I6cdbe8c52d826a6f03fd363c909ebb0005446b96
2023-10-23 07:57:28 +00:00
Jason Chiu
3759d342d5 Merge "bootstat: add more bootreasons" into main am: b28db2a923
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2786439

Change-Id: I142758be2cfc14498129b0fe64fea4d933851273
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 02:57:38 +00:00
Jason Chiu
b28db2a923 Merge "bootstat: add more bootreasons" into main 2023-10-23 02:36:37 +00:00
David Anderson
0bc02bfe71 fastboot: Fix flashing failure when a sparse image has an avb footer.
Trying to move the AVB footer on a sparse file will corrupt the sparse
format. Rather than implement this properly, for now, have the
copy_avb_footer() function gracefully fail by skipping the operation.

Bug: 304574023
Test: fastboot flash sparse image with avb footer
Change-Id: Ia6f0711789a04897ec266ad604a3d243c7184082
2023-10-20 11:20:53 -07:00
Treehugger Robot
054526a660 Merge "fs_mgr_overlayfs: Don't try to mount scratch if already mounted" into main am: 7bcd7715f8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2797335

Change-Id: I9d00003dc80bfec97fb56e9049b4bef8160b79f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20 17:51:01 +00:00
Treehugger Robot
7bcd7715f8 Merge "fs_mgr_overlayfs: Don't try to mount scratch if already mounted" into main 2023-10-20 17:36:00 +00:00
Treehugger Robot
c5dec993c8 Merge "Don't overwrite persistent property files" into main am: 68fbe13281
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2796061

Change-Id: Id7e82d8d586ea9df230c12dea2a3f58addafdc00
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20 17:32:21 +00:00
Treehugger Robot
68fbe13281 Merge "Don't overwrite persistent property files" into main 2023-10-20 17:19:58 +00:00
Jiyong Park
c7230a1eb1 Don't overwrite persistent property files
This fixes a bug introduced by I81b6bd984aad8f7ddec93ce74f4543e4f71be508

In the original CL, setting a sysprop `next_boot.<name>` and then
rebooting the device could remove all the persistent properties stored
in /data/property/persistent_properties. It happened because the
function `WritePersistentProperty` is called with a properties set which
is initialized as an empty set and then added with the properties which
had the next_boot prefix.

As a result...

Before the boot:
* persist.a = 1
* next_boot.b = 2
* next_boot.persist.c = 3

After the reboot:
* b = 2
* persist.c = 3

persist.a gets lost.

This change fixes the issue by populating properties set from the memory
and then save it to the file.

Bug: 306062513
Bug: 300111812
Test: do the following.
$ adb root
$ adb shell setprop persist.a 1
$ adb shell setprop next_boot.b 1
$ adb shell setprop next_boot.persist.c 1

$ adb reboot
$ adb shell getprop persist.a
1    // was (none) before this change
$ adb shell getprop b
1
$ adb shell getprop persist.c
1

$ adb reboot
$ adb shell getprop persist.a
1    // was (none) before this change
$ adb shell getprop b
     // (none) because b isn't persisted. WAI.
$ adb shell getprop persist.c
1

Change-Id: I85d3777f9b32523b010e49b8ca53f4319dd2ce05
2023-10-20 21:20:50 +09:00
Yi-Yo Chiang
f2e7170cba fs_mgr_overlayfs: Don't try to mount scratch if already mounted
This eliminates spammy logs.

Bug: 306124139
Test: adb remount -v && check the output logs
Change-Id: I3143f5865b5292ba581009179c7e7141afa8fda5
2023-10-20 10:19:52 +00:00
Jason Chiu
d07ec30423 bootstat: add more bootreasons
add more bootreasons for new design.

Bug: 296637681
Test: trigger apc watchdog then "adb root; adb shell bootstat -p"
Change-Id: Ia78146ba9299eea45e7d89376179e01cbd37cca8
Signed-off-by: Jason Chiu <jasoncschiu@google.com>
2023-10-20 05:56:34 +00:00
Thiébaud Weksteen
44af132bd3 Merge "Remove write to /sys/fs/selinux/checkreqprot" into main am: 3ef4da2f6a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2795756

Change-Id: If2f3e9bb1702a8786dbd9710a2e274bff00c2870
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20 01:37:54 +00:00
Thiébaud Weksteen
3ef4da2f6a Merge "Remove write to /sys/fs/selinux/checkreqprot" into main 2023-10-20 00:54:53 +00:00
Nate Myren
c25abe4739 Initialize the appcompat system property folder
Certain applications may have their system properties overlaid with the
contents overlaid for appcompat purposes. Init must initialize the
appcompat folder, same as it does the standard folder.

Bug: 291814949
Test: manual
Change-Id: I6d239e0a10a1c81a05d4121e5fc2c41da5b3dbc4
Merged-In: I0c6a0f66dc543c6e861bc86a417e4feb5ecd7789
2023-10-19 20:17:55 +00:00
Christopher Ferris
fcd4f3b553 Merge "Add ability to handle multiple intercepts per pid." into main am: 2ae67e7119
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2795812

Change-Id: Ic9bdba95edf143eccaca5442742d6012b207ff21
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19 18:02:15 +00:00