Commit graph

80315 commits

Author SHA1 Message Date
Jiyong Park
717ece7397 Merge "Clarify the behavior about event and property triggers" 2022-12-14 15:16:31 +00:00
Yi-yo Chiang
3ae0234484 Merge "overlayfs: Mount overlay with context= fs_options if original mount has it" 2022-12-14 07:18:06 +00:00
Treehugger Robot
b7d4804453 Merge "Skip system/bin/bootstrap/linkerconfig" 2022-12-14 07:16:12 +00:00
Steven Moreland
bb1ee3c689 Merge "ignore error -> log" 2022-12-14 01:29:20 +00:00
Steven Moreland
507209ba55 ignore error -> log
Current code ignores an error, which is a code
rot risk.

Bug: 261700511
Change-Id: I04ca7046dc42d761ecaaf56f6100c96cc8298ec5
Test: N/A
2022-12-13 22:43:58 +00:00
Treehugger Robot
f6fe4fc9fa Merge "Remove an unnecessary #include." 2022-12-13 18:38:38 +00:00
Eran Messeri
33937f432c Merge "Bump the KeyMint version to v3" 2022-12-13 17:58:17 +00:00
Elliott Hughes
a27f23e61e Remove an unnecessary #include.
This confused me while doing a code search.

Test: treehugger
Change-Id: Ic8d63a3f5b8efb8557d0033d458f5265762da716
2022-12-13 17:08:24 +00:00
Yi-Yo Chiang
b0e6c82a86 overlayfs: Mount overlay with context= fs_options if original mount has it
Say we have mount configurations as follows:
  mount <dev> /mnt_point -t ext4 -o ro,context=<se_file_context>
  mount overlay /mnt_point2 -t overlay -o lowerdir=/mnt_point,upperdir=...

Overlayfs driver doesn't forward the overridden file context from
/mnt_point to /mnt_point2, thus the same file (same inode) would have
different file context when accessed via /mnt_point and /mnt_point2.

This change makes adb remount to mount filesystem overlays with context=
option if the overlaid mountpoint has it too. This makes the files under
context= mountpoint to retain the same file context after remount.

Also run clang-format on the whole file to fix some formatting issues.

Bug: 243501054
Test: adb remount && check file context with "ls -Z"
Change-Id: Ie4815604c56f1ce81b755cd0569b6577bd5f575f
2022-12-13 12:00:38 +00:00
Yi-yo Chiang
e0877535ab Merge "overlayfs: fs_mgr_overlayfs_setup() should accept Fstab as input" 2022-12-13 11:56:17 +00:00
Jooyung Han
56bee1f7d0 Skip system/bin/bootstrap/linkerconfig
Early processes can't rely on APEXes anyway. We don't need to run
linkerconfig.

This helps to reduce the storage usage (no
/system/bin/bootstrap/linkerconfig) and the boottime (not running
linkerconfig).

If we need more complicated linker config even for early processes, then
we could generate it at build-time and use it like recovery version.

Bug: 262330207
Bug: 260982509
Test: MicrodroidAppTest
Test: device boots
Change-Id: Iceca5ffdb1655fd94e90b0091f439bd22130185e
2022-12-13 18:04:52 +09:00
Yi-yo Chiang
acac60d5a4 Merge "libfstab: Add const overload of GetEntryForMountPoint()" 2022-12-13 06:24:46 +00:00
David Anderson
95cfb31bd2 Merge "Support sysfs changes in the Linux 5.15 kernel." 2022-12-12 18:38:04 +00:00
Yi-Yo Chiang
e508ac4f2e overlayfs: fs_mgr_overlayfs_setup() should accept Fstab as input
Right now fs_mgr_overlayfs_setup() always reads the default fstab and
this makes the "-T" option of remount useless.
Change it so that the fstab is passed in by the caller.

