Loading init/first_stage_init.cpp +7 −3 Original line number Original line Diff line number Diff line Loading @@ -121,9 +121,9 @@ void StartConsole() { _exit(127); _exit(127); } } ioctl(fd, TIOCSCTTY, 0); ioctl(fd, TIOCSCTTY, 0); dup2(fd, 0); dup2(fd, STDIN_FILENO); dup2(fd, 1); dup2(fd, STDOUT_FILENO); dup2(fd, 2); dup2(fd, STDERR_FILENO); close(fd); close(fd); const char* path = "/system/bin/sh"; const char* path = "/system/bin/sh"; Loading Loading @@ -291,6 +291,10 @@ int FirstStageMain(int argc, char** argv) { const char* path = "/system/bin/init"; const char* path = "/system/bin/init"; const char* args[] = {path, "selinux_setup", nullptr}; const char* args[] = {path, "selinux_setup", nullptr}; auto fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); close(fd); execv(path, const_cast<char**>(args)); execv(path, const_cast<char**>(args)); // execv() only returns if an error happened, in which case we // execv() only returns if an error happened, in which case we Loading init/selinux.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -523,6 +523,7 @@ int SelinuxGetVendorAndroidVersion() { // This function initializes SELinux then execs init to run in the init SELinux context. // This function initializes SELinux then execs init to run in the init SELinux context. int SetupSelinux(char** argv) { int SetupSelinux(char** argv) { SetStdioToDevNull(argv); InitKernelLogging(argv); InitKernelLogging(argv); if (REBOOT_BOOTLOADER_ON_PANIC) { if (REBOOT_BOOTLOADER_ON_PANIC) { Loading Loading
init/first_stage_init.cpp +7 −3 Original line number Original line Diff line number Diff line Loading @@ -121,9 +121,9 @@ void StartConsole() { _exit(127); _exit(127); } } ioctl(fd, TIOCSCTTY, 0); ioctl(fd, TIOCSCTTY, 0); dup2(fd, 0); dup2(fd, STDIN_FILENO); dup2(fd, 1); dup2(fd, STDOUT_FILENO); dup2(fd, 2); dup2(fd, STDERR_FILENO); close(fd); close(fd); const char* path = "/system/bin/sh"; const char* path = "/system/bin/sh"; Loading Loading @@ -291,6 +291,10 @@ int FirstStageMain(int argc, char** argv) { const char* path = "/system/bin/init"; const char* path = "/system/bin/init"; const char* args[] = {path, "selinux_setup", nullptr}; const char* args[] = {path, "selinux_setup", nullptr}; auto fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); close(fd); execv(path, const_cast<char**>(args)); execv(path, const_cast<char**>(args)); // execv() only returns if an error happened, in which case we // execv() only returns if an error happened, in which case we Loading
init/selinux.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -523,6 +523,7 @@ int SelinuxGetVendorAndroidVersion() { // This function initializes SELinux then execs init to run in the init SELinux context. // This function initializes SELinux then execs init to run in the init SELinux context. int SetupSelinux(char** argv) { int SetupSelinux(char** argv) { SetStdioToDevNull(argv); InitKernelLogging(argv); InitKernelLogging(argv); if (REBOOT_BOOTLOADER_ON_PANIC) { if (REBOOT_BOOTLOADER_ON_PANIC) { Loading