Commit graph

80084 commits

Author SHA1 Message Date
Edward Liaw
51c52426f7 TEST_MAPPING: add vts core lib tests
Bug: 258819618
Test: atest :kernel-presubmit
Change-Id: I5e60c69e4f442d33a67b138314918725c6321137
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-01-09 22:05:37 +00:00
Jiyong Park
3e951a7758 Merge "Skip StartConsole test on user builds." 2022-12-20 07:08:23 +00:00
Jiyong Park
5b7a51a59a Skip StartConsole test on user builds.
It runs a service with root privilege which can't be done on user
builds. Until the issue is resolved, skip the test on user builds.

Bug: 262090304
Test: N/A
Change-Id: I690ffbd7fdaef688a0c862e0c653e9b21e281ece
2022-12-20 10:46:31 +09:00
Treehugger Robot
fd98382506 Merge "Run the console test with /dev/null" 2022-12-16 01:54:14 +00:00
Carlos Galo
ce318e8818 Merge "Updating owners of libprocessgroup" 2022-12-16 00:02:01 +00:00
Treehugger Robot
583b616ba8 Merge "Update docs around capabilities and root processes" 2022-12-15 19:31:37 +00:00
David Anderson
1c34ae8864 Merge "Update vts_fs_test to reflect VSR." 2022-12-15 19:17:03 +00:00
Carlos Galo
8ceaf0c636 Updating owners of libprocessgroup
Adding tjmercier@google.com and carlosgalo@google.com, and removing
ccross@google.com, in the OWNERS file. Adding buganizer component to
OWNERS.

Bug: 262738363
Test: N/A
Change-Id: I7f8cdc513232b46eb341f3c98f64dfb1d9bd9d7a
2022-12-15 19:12:33 +00:00
Nikita Ioffe
cc0e90a964 Update docs around capabilities and root processes
Current documentation is misleading: if a service runs as root and
doesn't specify any capabilities, then it will start with all the
capabilities (note that whether it can use them is controlled by
selinux).

Test: n/a
Bug: 249796710
Change-Id: I0d6a884127c6a6c5b651c1222fcf48322065daae
2022-12-15 18:04:21 +00:00
David Anderson
3460b75289 Merge "libdm: Add a helper function for creating placeholder devices." 2022-12-15 17:26:59 +00:00
Jiyong Park
ae412804ca Run the console test with /dev/null
The availability of /dev/console varies across different devices and
even across different build variants (ex: userdebug/user). Instead of
relying on the device-specific condition, use the /dev/null as the
console device for the test.

Bug: 262090304
Test: atest CtsInitTestCases on raven-user
Change-Id: I3b12d66e94609328dfdd6f640d1adb88a773fa38
2022-12-15 16:32:38 +09:00
David Anderson
37b52b6576 Update vts_fs_test to reflect VSR.
Bug: 253052346
Test: vts_fs_test
Change-Id: I8dbdf731acea9ff5d5006ee3767eda5417d476fd
2022-12-14 22:08:40 -08:00
David Anderson
6433d16543 libdm: Add a helper function for creating placeholder devices.
Bug: 259328366
Test: device boots and mounts userdata
Change-Id: I7aced2eeca984e8ec69633c25d44cd411d0a0583
2022-12-14 21:56:45 -08:00
Hasini Gunasinghe
6dfeccf9c8 Merge "Process large messages from TA" 2022-12-14 16:33:24 +00:00
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
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