Apexd runs in microdroid

Previously, we ran only 'apexd-bootstrap' because 'apexd' crashes due to
the lack of /data/apex in microdroid.

Now apexd runs in "vm" mode. In vm mode, apexd only activates built-in
apexes and block apexes. No data apexes, no session handling.

Bug: 179342589
Test: MicrodroidTestCase
Change-Id: I8c6a16c3b08010fcb008d822d0ba0e311c0a9985
This commit is contained in:
Jooyung Han 2021-04-20 03:33:36 +09:00
parent 9195c7dd01
commit c36b18a443
1 changed files with 21 additions and 9 deletions

View File

@ -12,11 +12,22 @@ import /init.environ.rc
# Cgroups are mounted right before early-init using list from /etc/cgroups.json # Cgroups are mounted right before early-init using list from /etc/cgroups.json
on early-init on early-init
start ueventd
# Generate ld.config.txt # TODO(b/185991357) eliminate bootstrap mount namespace
exec -- /system/bin/bootstrap/linkerconfig --target /linkerconfig # Set up linker config subdirectories based on mount namespaces
chmod 644 /linkerconfig/ld.config.txt mkdir /linkerconfig/bootstrap 0755
mkdir /linkerconfig/default 0755
# Generate ld.config.txt for early executed processes
exec -- /system/bin/bootstrap/linkerconfig --target /linkerconfig/bootstrap
chmod 644 /linkerconfig/bootstrap/ld.config.txt
copy /linkerconfig/bootstrap/ld.config.txt /linkerconfig/default/ld.config.txt
chmod 644 /linkerconfig/default/ld.config.txt
# Mount bootstrap linker configuration as current
mount none /linkerconfig/bootstrap /linkerconfig bind rec
start ueventd
# Run apexd-bootstrap so that APEXes that provide critical libraries # Run apexd-bootstrap so that APEXes that provide critical libraries
# become available. Note that this is executed as exec_start to ensure that # become available. Note that this is executed as exec_start to ensure that
@ -87,11 +98,12 @@ on post-fs
# The bind+remount combination allows this to work in containers. # The bind+remount combination allows this to work in containers.
mount rootfs rootfs / remount bind ro nodev mount rootfs rootfs / remount bind ro nodev
# Currently, exec_start apexd-bootstrap is enough to run adb. enter_default_mount_ns
# TODO(b/179342589): uncomment after turning off APEX session on microdroid
# start apexd # Start apexd in the VM mode to avoid unnecessary overhead of session management.
# Wait for apexd to finish activating APEXes before starting more processes. exec - root system -- /system/bin/apexd --vm
# wait_for_prop apexd.status activated
perform_apex_config
start adbd start adbd