diff options
author | Kiyoung Kim <kiyoungkim@google.com> | 2021-03-02 16:45:27 +0900 |
---|---|---|
committer | Kiyoung Kim <kiyoungkim@google.com> | 2021-03-05 16:42:20 +0900 |
commit | 0cbee0de2af658508f7ea97e47ffef69e0e7119f (patch) | |
tree | 54d0c787d138cd5beacc4cababd941b8377f21fe /init/builtins.cpp | |
parent | 5060516c6ff8cac992e1f650c8c7ce8cff86314a (diff) |
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
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index dcc9582e2..035038f32 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1278,6 +1278,14 @@ static Result<void> GenerateLinkerConfiguration() { 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"; |