Commit graph

78276 commits

Author SHA1 Message Date
Yifan Hong
641037cc04 Merge "healthd: Fix charger_res_images_vendor install location" 2022-08-30 18:22:18 +00:00
Treehugger Robot
85d69af38e Merge "Validate persistent properties file" 2022-08-30 08:42:09 +00:00
Ryan Prichard
1ff7e26b2c Merge "Remove unnecessary std::unary_function base classes" 2022-08-29 20:38:17 +00:00
Bart Van Assche
12eec6756a Merge "libprocessgroup: Add I/O scheduler attributes to task_profiles.json" 2022-08-29 00:56:03 +00:00
Ryan Prichard
4913ca88e5 Remove unnecessary std::unary_function base classes
The function objects work equally well without them, and the base
classes were wrong for both types:
 * HashForEntry: returns size_t but declared to return hash_t
   (uint32_t)
 * EqualityForHashedEntries: returns bool and takes two parameters but
   declared to return hash_t and take one parameter

std::unary_function was deprecated in C++11 and removed in C++17.
Upstream libc++ now removes the type for new-enough C++ dialects.

Bug: http://b/175635923
Test: treehugger
Change-Id: I2ff15c5da6a4e4f71df08c243f8af2f11d8d2b0d
2022-08-26 20:24:57 -07:00
Bart Van Assche
aa46531f46 Merge "init: Apply the NormalIoProfile when creating a service" 2022-08-26 20:13:48 +00:00
Tim Zimmermann
c4c2a07210
healthd: Fix charger_res_images_vendor install location
* According to healthd_mode_charger.cpp#L106 this should be
  res/images/default/charger and not res/images/charger/default

Change-Id: Iabb5f5ecdd3b94c90a4b46849dd0a048da51364a
2022-08-26 15:58:07 +02:00
Treehugger Robot
cd6f579926 Merge "libsnapshot: fix -Wdefaulted-function-delete warnings." 2022-08-26 12:12:53 +00:00
Bart Van Assche
9c0fcbb0f7 libprocessgroup: Add I/O scheduler attributes to task_profiles.json
The differences between the v1 and v2 hierarchies are as follows:
* Different mountpoints. In Android the blkio v1 hierarchy has
  /dev/blkio as top directory while the v2 hierarchy has /sys/fs/cgroup
  as top directory.
* Different directory structure. In Android there are two directories in
  the v1 blkio hierarchy (. and background) while in the v2 hierarchy
  there is one subdirectory per process and per task.
* Different controller names. The name of the blkio controller in the v1
  hierarchy is "blkio" while it is "io" in the v2 hierarchy.
* In the v1 hierarchy the NormalIoPriority policy is applied at process
  creation time but that policy is not applied at process creation time
  if the blkio controller exists in the v2 hierarchy.

Prepare for migration of the blkio controller to the v2 hierarchy by
adding the blkio v2 attributes in task_profiles.json. All these
attributes have been marked as optional because:
* The "io" controller does not exist in the v1 hierarchy.
* Which attributes can be applied depends on the I/O scheduler that has
  been selected (CFQ, BFQ, ...).

This patch causes the following warnings to appear in the logs of
devices that mount the blkio controller in the v1 hierarchy:
 W libprocessgroup: Controller io is not found
 W libprocessgroup: Controller io is not found
 W libprocessgroup: Controller io is not found
 W libprocessgroup: SetAttribute: unknown attribute: CfqGroupIdle
 W libprocessgroup: SetAttribute: unknown attribute: CfqWeight
 W libprocessgroup: SetAttribute: unknown attribute: BfqWeight

This patch restores a subset of aosp/1962326 and prepares for the
migration of the blkcg controller to the cgroup v2 hierarchy.

Bug: 213617178
Change-Id: Ia7b117bc777239b416e2ac268308e634b018144d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-25 14:01:01 -07:00
Bart Van Assche
fcf047113f init: Apply the NormalIoProfile when creating a service
Prepare for migration of the blkio controller to the v2 cgroup hierarchy
by applying the NormalIoProfile when starting a service. While the
NormalIoProfile is automatically applied when the blkio controller is
mounted in the v1 hierarchy, this is not the case for the v2 hierarchy.

Bug: 213617178
Change-Id: I3cad288a31aa2692e10c778ae1e5fdd04acd66d7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-25 14:01:01 -07:00
Paul Crowley
f7c74694d7 Validate persistent properties file
Before loading persistent properties, init now checks if there are any
invalid properties (not starting with "persist.").

Bug: 243723877
Test: atest persistent_properties
Change-Id: Ieb4ddce05916f193388af6b658e1904004ffa473
2022-08-25 11:40:18 -07:00
Sandro Montanari
59387c977b Merge "Add SeamendcHostTest to selinux.cpp TEST_MAPPING" 2022-08-25 14:47:28 +00:00
Sandro
956ce287f3 Add SeamendcHostTest to selinux.cpp TEST_MAPPING
SeamendcHostTest should run when making changes to selinux.cpp, to
ensure the test logic is updated to match the logic selinux.cpp follows
when it decides to compile the SELinux policy in the OpenSplitPolicy
method.

