Revert "[t22] Don't move /main_init to /init before executing it"

This reverts commit d3147e465c.

Conflicts:
	version.h

SELinux in Android M preview needs it to be called /init.
This commit is contained in:
Vojtech Bocek
2015-05-29 00:18:38 +02:00
parent 4b3da31b90
commit df3d66a473

View File

@@ -243,21 +243,21 @@ static void fixup_symlinks(void)
{
buff[len] = 0;
// if the symlink already points to ../init, skip it.
if(strcmp(buff, "../main_init") == 0)
if(strcmp(buff, "../init") == 0)
continue;
}
}
ERROR("Fixing up symlink '%s' -> '%s' to '%s' -> '../init')\n", init_links[i], buff, init_links[i]);
unlink(init_links[i]);
symlink("../main_init", init_links[i]);
symlink("../init", init_links[i]);
}
}
int main(int argc, char *argv[])
{
int i, res;
static char *const cmd[] = { "/main_init", NULL };
static char *const cmd[] = { "/init", NULL };
struct fstab *fstab = NULL;
char *inject_path = NULL;
char *mrom_dir = NULL;
@@ -387,6 +387,7 @@ run_main_init:
fixup_symlinks();
chmod("/main_init", EXEC_MASK);
rename("/main_init", "/init");
res = execve(cmd[0], cmd, NULL);
ERROR("execve returned %d %d %s\n", res, errno, strerror(errno));