There are a few directories for builtin APEXes: /system/apex,
/system_ext/apex, /product/apex, /vendor/apex.
For devices with ro.apex.updatable=false, init should bind-mount
"flattened" apexes from all of above.
Bug: 144732372
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m && device boot
Change-Id: If151145e6e3d966b202300ff3a0ddb5ec9fdaa87
Now the logic is handled by following API:
GetMountedEntryForUserdata(Fstab* fstab).
Behind the scenes it does the following:
1. Reads /proc/mounts and gets block device /data is actually mounted on.
2. In case of it's a dm-device, recursively goes into it's slaves until
finds the underlying block device.
3. Optimistically assumes that corresponding block device is a symlink
and tries to read it.
4. Reads all the entries corresponding to /data from fstab.
5. For each of them, optimistically tries to readlink block_device.
6. If it matches the resolved block devices, we found our fstab entry!
Also added a test to CtsFsMgrTestCases asserting that /data was mounted
from one of entries in default fstab.
Test: on blueline & taimen, with & without checkpointing:
Test: atest CtsFsMgrTestCases
Test: adb reboot userspace
Bug: 135984674
Change-Id: Ic70daeeb18096c7b134004334cc674dacc6e36f3
This will be taken care of by vold (when necessary).
Bug: 135341433
Test: device boots, passthrough mount still works
atest AdoptableHostTest
Change-Id: I5a144eff0e4220fa0154bfa7d62a2dec625c88bc
A recently added subcontext test was failing beause it was running as
non-root, but GTEST_SKIP() didn't work as I expected it to.
In retrospect, all of these tests except for the property one, can
easily run as root, so this changes allows all of these tests to run
as root, while fixing the original issue.
Bug: 144707143
Test: root and nonroot subcontext unit tests
Change-Id: Ia835597701698f6be2101f92d6f4c9450bd3c7dd
No longer require that NO_LIBDEXFILE_SUPPORT be defined or not
defined when including the header files. Move all of the different
behavior to the implementation, and keep all of the classes the
exact same whether dexfiles are supported or not.
Bug: 144470551
Test: Ran libunwindstack unit tests, libbacktrace unit tests, and
Test: debuggerd unit tests.
Test: Ran host art 137-cfi tests.
Change-Id: I4a04cfbc5d4f1bf765ef154881046c85057006c8
UpdatePartitionTable expects to be run on a device, which is a
reasonable assumption. However to implement lpadd (offline modification
of super images), it's useful to be able to run these methods, and
IPartitionOpener allows us to masquerade a flie as a block device.
The only catch is that we can't query partition information on the host.
Since this logic is a protection mechanism, just surround it with
an ifdef for __ANDROID__.
Bug: 144468779
Test: lpadd
Change-Id: I3c50e5677fa1dd59f2d4216038d3d4fbfb6edcc0
This exports an internal variant of WriteToImageFile, since lpadd needs
to call it on an open descriptor. While we're here, switch "int" to
"borrowed_fd".
Bug: 144468779
Test: m lpadd
Change-Id: I2dd35b8a872f8a72a704230d0382398b8982cb0b
~2007 a change was added that would allow oneshot services to
daemonize by not killing their process group. This was a hack at the
time, and should certainly not be needed now. I've resisted removing
the behavior however, as it hadn't caused any issues.
Recently, it was detected that the cgroups that these processes belong
to, would exist forever and therefore leak memory. Instead of simply
removing the cgroups when empty, this provides a good opportunity to
do the right thing and fix this behavior once and for all.
The new (correct) behavior only happens for devices with vendor images
built for Android R or later. Init will log a warning to dmesg when
it detects this difference in behavior has occurred.
Bug: 144545923
Test: boot CF/Coral and see no difference in behavior.
Test: boot CF with a service that daemonizes and see the warning.
Change-Id: I333a2e25a541ec0114ac50ab8ae7f1ea3f055447
Also change the properties implementation to call the new API. We use
this ParseBool API in the new SystemProperties implementation, with
which we want the libbase property API to be consistent.
Test: included
Change-Id: I89cb3eb4e1203a6bb0da41914dad720e44c00303
This is unneeded, since we're already checking the length returned by
recv() and log_msg that is read for validity.
It costs ~4% of CPU with `logcat -s` and ~2% of CPU when running
simpleperf for 1 second on walleye on master.
Bug: 144311420
Test: logcat works, simpleperf doesn't show memset() costing as much.
Change-Id: I986e7e96518774034340f1b1201a2071a904e3bb
GWP-ASan's crash information retrieval services requires a Printf()
function (declared by the system/implementing allocator). In this
instance, because _LOG is called with additional arguments (the log_t),
this function must be wrapped to conform to printf_t defined by
GWP-ASan.
We can easily wrap the variadic version.
Bug: 135634846
Test: atest debuggerd_test
Change-Id: I17209cd2b7455ce889e2f8194969f606cac329eb
This is simplified down to the point there are only two branches that
need to be made, so remove the rest of the transport structs and
simply branch where needed.
Test: liblog-unit-tests
Change-Id: Ic82e7e70eb7b4e40b381a4d8066629c5b7d4f827
Shifting a signed 32-bit value by 31 bits is implementation-
defined behavior. So we change to an unsigned value for our
shift by 31 bits, and go ahead and change the others to
unsigned for consistency.
Test: TreeHugger
Change-Id: Ib98f9b1e468d28dafd09e86273bf76beb1ea1fa5
A thread's PSTATE can sometimes be critical for understanding a crash,
especially with MTE and other new features that store per-thread state
in PSTATE.
Bug: 135772972
Change-Id: I1bee25bffe7eea395f04b6449dc9227298cf866e
For libbinder, not having these statuses printed out causes never ending
problems for developers.
Bug: 144534032
Test: libhidl_test tests this, which is on TH here
Change-Id: I02f37fb1e5b743131598ddc95ef89ebdfbdff615