diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-11-09 18:36:11 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2019-11-09 18:36:11 +1100 |
commit | 90f27cc09b7d38d5d2849a3ba626881b7c1e462e (patch) | |
tree | 86ea885534775f40ca6d073d02385a1cb64ca4fe | |
parent | 938ae54389d8ce91b2575199a07c3b8787b0bdbd (diff) |
add debian patch for startup
-rw-r--r-- | startup/startup.c | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/startup/startup.c b/startup/startup.c index fd16eb73..c2fbd82e 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -24,6 +24,9 @@ one file. */ #include <hurd.h> #include <hurd/fs.h> +#ifdef HAVE_FILE_EXEC_FILE_NAME +#include <hurd/fs_experimental.h> +#endif #include <hurd/fsys.h> #include <device/device.h> #include <stdio.h> @@ -446,6 +449,21 @@ run (const char *server, mach_port_t *ports, task_t *task, file_exec. */ if (err == MIG_BAD_ID) #endif +#ifdef HAVE_FILE_EXEC_FILE_NAME + err = file_exec_file_name (file, *task, 0, (char *)prog, + argz, + argz_len, /* Args. */ + startup_envz, startup_envz_len, + default_dtable, + MACH_MSG_TYPE_COPY_SEND, 3, + ports, MACH_MSG_TYPE_COPY_SEND, + INIT_PORT_MAX, + default_ints, INIT_INT_MAX, + NULL, 0, NULL, 0); + /* For backwards compatibility. Just drop it when we kill + file_exec. */ + if (err == MIG_BAD_ID) +#endif err = file_exec (file, *task, 0, argz, argz_len, /* Args. */ startup_envz, startup_envz_len, @@ -594,6 +612,18 @@ run_for_real (char *filename, char *args, int arglen, mach_port_t ctty, /* For backwards compatibility. Just drop it when we kill file_exec. */ if (err == MIG_BAD_ID) #endif +#ifdef HAVE_FILE_EXEC_FILE_NAME + err = file_exec_file_name (file, task, 0, filename, + args, arglen, + startup_envz, startup_envz_len, + default_dtable, MACH_MSG_TYPE_COPY_SEND, 3, + default_ports, MACH_MSG_TYPE_COPY_SEND, + INIT_PORT_MAX, + default_ints, INIT_INT_MAX, + NULL, 0, NULL, 0); + /* For backwards compatibility. Just drop it when we kill file_exec. */ + if (err == MIG_BAD_ID) +#endif err = file_exec (file, task, 0, args, arglen, startup_envz, startup_envz_len, @@ -1181,7 +1211,7 @@ frob_kernel_process (void) /** Running userland. **/ /* In the "split-init" setup, we just run a single program (usually - /libexec/runsystem) that is not expected to ever exit (or stop). + /etc/hurd/runsystem) that is not expected to ever exit (or stop). If it does exit (or can't be started), we go to an emergency single-user shell as a fallback. */ @@ -1249,7 +1279,7 @@ process_signal (int signo) } } -/* Start the child program PROG. It is run via /libexec/console-run +/* Start the child program PROG. It is run via /sbin/console-run with the given additional arguments. */ static int start_child (const char *prog, char **progargs) @@ -1261,7 +1291,7 @@ start_child (const char *prog, char **progargs) if (progargs == 0) { - const char *argv[] = { "/libexec/console-run", prog, 0 }; + const char *argv[] = { "/sbin/console-run", prog, 0 }; err = argz_create ((char **) argv, &args, &arglen); } else @@ -1271,7 +1301,7 @@ start_child (const char *prog, char **progargs) ++argc; { const char *argv[2 + argc + 1]; - argv[0] = "/libexec/console-run"; + argv[0] = "/sbin/console-run"; argv[1] = prog; argv[2 + argc] = 0; while (argc-- > 0) @@ -1319,6 +1349,18 @@ start_child (const char *prog, char **progargs) /* For backwards compatibility. Just drop it when we kill file_exec. */ if (err == MIG_BAD_ID) #endif +#ifdef HAVE_FILE_EXEC_FILE_NAME + err = file_exec_file_name (file, child_task, 0, args, + args, arglen, + startup_envz, startup_envz_len, + NULL, MACH_MSG_TYPE_COPY_SEND, 0, /* No fds. */ + default_ports, MACH_MSG_TYPE_COPY_SEND, + INIT_PORT_MAX, + default_ints, INIT_INT_MAX, + NULL, 0, NULL, 0); + /* For backwards compatibility. Just drop it when we kill file_exec. */ + if (err == MIG_BAD_ID) +#endif err = file_exec (file, child_task, 0, args, arglen, startup_envz, startup_envz_len, @@ -1347,7 +1389,8 @@ launch_something (const char *why) static unsigned int try; static const char *const tries[] = { - "/libexec/runsystem", + "/etc/hurd/runsystem", + "/etc/hurd/runsystem.gnu", _PATH_BSHELL, "/bin/shd", /* XXX */ }; |