Commit 00247c79 authored by 石松洲's avatar 石松洲 Committed by John Wu

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.
parent 3c75f474
...@@ -80,9 +80,15 @@ bool SecondStageInit::prepare() { ...@@ -80,9 +80,15 @@ bool SecondStageInit::prepare() {
argv[0] = (char *) INIT_PATH; argv[0] = (char *) INIT_PATH;
// Some weird devices like meizu, uses 2SI but still have legacy rootfs // 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{}; struct stat root{}, system{};
xstat("/", &root); xstat("/", &root);
xstat("/system", &system); 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;
} }
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