Use relative symbolic links
This commit is contained in:
parent
8e348a11c2
commit
7233285437
@ -348,8 +348,8 @@ static bool magisk_env() {
|
|||||||
unlink("/data/magisk_debug.log");
|
unlink("/data/magisk_debug.log");
|
||||||
|
|
||||||
// Backwards compatibility
|
// Backwards compatibility
|
||||||
symlink(MAGISKTMP, "/sbin/.core");
|
symlink("./magisk", "/sbin/.core");
|
||||||
symlink(MODULEMNT, MAGISKTMP "/img");
|
symlink("./modules", MAGISKTMP "/img");
|
||||||
|
|
||||||
// Directories in tmpfs overlay
|
// Directories in tmpfs overlay
|
||||||
xmkdir(MIRRDIR, 0);
|
xmkdir(MIRRDIR, 0);
|
||||||
@ -663,14 +663,14 @@ void post_fs_data(int client) {
|
|||||||
if (access(buf, F_OK) == 0) {
|
if (access(buf, F_OK) == 0) {
|
||||||
snprintf(buf2, PATH_MAX, "%s/%s/vendor", MODULEROOT, module);
|
snprintf(buf2, PATH_MAX, "%s/%s/vendor", MODULEROOT, module);
|
||||||
unlink(buf2);
|
unlink(buf2);
|
||||||
xsymlink(buf, buf2);
|
xsymlink("./system/vendor", buf2);
|
||||||
}
|
}
|
||||||
// If /system/product exists in module, create a link outside
|
// If /system/product exists in module, create a link outside
|
||||||
snprintf(buf, PATH_MAX, "%s/%s/system/product", MODULEROOT, module);
|
snprintf(buf, PATH_MAX, "%s/%s/system/product", MODULEROOT, module);
|
||||||
if (access(buf, F_OK) == 0) {
|
if (access(buf, F_OK) == 0) {
|
||||||
snprintf(buf2, PATH_MAX, "%s/%s/product", MODULEROOT, module);
|
snprintf(buf2, PATH_MAX, "%s/%s/product", MODULEROOT, module);
|
||||||
unlink(buf2);
|
unlink(buf2);
|
||||||
xsymlink(buf, buf2);
|
xsymlink("./system/product", buf2);
|
||||||
}
|
}
|
||||||
sys_root->create_module_tree(module);
|
sys_root->create_module_tree(module);
|
||||||
}
|
}
|
||||||
|
@ -185,10 +185,10 @@ static void sbin_overlay(const raw_data &self, const raw_data &config) {
|
|||||||
char path[64];
|
char path[64];
|
||||||
for (int i = 0; applet_names[i]; ++i) {
|
for (int i = 0; applet_names[i]; ++i) {
|
||||||
sprintf(path, "/sbin/%s", applet_names[i]);
|
sprintf(path, "/sbin/%s", applet_names[i]);
|
||||||
xsymlink("/sbin/magisk", path);
|
xsymlink("./magisk", path);
|
||||||
}
|
}
|
||||||
xsymlink("/sbin/magiskinit", "/sbin/magiskpolicy");
|
xsymlink("./magiskinit", "/sbin/magiskpolicy");
|
||||||
xsymlink("/sbin/magiskinit", "/sbin/supolicy");
|
xsymlink("./magiskinit", "/sbin/supolicy");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ROOTMIR MIRRDIR "/system_root"
|
#define ROOTMIR MIRRDIR "/system_root"
|
||||||
|
Loading…
Reference in New Issue
Block a user