Bug: 243501054
Test: adb remount -vT <path/to/fstab>
Test: and check that overlay is active after reboot
Change-Id: Ia4101938a50c305f105c57018b02aec01f862dec
2022-12-13 01:53:37 +08:00
Yi-Yo Chiang
d45750aa2c libfstab: Add const overload of GetEntryForMountPoint()
Const version of GetEntryForMountPoint() accepts a pointer to const
Fstab and returns a pointer to const FstabEntry.

In order to refrain from adding more boilderplate, simplify the
implementation of GetEntryForMountPoint() to "return first entry of
GetEntriesForMountPoint()". The added overhead should be negligible as
fstab is usually small (around dozens of entries max), so iterating the
whole list is not computationally expensive.

Also templatize the implementation of GetEntriesByPred() to reduce the
amount of boilerplate.

Bug: 243501054
Test: Presubmit
Change-Id: I046d61d68385825656bb7bc7177c0d1d3e8b36e1
2022-12-13 01:53:37 +08:00
Jiakai Zhang
70d34f01a3 Merge changes I52e778d1,I33f4d1d2
* changes:
  Rename "Dex2OatBootBackground" to "Dex2OatBackground".
  Add task profile "Dex2OatBackground".
2022-12-12 17:37:42 +00:00
Akilesh Kailash
a96e27ca44 Merge changes from topic "libsnapshot-batch-writes"
* changes:
  libsnapshot: Test batch writes and threaded compression
  libsnapshot: Batch write COW operations in a cluster
  libsnapshot: Use two threads to run compression
2022-12-12 16:39:00 +00:00
Jiakai Zhang
180a51d6f3 Rename "Dex2OatBootBackground" to "Dex2OatBackground".
Bug: 261557677
Change-Id: I52e778d13cffcae4212acb05ef2bd62b827fbaf3
Test: Presubmit
Merged-In: I52e778d13cffcae4212acb05ef2bd62b827fbaf3
(cherry picked from commit 473f03bfd9)
2022-12-12 16:28:11 +00:00
Jiakai Zhang
38e9373a4b Add task profile "Dex2OatBackground".
Bug: 261557677
Test: Presubmit
Change-Id: I33f4d1d2270da82cf90a772ef52b450bcecafec2
Merged-In: I33f4d1d2270da82cf90a772ef52b450bcecafec2
(cherry picked from commit ecfbf9c6f4)
2022-12-12 16:27:15 +00:00
Treehugger Robot
5c3e24816d Merge "Kill services even when cgroups is disabled" 2022-12-12 01:20:45 +00:00
Inseob Kim
a049a9928b Kill services even when cgroups is disabled
process_cgroup_empty_ is used to indicate that a service is already
killed or not. If cgroup support lacks, services cannot be killed
because process_cgroup_empty_ is always true.

This change fixes it by not assigning process_cgroup_empty_ as true.
Instead, make KillProcessGroup send signals even when cgroup is
disabled. Also DoKillProcessGroupOnce() is updated so it returns a number of killed processes, excluding already dead processes. This behavior agrees with its name (DoKillProcessOnce), and it prevents regression upon missing cgroups, because kill(-pgid) will always
"succeed" so KillProcessGroup will loop even when all processes are
already dead.

Bug: 257264124
Test: boot microdroid, see services are terminated
Change-Id: I19abf19ff1b70c666cd6f12d0a12956765174aaa
2022-12-12 01:19:26 +00:00
Akilesh Kailash
c4a5576fdf libsnapshot: Test batch writes and threaded compression
Test all compression algorithms.

Bug: 254188450
Test: cow_api_test
Change-Id: I977e631402eb2dfaa76205f5d8cb955e6d3bddbb
Signed-off-by: Akilesh Kailash <akailash@google.com>
2022-12-11 16:15:50 +00:00
Akilesh Kailash
4bc81b409b libsnapshot: Batch write COW operations in a cluster
COW operations are written in cluster. All the COW ops
and the COW data in this cluster are contiguous. Hence,
batch these writes and write them in one syscall.

Writes are done when the cluster is full or when
label ops are written.

OTA install time (without post-install) on Pixel 6 Pro:

          Without-this-patch        With-this-patch

Full OTA: 17 Minutes               13 Minutes