Bug: 238394904
Test: atest --test-mapping system/core/init/TEST_MAPPING:presubmit
Change-Id: Iaf0ec2356a894b071e6875dd41bcf9e842126e42
2022-08-25 09:26:24 +00:00
Treehugger Robot
7bc4533ae5 Merge "libprocessgroup: Provide SetProcessProfiles() and SetTaskProfiles() alternatives" 2022-08-24 19:29:04 +00:00
Xin Li
f465d3fcee Merge "Merge android13-tests-dev" 2022-08-23 23:07:05 +00:00
Treehugger Robot
56183d87e4 Merge "libprocessgroup: Make GetProfile() and GetAttribute() more efficient" 2022-08-23 20:44:32 +00:00
Treehugger Robot
b963ff97fb Merge "trusty: Increase size of ACVP shared memory" 2022-08-23 17:19:46 +00:00
Stephen Crane
54020821f6 trusty: Increase size of ACVP shared memory
The boringssl ACVP config has grown, so we need to increase the size of
our memory allocation that we share with the Trusty test TA.

Test: acvptool -wrapper trusty_acvp_modulewrapper -regcap
Bug: None
Change-Id: Ia90f4972d0d2ac420b09110f5647355a44175267
2022-08-22 19:43:54 -07:00
Yi-yo Chiang
05ae1f5f10 Merge "adb-remount-test: Simplify disable-verity setup" 2022-08-22 06:06:49 +00:00
Marco Nelissen
7df90c1a38 Merge changes Ib2a3c881,Ia9b17f4e
* changes:
  trusty/apploader: Handle APPLOADER_ERR_NOT_ENCRYPTED
  trusty/apploader: Add missing doc for enum value
2022-08-21 23:22:38 +00:00
Yi-Yo Chiang
075463764e adb-remount-test: Simplify disable-verity setup
Don't try to parse stdout of disable-verity, just pass -R to ask for
auto reboot.
This eliminates the complex logic of "disable-verity && check &&
reboot && disable-verity again ...", and increase robustness.

`${overlayfs_supported} && ${overlayfs_needed}` can be simplified to
just `${overlayfs_needed}` because `${overlayfs_needed}` implies
`${overlayfs_supported}`.

Move the curious recurring "overlay takeover unexpected" check to the
"Checking current overlayfs status" section so we don't need to repeat
it so many times.

Bug: 243116800
Bug: 241688845
Test: adb-remount-test
Change-Id: I96ec44e2b9d172c06c3b4850e061e7b6bb46833c
2022-08-22 02:46:28 +08:00
Per Larsen
db9a554a2f trusty/apploader: Handle APPLOADER_ERR_NOT_ENCRYPTED
Add a specific error message to the Android CLI tool for the case
where the apploader rejected an attempt to load an application
which requested encryption of its ELF image via its manifest while
containing an unencrypted ELF image.

Bug: 241824652
Change-Id: Ib2a3c881015700492b8166be38c41753bf51b3b2
2022-08-20 23:20:46 -07:00
Per Larsen
c5253819f8 trusty/apploader: Add missing doc for enum value
Document the APPLOADER_ERR_POLICY_VIOLATION value in enum
apploader_error.

Bug: 208968719
Change-Id: Ia9b17f4ea705d13567b2ba74f2dcd6df5a0c7d73
2022-08-20 23:20:46 -07:00
Jiyong Park
f8053c661e Merge "Use liblog_for_runtime_apex instead of liblog" 2022-08-19 16:03:05 +00:00
Bart Van Assche
f32c4ecebb libprocessgroup: Provide SetProcessProfiles() and SetTaskProfiles() alternatives
Provide alternative versions that do not force callers to create
std::string objects. This patch has the intended side-effect that all
callers that pass a {string} initializer list to the 'profiles' argument
now call an std::initializer_list<> overload instead of the const
std::vector<std::string>& overload.

Additionally, add std::function<> arguments instead of calling
ExecuteForProcess() or ExecuteForTask() directly to make it easier to
write unit tests for SetTaskProfiles() and SetProcessProfiles().

Bug: 213617178
Change-Id: Ica61e944a66a17178ee43a113b8ca082f7eb834b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-19 07:06:30 -07:00
Bart Van Assche
d0b8ce2115 libprocessgroup: Make GetProfile() and GetAttribute() more efficient
Do not force callers to create an std::string object. This patch
implements the following advice from go/totw/1: "Google’s preferred
option for accepting such string parameters is through a string_view."
Use std::less<> as comparison type to prevent that std::string_view
objects have to be converted into std::string objects for lookups in
std::map<>.

