mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Fix meizu non-SAR 2SI compatibility again
Meizu devices using 2SI won't switch root to /system and still on rootfs, and /init is the 1st stage's, which cannot handle the 2nd stage. So we have to manually execute /system/bin/init for the 2nd stage.
This commit is contained in:
parent
3c75f474c6
commit
00247c7901
@ -80,9 +80,15 @@ bool SecondStageInit::prepare() {
|
||||
argv[0] = (char *) INIT_PATH;
|
||||
|
||||
// Some weird devices like meizu, uses 2SI but still have legacy rootfs
|
||||
// Check if root and system are on the same filesystem
|
||||
// Check if root and system are on different filesystems
|
||||
struct stat root{}, system{};
|
||||
xstat("/", &root);
|
||||
xstat("/system", &system);
|
||||
return root.st_dev != system.st_dev;
|
||||
if (root.st_dev != system.st_dev) {
|
||||
// We are still on rootfs, so make sure we will execute the init of the 2nd stage
|
||||
unlink("/init");
|
||||
xsymlink(INIT_PATH, "/init");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user