Skip to content

Commit

Permalink
Create product mirror if /system/product exist
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Sep 23, 2019
1 parent 4cd4bfa commit 695e7e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions native/jni/core/bootstages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static bool magisk_env() {
parse_mnt("/proc/mounts", [&](mntent *me) {
if (DIR_IS(system_root)) {
mount_mirror(system_root, MS_RDONLY);
xsymlink(MIRRMNT(system_root) "/system", MIRRMNT(system));
xsymlink("./system_root/system", MIRRMNT(system));
VLOGI("link", MIRRMNT(system_root) "/system", MIRRMNT(system));
system_as_root = true;
} else if (!system_as_root && DIR_IS(system)) {
Expand All @@ -386,13 +386,17 @@ static bool magisk_env() {
});
if (access(MIRRMNT(system), F_OK) != 0 && access(MIRRMNT(system_root), F_OK) == 0) {
// Pre-init mirrors
xsymlink(MIRRMNT(system_root) "/system", MIRRMNT(system));
xsymlink("./system_root/system", MIRRMNT(system));
VLOGI("link", MIRRMNT(system_root) "/system", MIRRMNT(system));
}
if (access(MIRRMNT(vendor), F_OK) != 0) {
xsymlink(MIRRMNT(system) "/vendor", MIRRMNT(vendor));
xsymlink("./system/vendor", MIRRMNT(vendor));
VLOGI("link", MIRRMNT(system) "/vendor", MIRRMNT(vendor));
}
if (access("/system/product", F_OK) == 0 && access(MIRRMNT(product), F_OK) != 0) {
xsymlink("./system/product", MIRRMNT(product));
VLOGI("link", MIRRMNT(system) "/product", MIRRMNT(product));
}

// Disable/remove magiskhide, resetprop, and modules
if (SDK_INT < 19) {
Expand Down

0 comments on commit 695e7e6

Please sign in to comment.