Following are the OTA install times with both the optimization.
viz - batch writes + 2 threads for compression.

OTA install (without post-install) on Pixel 6 Pro.

All numbers are in minutes.

Full ota - 2.2G

Compression   Without-this-patch     With-this-patch
=========================================================
gz            23                      13
lz4           13                       7
none          13                       7

Incremental OTA - 376M

Compression   Without-this-patch     With-this-patch
=========================================================

gz            22                     16
lz4           14                     11
none          15                     11

Bug: 254188450
Test: Full / Incremental OTA on Pixel
Change-Id: Ie3aba1ff28a6569d25a766377efab6cbe78d9277
Signed-off-by: Akilesh Kailash <akailash@google.com>
2022-12-11 16:15:42 +00:00
Akilesh Kailash
b1a05003a8 libsnapshot: Use two threads to run compression
Compression is a hot function in the install path. Use
two threads for compression.

By default, number of thread is set to 1. If the property,
"ro.virtual_ab.compression.threads" is true, the number
of threads is increased to 2.

OTA install time (without post-install) on Pixel 6 Pro with 2 threads:

	  Without-this-patch       With-this-patch

Full OTA: 23 Minutes               17 Minutes

Bug: 254188450
Test: Full/Incremental OTA on Pixel
Change-Id: I4a11dca3a5ebfe11dcc7f0d882332d491f2d7933
Signed-off-by: Akilesh Kailash <akailash@google.com>
2022-12-11 16:15:32 +00:00
Sandeep Dhavale
63928c310e Fastboot: Use AServiceManager_waitForService instead of AServiceManager_getService
AServiceManager_getService waits unncessarily waits for 5 seconds if
service is not available. Use isDeclared() and waitForService() instead.

Bug: 261759425
Test: build and flash
Change-Id: I20a5f422ca0c26c6e9e183e6636b30a2f19e76d3
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2022-12-10 05:29:26 +00:00
Hasini Gunasinghe
3606cec3c0 Process large messages from TA
This CL adds the capability to the HAL to process reponses from the TA
that are larger than the capacity of the channel from HAL to TA.

Bug: 253501976
Test: with Trusty KM which has a smaller limit than some responses
Change-Id: I2fe056143f18718eb10bdd2d0559f3d171b14c96
2022-12-10 00:41:31 +00:00
Arve Hjønnevåg
67bd5b0188 Merge "storageproxyd: Added support for getting max size of file" 2022-12-09 20:18:01 +00:00
Jay Monkman
2ad61bf01b storageproxyd: Added support for getting max size of file
This handles the STORAGE_FILE_GET_MAX_SIZE. The new behavior will
return a max size of 0x10000000000 (former default value in Trusty)
for a regular file and the partition size for a block device.

Test: N/A
Bug: 247003431
Change-Id: Ib8b8504b63496d64487cf2f96a1c0758bfafdd97
Signed-off-by: Jay Monkman <jtmjtmjtmjtmjtmjtmjtm@gmail.com>
2022-12-08 20:53:08 -06:00
Hsin-Yi Chen
92c70186f8 Merge "Add an ABI dump directory for libutils" am: 20d45cc9ce
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2330313

Change-Id: I6a6f7a07d75cfda427f74cc038a9d9d4157727a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 02:09:54 +00:00
Hsin-Yi Chen
20d45cc9ce Merge "Add an ABI dump directory for libutils" 2022-12-09 01:57:43 +00:00
David Anderson
d6bf86b8cf Support sysfs changes in the Linux 5.15 kernel.
DM_DEV_CREATE no longer creates sysfs nodes. Note this in ueventd and
add some helper APIs to libdm, so devices can be created with a
placeholder table.

This also fixes a bug in dmctl where the detailed info on suspended
devices was wrong.

Bug: 259328366
Test: dmctl with "uevents" tool
Change-Id: I822f8010e48d32841aa0ee508822f76d03a3dd85
2022-12-08 16:22:47 -08:00
Treehugger Robot
8e50ae513b Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: 1a72f42e52
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2333753

