Commit 04c53c35 authored by topjohnwu's avatar topjohnwu

Legacy SAR: use a simpler method to detect is_two_stage

parent 51bc27a8
...@@ -345,10 +345,8 @@ void SARInit::early_mount() { ...@@ -345,10 +345,8 @@ void SARInit::early_mount() {
mount_system_root(); mount_system_root();
switch_root("/system_root"); switch_root("/system_root");
{ // Use the apex folder to determine whether 2SI (Android 10+)
auto init = mmap_data::ro("/init"); is_two_stage = access("/apex", F_OK) == 0;
is_two_stage = init.contains("selinux_setup");
}
LOGD("is_two_stage: [%d]\n", is_two_stage); LOGD("is_two_stage: [%d]\n", is_two_stage);
if (!is_two_stage) { if (!is_two_stage) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment