Check if service is executed before APEX is ready
Any service which is executed when Runtime apex is mounted, but
linkerconfig is not updated can fail to be executed due to missing
information in ld.config.txt. This change updates init to have a status
variable which contains if current mount namespace is default
and APEX is not ready from ld.config.txt, and use bootstrap namespace if
it is not ready.
Bug: 181348374
Test: cuttlefish boot succeeded
Change-Id: Ia574b1fad2110d4e68586680dacbe6137186546e
diff --git a/init/builtins.cpp b/init/builtins.cpp
index dcc9582..035038f 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -1278,6 +1278,14 @@
return ErrnoError() << "failed to execute linkerconfig";
}
+ auto current_mount_ns = GetCurrentMountNamespace();
+ if (!current_mount_ns.ok()) {
+ return current_mount_ns.error();
+ }
+ if (*current_mount_ns == NS_DEFAULT) {
+ SetDefaultMountNamespaceReady();
+ }
+
LOG(INFO) << "linkerconfig generated " << linkerconfig_target
<< " with mounted APEX modules info";