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

* This causes "Device or resource busy" when remounting rootfs as RO
  on hammerhead with encryption and thus causing bootloop because...
  why the fuck exactly? Only on this device and only with encryption?
  I don't care at this point, already took several hours to debug,
  hopefuly SELinux won't mind.
This commit is contained in:
Vojtech Bocek
2015-03-11 02:14:21 +01:00
parent 885f69452a
commit d3147e465c
2 changed files with 4 additions and 5 deletions

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, "../init") == 0)
if(strcmp(buff, "../main_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("../init", init_links[i]);
symlink("../main_init", init_links[i]);
}
}
int main(int argc, char *argv[])
{
int i, res;
static char *const cmd[] = { "/init", NULL };
static char *const cmd[] = { "/main_init", NULL };
struct fstab *fstab = NULL;
char *inject_path = NULL;
char *mrom_dir = NULL;
@@ -387,7 +387,6 @@ 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));

View File

@@ -18,7 +18,7 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_MULTIROM 31
#define VERSION_TRAMPOLINE 21
#define VERSION_TRAMPOLINE 22
// For device-specific fixes. Use letters, the version will then be like "12a"
#define VERSION_DEV_FIX "v"