Mainline modules are not supposed to rely on 'on' action triggers in
their init scripts because events/properties are not guranteed to be
stable across many devices.
To reduce the potential risk of enabling 'on' for APEXes, for now, we
enable it for only Vendor APEXes.
When an init script in a non-Vendor APEX contains 'on' section, init
emits an error on parsing the script and skip the section.
For example, when init.rc in the ADBD APEX has 'on' section,
the following error is emitted on parsing the script.
init: Parsing file /apex/com.android.adbd/etc/init.rc...
init: /apex/com.android.adbd/etc/init.rc: 8: ParseSection() failed:
'on' is supported for only Vendor APEXes.
Bug: 232543017
Test: see above
Change-Id: I6509c8d2c6b632369d215128f740f9ed78858605
merge_op_start_ is used to set the iterator for merge operations.
Uninitialized value can potentially lead to setting up
of bad iterator.
Bug: 233246309
Test: Full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb
Merged-In: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb
merge_op_start_ is used to set the iterator for merge operations.
Uninitialized value can potentially lead to setting up
of bad iterator.
Bug: 233246309
Test: Full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb
Bug: 230716629
Test: CtsVerifier with aosp/2077898 included
Change-Id: I2ba275718ef7ce6cc701ac2eb4a122639d7a4351
Merged-In: I2ba275718ef7ce6cc701ac2eb4a122639d7a4351
Ignore-AOSP-First: cherry-pick of aosp/2101110
The code previously assumed that write() took a non-zero number of clock
ticks. This is mostly true, but can't be guaranteed. Add a check to
avoid crashing if it's 0.
Bug: 233008287
Test: Compile
Change-Id: Idec0052f534dc4abb81a414ca76f6c11f4a4dded
We have a case where a service is requested to be started and does
not appear to be running, but we see no indication that it is
actually starting. This log should be enough information to see
if init is in a bad state.
Bug: 232297944
Test: doesn't add too much spam
~/android/aosp/system/core/init :) adb logcat -d | grep "requested start" | wc -l
42
Change-Id: Ic07f250c98b200b9e5b4432200c3668c6ca0ff35
Merged-In: Ic07f250c98b200b9e5b4432200c3668c6ca0ff35
We have a case where a service is requested to be started and does
not appear to be running, but we see no indication that it is
actually starting. This log should be enough information to see
if init is in a bad state.
Bug: 232297944
Test: doesn't add too much spam
~/android/aosp/system/core/init :) adb logcat -d | grep "requested start" | wc -l
42
Change-Id: Ic07f250c98b200b9e5b4432200c3668c6ca0ff35
The SELinux type of /data/media has changed from media_rw_data_file to
media_userdir_file, but the recursive restorecon of /data happens too
late when taking an upgrade. Add a restorecon of /data/media to just
above the chattr command which needs the new label to be allowed. This
doesn't "really" matter, since the chattr command is only needed just
after the directory was created anyway, but this fixes a SELinux denial.
Bug: 156305599
Bug: 232824121
Change-Id: I897be19ceb4686511469bdf7efda2483f298eee4
The VMCompilationPerformance profile is used to run Isolated Compilation
in a Protected VM, normally during the device idle, where relevant
APEXes are staged.
The original VMCompilationPerformance introduced in aosp/2060891 does
not have any specific definition and requires vendors to customize it.
This change re-defines it as an aggregated profile with a default set of
existing profiles, so that performance can be reasonable by default.
This profile may be renamed to a more generic name later, e.g.
"SCHED_SP_COMPUTE".
Bug: 231437770
Test: Run `composd_cmd test-compile` on a local device.
Before: 1m50s +/- 10s (with whatever that's default)
After: 1m25s +/- 5s
Ignore-AOSP-First: cherry pick from aosp/2097065
Change-Id: Ib8cd65782c818474fb129efbd9ef9a3e23ad1eb3
Merged-In: Ib8cd65782c818474fb129efbd9ef9a3e23ad1eb3
The VMCompilationPerformance profile is used to run Isolated Compilation
in a Protected VM, normally during the device idle, where relevant
APEXes are staged.
The original VMCompilationPerformance introduced in aosp/2060891 does
not have any specific definition and requires vendors to customize it.
This change re-defines it as an aggregated profile with a default set of
existing profiles, so that performance can be reasonable by default.
This profile may be renamed to a more generic name later, e.g.
"SCHED_SP_COMPUTE".
Bug: 231437770
Test: Run `composd_cmd test-compile` on a local device.
Before: 1m50s +/- 10s (with whatever that's default)
After: 1m25s +/- 5s
Change-Id: Ib8cd65782c818474fb129efbd9ef9a3e23ad1eb3
All the individual directories being treated specially by
FscryptInferAction() already have an explicit encryption action in the
corresponding mkdir commands. The explicit action is the source of
truth, so the special cases in FscryptInferAction() are unnecessary.
Also, some of these cases were outdated. For example, /data/app-staging
was changed from encryption=None to encryption=DeleteIfNecessary at some
point, but FscryptInferAction() was not updated. This is causing the
warning "Inferred action different from explicit one" to be logged.
Additional "Inferred action different from explicit one" warnings are
logged due to subdirectories of /data/apex being explicitly encrypted.
Change FscryptInferAction() to only do what it needs to do: check
whether the directory is a top-level directory of /data or not. Remove
the above-mentioned warning which is not useful.
Bug: 232554803
Change-Id: If6611d64107a19d242892c92dfea095577e193e5