Properly detect 2SI init

Fix #2994
This commit is contained in:
topjohnwu
2020-09-02 21:20:00 -07:00
parent b73d5753f2
commit f32a29911b
3 changed files with 26 additions and 15 deletions

View File

@@ -178,3 +178,10 @@ void load_kernel_info(cmdline *cmd) {
LOGD("hardware=[%s]\n", cmd->hardware);
LOGD("hardware.platform=[%s]\n", cmd->hardware_plat);
}
bool check_two_stage() {
if (access("/apex", F_OK) == 0)
return true;
auto init = raw_data::mmap_ro("/init");
return init.find("selinux_setup");
}