diff options
-rw-r--r-- | sys/kern/init_main.c | 6 | ||||
-rw-r--r-- | usr.sbin/init/main.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 43142ec..81ddcb5 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -46,10 +46,8 @@ #if defined(_INSTALL_MEDIA) #define _START_PATH "/usr/sbin/install" -#define _START_ARG NULL #else -#define _START_PATH "/usr/bin/osh" -#define _START_ARG "/usr/rc/init.rc" +#define _START_PATH "/usr/sbin/init" #endif /* _INSTALL_MEDIA */ struct proc g_proc0; @@ -66,7 +64,7 @@ start_init(void) { struct proc *td = this_td(); struct execve_args execve_args; - char *argv[] = { _START_PATH, _START_ARG, NULL }; + char *argv[] = { _START_PATH, NULL, NULL }; char *envp[] = { NULL }; execve_args.pathname = argv[0]; diff --git a/usr.sbin/init/main.c b/usr.sbin/init/main.c index a136740..bec44ef 100644 --- a/usr.sbin/init/main.c +++ b/usr.sbin/init/main.c @@ -27,8 +27,20 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/spawn.h> +#include <stddef.h> + +#define SHELL_PATH "/usr/bin/osh" +#define INIT_RC_PATH "/usr/rc/init.rc" + int main(void) { + char *argv[] = { SHELL_PATH, INIT_RC_PATH, NULL }; + char *envp[] = { NULL }; + + spawn(SHELL_PATH, argv, envp, SPAWN_WAIT); + argv[1] = NULL; + spawn(SHELL_PATH, argv, envp, SPAWN_WAIT); return 0; } |