Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
init: import init rc scripts from file systems after mount_all
Browse files Browse the repository at this point in the history
Import /{system,vendor,odm}/etc/init/... after file systems are mounted

Bug: 23186545
Change-Id: Idb0cae9773f904c0330054c8b3e31eb87b2fb7cb
  • Loading branch information
Tom Cherry committed Aug 21, 2015
1 parent cb716f9 commit b8dd027
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions init/builtins.cpp
Expand Up @@ -427,6 +427,19 @@ static int wipe_data_via_recovery()
while (1) { pause(); } // never reached
}

void import_late()
{
static const std::vector<std::string> init_directories = {
"/system/etc/init",
"/vendor/etc/init",
"/odm/etc/init"
};

for (const auto& dir : init_directories) {
init_parse_config(dir.c_str());
}
}

/*
* This function might request a reboot, in which case it will
* not return.
Expand Down Expand Up @@ -478,6 +491,8 @@ int do_mount_all(const std::vector<std::string>& args)
return -1;
}

import_late();

if (ret == FS_MGR_MNTALL_DEV_NEEDS_ENCRYPTION) {
property_set("vold.decrypt", "trigger_encryption");
} else if (ret == FS_MGR_MNTALL_DEV_MIGHT_BE_ENCRYPTED) {
Expand Down

0 comments on commit b8dd027

Please sign in to comment.