Change-Id: Id07fd5f54cb3b9f130d4deff4c6677ae345e4114
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 19:32:41 +00:00
Treehugger Robot
1a72f42e52 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" 2022-12-08 19:05:32 +00:00
Sanjana Sunil
9c759ea9a5 Merge "Create misc_ce and misc_de mirror storage" am: aeee1c6231
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2300222

Change-Id: If7ed93bb7a4b673704b057bb164d393e75a07965
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 18:21:14 +00:00
Sanjana Sunil
aeee1c6231 Merge "Create misc_ce and misc_de mirror storage" 2022-12-08 18:09:11 +00:00
Daniel Zheng
833ca65916 Merge "Updating fastboot to modern c++ standards" am: 14000f19a9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2320806

Change-Id: I6672628707746fe2e301ea26217be430509b4d5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 17:27:42 +00:00
Sally Qi
945f66ed95 Merge "Add COLOR_MODE_DISPLAY_BT2020 to graphics header." am: 364c71c320
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2321464

Change-Id: Iabc625c6f96bba6da9697dc0618301da51ba104a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 17:27:27 +00:00
Daniel Zheng
14000f19a9 Merge "Updating fastboot to modern c++ standards" 2022-12-08 17:23:08 +00:00
Sally Qi
364c71c320 Merge "Add COLOR_MODE_DISPLAY_BT2020 to graphics header." 2022-12-08 17:00:12 +00:00
Bob Badour
bbe272be62 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  trusty/keymint/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I70d332c63bd3a02e1d00a87579d1c16054167845
2022-12-08 05:36:04 -08:00
Hsin-Yi Chen
3de02bd0d5 Add an ABI dump directory for libutils
The ABI dumps add visibility for API changes in a commonly used library.

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      -libs libutils -products aosp_arm64 \
      -ref-dump-dir system/core/libutils/abi-dumps
Test: m libutils.vendor
Bug: 227282691
Change-Id: I498c62853562a8fc6702bdd622603b6f7d516274
2022-12-08 11:06:22 +08:00
Eric Miao
eaccc4ff79 Merge "libutils: Add more tests for Unicode" am: 8d60cfe2cb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2322174

Change-Id: I108bebdd405c06d2b5377da368291cd628ba61dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 23:30:33 +00:00
Eric Miao
8d60cfe2cb Merge "libutils: Add more tests for Unicode" 2022-12-07 23:06:17 +00:00
Eran Messeri
b8c8f2df6e Bump the KeyMint version to v3
To match what the implementation returns.

Bug: 244732345
Test: atest android.keystore.cts.DeviceOwnerKeyManagementTest
Change-Id: I48b4c6694d938d3d61a1524319e1d8b1da19e0b5
2022-12-07 13:05:57 +00:00
David Drysdale
0f334824ba Merge "KeyMint HAL in Rust for Trusty" am: e0af2b83f3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2328293

Change-Id: I7609f3c9fe3a3dfdace54eedc30695b9c00c48c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 10:36:34 +00:00
David Drysdale
e0af2b83f3 Merge "KeyMint HAL in Rust for Trusty" 2022-12-07 10:20:08 +00:00
David Anderson
cbd082d46d Disable multilib for CtsInitTestCases.
Bug: 260393485
Test: run cts -m CtsInitTestCases
Change-Id: I92a11b7961411b22525d4434312479878b353b55
2022-12-06 20:13:53 -08:00
Chih-hung Hsieh
128a4dbcdb Merge "Fix potential memory leaks" am: 48cd41324b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2322216

Change-Id: Ifb07cd42290257dd60add0cc2b31dd2a465ddc20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 03:52:03 +00:00
Chih-hung Hsieh
48cd41324b Merge "Fix potential memory leaks" 2022-12-07 02:36:27 +00:00
Bart Van Assche
1c5372d64b Merge "init: Enable ANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION" am: d3484c84bf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2323103

Change-Id: Id682928a501401cf8c841ad3b34341549bea57ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 23:28:47 +00:00