microdroid: do not use bootstrap mount namespace
In microdroid, init enters "default" mount namespace from the beginning
and every process starts in it.
Bug: 185991357
Test: MicrodroidHostTestCases
Change-Id: I36262de8a6ff3bcf452e27c21716cfffe84d6d72
diff --git a/microdroid/init.rc b/microdroid/init.rc
index 8458291..50f7389 100644
--- a/microdroid/init.rc
+++ b/microdroid/init.rc
@@ -12,30 +12,19 @@
# Cgroups are mounted right before early-init using list from /etc/cgroups.json
on early-init
-
- # TODO(b/185991357) eliminate bootstrap mount namespace
- # Set up linker config subdirectories based on mount namespaces
- 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
+ # in microdroid, we don't use "bootstrap" mount namespace
+ # because APEXes are passed from host and are available
+ # from the start. We don't need to wait till /data is ready.
+ enter_default_mount_ns
start ueventd
- # Run apexd-bootstrap so that APEXes that provide critical libraries
- # become available. Note that this is executed as exec_start to ensure that
- # the libraries are available to the processes started after this statement.
- exec_start apexd-bootstrap
+ # Exec apexd in the VM mode to avoid unnecessary overhead of normal mode.
+ # (e.g. session management)
+ exec - root system -- /system/bin/apexd --vm
- # Generate linker config based on apex mounted in bootstrap namespace
- update_linker_config
+ perform_apex_config
+ exec_start derive_sdk
mkdir /mnt/apk 0755 system system
start zipfuse
@@ -59,6 +48,12 @@
start servicemanager
+ start adbd
+
+ # TODO(b/186396070) microdroid_manager starts zipfuse if necessary
+ # TODO(b/186396070) move this before apexd for DICE derivation
+ start microdroid_manager
+
on load_persist_props_action
start logd
start logd-reinit
@@ -103,20 +98,6 @@
# The bind+remount combination allows this to work in containers.
mount rootfs rootfs / remount bind ro nodev
- enter_default_mount_ns
-
- # Start apexd in the VM mode to avoid unnecessary overhead of session management.
- exec - root system -- /system/bin/apexd --vm
-
- perform_apex_config
-
- # TODO(b/185991357) start this earlier
- start microdroid_manager
-
- exec_start derive_sdk
-
- start adbd
-
on late-fs
mount_all /vendor/etc/fstab.microdroid --late