Bug: 213617178
Change-Id: I08125a02220a8c003d9202a7e177be776c3b9829
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-19 07:06:30 -07:00
Treehugger Robot
77cff05577 Merge "Prepare /data/property before load_persist_props" 2022-08-19 08:50:59 +00:00
Chung-Kai (Michael) Mei
64e6511540 Merge "libmodprobe: check blockedlist if load failed" 2022-08-19 04:57:31 +00:00
Jiyong Park
eb769d687a Use liblog_for_runtime_apex instead of liblog
liblog_for_runtime_apex is a static variant of liblog which is
explicitly marked as available to the runtime APEX. Any static
dependency to liblog from inside the runtime APEX is changed from liblog
to liblog_for_runtime_apex.

Previously, to support the need for using liblog inside the runtime
APEX, the entire (i.e. both static and shared variants) liblog module
was marked as available to the runtime APEX, although in reality only
the static variant of the library was needed there. This was not only
looking dirty, but also has caused a problem like b/241259844.

To fix this, liblog is separated into two parts. (1) liblog and (2)
liblog_for_runtime_apex. (1) no longer is available to the runtime APEX
and is intended to be depended on in most cases: either from the
non-updatable platform, or from other APEXes. (2) is a static library
which is explicitly marked as available to the runtime APEX and also
visible to certain modules that are included in the runtime APEX.

Bug: 241259844
Test: m and check that liblog depends on stub library of libc
Change-Id: I10edd4487a6f090ef026acffe1ffbd067387a0d3
2022-08-19 13:21:02 +09:00
Bart Van Assche
0d78c9a0af Merge "libprocessgroup: Switch from gnu++-17 to gnu++-20" 2022-08-18 21:23:01 +00:00
Bart Van Assche
a823bee9d3 libprocessgroup: Switch from gnu++-17 to gnu++-20
This change enables headers like <span>. Inside the <span> header file
file the following guard makes its functionality unavailable when
building with std=gnu++-17:

 #if _LIBCPP_STD_VER > 17
 [ ... ]
 #endif

Bug: 213617178
Change-Id: I5c40708ea196ab112990b5ca6fae9370b75f8752
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-18 12:34:21 -07:00
Jooyung Han
9561496303 Prepare /data/property before load_persist_props
Without the directory (this happens on the very first boot),
load_persist_props can't create an initial version of
/data/property/persistent_properties (probably empty). This leads to
persisting all in-memory "persist.*" properties later when a persistent
property is set. This is regression from Android S because persistent
props from, for example, build.prop will be persisted even when there's
no process to explicitly setprop.

Bug: 242264580
Test: launch cuttlefish and verify that there's no props from build.prop
Change-Id: I5819a97750e4d5d1ee5a7c308bf944c7aeab2f90
2022-08-18 10:03:02 +09:00
Xin Li
d1d054910b Merge android13-tests-dev
Change-Id: I98a97dcfeb3bfbf711333b132b99108d8321536a
2022-08-17 16:33:25 -07:00
Yi-yo Chiang
b3ff0cf8c8 Merge "set-verity-state: Add -h -v -R (automatic reboot) options" 2022-08-17 06:14:55 +00:00
Yi-Yo Chiang
8667495164 set-verity-state: Add -h -v -R (automatic reboot) options
-h: print help
-v: noisy output
-R: automatic reboot if needed

Also remove the "argc != 0" check, as this shouldn't happen most of the
time anyway. The only possible way (I can think of) for this to happen
is to explicitly call execve() with an empty argv, which is against the
calling convention, thus a footgun, to begin with.

Bug: 241688845
Test: adb shell [disable-verity|enable-verity] [-R] [-v] [-h]
Test: adb shell set-verity-state [-R] [-v] [-h] [0|1]
Change-Id: I27fc18b0958650c5926322a3f4bd1df758fd96c8
2022-08-17 06:13:20 +00:00
Yi-yo Chiang
4284589b1c Merge "remount: Remove unused option -C/--clean_scratch_files" 2022-08-17 06:13:06 +00:00
Yi-Yo Chiang
0465273180 remount: Remove unused option -C/--clean_scratch_files
The option was added for debugging purposes in case the "test argv[0] ==
clean_scratch_files" method breaks.
Now it has no user at all and no reason to maintain it, so just remove it.

Also don't use MyLogger() when running as clean_scratch_files, as
clean_scratch_files don't have stdout/stderr.

Bug: 241179247
Test: Presubmit
Change-Id: I2d8069f59fe6b85fc84ab07bb2df6efb39d6ecaa
2022-08-17 06:12:52 +00:00
David Anderson
4f351c3cf5 Merge "libsnapshot: Remove flaky image creation test." 2022-08-16 22:33:21 +00:00
Akilesh Kailash
1fe0e72321 Merge "libsnapshot: reorder COW ops vector" 2022-08-16 19:17:44 +00:00
Xin Li
4f74d4542d Merge "DO NOT MERGE - Merge Android 13" 2022-08-16 19:08:18 +00:00
Treehugger Robot
5efd05c963 Merge "Add io_uring support to fastboot" 2022-08-16 17:52:01 +00:00
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