init_main.c revision 1.252 1 /* $NetBSD: init_main.c,v 1.252 2005/11/18 16:40:08 skrll Exp $ */
2
3 /*
4 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)init_main.c 8.16 (Berkeley) 5/14/95
37 */
38
39 /*
40 * Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
41 *
42 * Redistribution and use in source and binary forms, with or without
43 * modification, are permitted provided that the following conditions
44 * are met:
45 * 1. Redistributions of source code must retain the above copyright
46 * notice, this list of conditions and the following disclaimer.
47 * 2. Redistributions in binary form must reproduce the above copyright
48 * notice, this list of conditions and the following disclaimer in the
49 * documentation and/or other materials provided with the distribution.
50 * 3. All advertising materials mentioning features or use of this software
51 * must display the following acknowledgement:
52 * This product includes software developed by the University of
53 * California, Berkeley and its contributors.
54 * 4. Neither the name of the University nor the names of its contributors
55 * may be used to endorse or promote products derived from this software
56 * without specific prior written permission.
57 *
58 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
59 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 *
70 * @(#)init_main.c 8.16 (Berkeley) 5/14/95
71 */
72
73 #include <sys/cdefs.h>
74 __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.252 2005/11/18 16:40:08 skrll Exp $");
75
76 #include "fs_nfs.h"
77 #include "opt_nfsserver.h"
78 #include "opt_ipsec.h"
79 #include "opt_sysv.h"
80 #include "opt_maxuprc.h"
81 #include "opt_multiprocessor.h"
82 #include "opt_pipe.h"
83 #include "opt_syscall_debug.h"
84 #include "opt_systrace.h"
85 #include "opt_posix.h"
86 #include "opt_kcont.h"
87 #include "opt_rootfs_magiclinks.h"
88 #include "opt_verified_exec.h"
89
90 #include "opencrypto.h"
91 #include "rnd.h"
92
93 #include <sys/param.h>
94 #include <sys/acct.h>
95 #include <sys/filedesc.h>
96 #include <sys/file.h>
97 #include <sys/errno.h>
98 #include <sys/callout.h>
99 #include <sys/kernel.h>
100 #include <sys/kcont.h>
101 #include <sys/mount.h>
102 #include <sys/proc.h>
103 #include <sys/kthread.h>
104 #include <sys/resourcevar.h>
105 #include <sys/signalvar.h>
106 #include <sys/systm.h>
107 #include <sys/vnode.h>
108 #include <sys/tty.h>
109 #include <sys/conf.h>
110 #include <sys/disklabel.h>
111 #include <sys/buf.h>
112 #include <sys/device.h>
113 #include <sys/exec.h>
114 #include <sys/socketvar.h>
115 #include <sys/protosw.h>
116 #include <sys/reboot.h>
117 #include <sys/user.h>
118 #include <sys/sysctl.h>
119 #include <sys/event.h>
120 #include <sys/mbuf.h>
121 #ifdef FAST_IPSEC
122 #include <netipsec/ipsec.h>
123 #endif
124 #ifdef SYSVSHM
125 #include <sys/shm.h>
126 #endif
127 #ifdef SYSVSEM
128 #include <sys/sem.h>
129 #endif
130 #ifdef SYSVMSG
131 #include <sys/msg.h>
132 #endif
133 #ifdef P1003_1B_SEMAPHORE
134 #include <sys/ksem.h>
135 #endif
136 #ifdef SYSTRACE
137 #include <sys/systrace.h>
138 #endif
139 #include <sys/domain.h>
140 #include <sys/namei.h>
141 #if NOPENCRYPTO > 0
142 #include <opencrypto/cryptodev.h> /* XXX really the framework */
143 #endif
144 #if NRND > 0
145 #include <sys/rnd.h>
146 #endif
147 #ifndef PIPE_SOCKETPAIR
148 #include <sys/pipe.h>
149 #endif
150 #ifdef LKM
151 #include <sys/lkm.h>
152 #endif
153 #ifdef VERIFIED_EXEC
154 #include <sys/verified_exec.h>
155 #endif
156 #include <net80211/ieee80211_netbsd.h>
157
158 #include <sys/syscall.h>
159 #include <sys/sa.h>
160 #include <sys/syscallargs.h>
161
162 #include <ufs/ufs/quota.h>
163
164 #include <miscfs/genfs/genfs.h>
165 #include <miscfs/syncfs/syncfs.h>
166
167 #include <machine/cpu.h>
168
169 #include <uvm/uvm.h>
170
171 #include <dev/cons.h>
172
173 #include <net/if.h>
174 #include <net/raw_cb.h>
175
176 extern struct proc proc0;
177 extern struct lwp lwp0;
178 extern struct cwdinfo cwdi0;
179
180 #ifndef curlwp
181 struct lwp *curlwp = &lwp0;
182 #endif
183 struct proc *initproc;
184
185 struct vnode *rootvp, *swapdev_vp;
186 int boothowto;
187 int cold = 1; /* still working on startup */
188 struct timeval boottime;
189 time_t rootfstime; /* recorded root fs time, if known */
190
191 __volatile int start_init_exec; /* semaphore for start_init() */
192
193 static void check_console(struct proc *p);
194 static void start_init(void *);
195 void main(void);
196
197 /*
198 * System startup; initialize the world, create process 0, mount root
199 * filesystem, and fork to create init and pagedaemon. Most of the
200 * hard work is done in the lower-level initialization routines including
201 * startup(), which does memory initialization and autoconfiguration.
202 */
203 void
204 main(void)
205 {
206 struct lwp *l;
207 struct proc *p;
208 struct pdevinit *pdev;
209 int s, error;
210 extern struct pdevinit pdevinit[];
211 extern void schedcpu(void *);
212 #if defined(NFSSERVER) || defined(NFS)
213 extern void nfs_init(void);
214 #endif
215 #ifdef NVNODE_IMPLICIT
216 int usevnodes;
217 #endif
218
219 /*
220 * Initialize the current LWP pointer (curlwp) before
221 * any possible traps/probes to simplify trap processing.
222 */
223 l = &lwp0;
224 curlwp = l;
225 l->l_cpu = curcpu();
226 l->l_proc = &proc0;
227 l->l_lid = 1;
228
229 /*
230 * Attempt to find console and initialize
231 * in case of early panic or other messages.
232 */
233 consinit();
234
235 KERNEL_LOCK_INIT();
236
237 uvm_init();
238
239 /* Do machine-dependent initialization. */
240 cpu_startup();
241
242 /* Initialize callouts. */
243 callout_startup();
244
245 /* Initialize the buffer cache */
246 bufinit();
247
248 /*
249 * Initialize mbuf's. Do this now because we might attempt to
250 * allocate mbufs or mbuf clusters during autoconfiguration.
251 */
252 mbinit();
253
254 /* Initialize sockets. */
255 soinit();
256
257 #ifdef KCONT
258 /* Initialize kcont. */
259 kcont_init();
260 #endif
261
262 /*
263 * The following things must be done before autoconfiguration.
264 */
265 evcnt_init(); /* initialize event counters */
266 tty_init(); /* initialize tty list */
267 #if NRND > 0
268 rnd_init(); /* initialize RNG */
269 #endif
270 #if NOPENCRYPTO > 0
271 /* Initialize crypto subsystem before configuring crypto hardware. */
272 (void)crypto_init();
273 #endif
274 /* Initialize the sysctl subsystem. */
275 sysctl_init();
276
277 /* Initialize process and pgrp structures. */
278 procinit();
279
280 #ifdef LKM
281 /* Initialize the LKM system. */
282 lkm_init();
283 #endif
284
285 /* Initialize signal-related data structures. */
286 signal_init();
287
288 /* Initialize the net80211 layer */
289 ieee80211_init();
290
291 /* Create process 0 (the swapper). */
292 proc0_init();
293
294 /*
295 * Charge root for one process.
296 */
297 (void)chgproccnt(0, 1);
298
299 rqinit();
300
301 /* Initialize the file systems. */
302 #if defined(NFSSERVER) || defined(NFS)
303 nfs_init(); /* initialize server/shared data */
304 #endif
305 #ifdef NVNODE_IMPLICIT
306 /*
307 * If maximum number of vnodes in namei vnode cache is not explicitly
308 * defined in kernel config, adjust the number such as we use roughly
309 * 1.0% of memory for vnode cache (but not less than NVNODE vnodes).
310 */
311 usevnodes = (ptoa((unsigned)physmem) / 100) / sizeof(struct vnode);
312 if (usevnodes > desiredvnodes)
313 desiredvnodes = usevnodes;
314 #endif
315 vfsinit();
316
317 /* Configure the system hardware. This will enable interrupts. */
318 configure();
319
320 ubc_init(); /* must be after autoconfig */
321
322 /* Lock the kernel on behalf of proc0. */
323 KERNEL_PROC_LOCK(l);
324
325 #ifdef SYSVSHM
326 /* Initialize System V style shared memory. */
327 shminit();
328 #endif
329
330 #ifdef SYSVSEM
331 /* Initialize System V style semaphores. */
332 seminit();
333 #endif
334
335 #ifdef SYSVMSG
336 /* Initialize System V style message queues. */
337 msginit();
338 #endif
339
340 #ifdef P1003_1B_SEMAPHORE
341 /* Initialize posix semaphores */
342 ksem_init();
343 #endif
344
345 #ifdef VERIFIED_EXEC
346 /*
347 * Initialise the fingerprint operations vectors before
348 * fingerprints can be loaded.
349 */
350 veriexec_init_fp_ops();
351 #endif
352
353 /* Attach pseudo-devices. */
354 for (pdev = pdevinit; pdev->pdev_attach != NULL; pdev++)
355 (*pdev->pdev_attach)(pdev->pdev_count);
356
357 #ifdef FAST_IPSEC
358 /* Attach network crypto subsystem */
359 ipsec_attach();
360 #endif
361
362 /*
363 * Initialize protocols. Block reception of incoming packets
364 * until everything is ready.
365 */
366 s = splnet();
367 ifinit();
368 domaininit();
369 if_attachdomain();
370 splx(s);
371
372 #ifdef GPROF
373 /* Initialize kernel profiling. */
374 kmstartup();
375 #endif
376
377 /* Initialize system accouting. */
378 acct_init();
379
380 #ifdef SYSTRACE
381 systrace_init();
382 #endif
383
384 /* Kick off timeout driven events by calling first time. */
385 schedcpu(NULL);
386
387 /*
388 * Create process 1 (init(8)). We do this now, as Unix has
389 * historically had init be process 1, and changing this would
390 * probably upset a lot of people.
391 *
392 * Note that process 1 won't immediately exec init(8), but will
393 * wait for us to inform it that the root file system has been
394 * mounted.
395 */
396 if (fork1(l, 0, SIGCHLD, NULL, 0, start_init, NULL, NULL, &initproc))
397 panic("fork init");
398
399 /*
400 * Create any kernel threads who's creation was deferred because
401 * initproc had not yet been created.
402 */
403 kthread_run_deferred_queue();
404
405 /*
406 * Now that device driver threads have been created, wait for
407 * them to finish any deferred autoconfiguration. Note we don't
408 * need to lock this semaphore, since we haven't booted any
409 * secondary processors, yet.
410 */
411 while (config_pending)
412 (void) tsleep(&config_pending, PWAIT, "cfpend", 0);
413
414 /*
415 * Finalize configuration now that all real devices have been
416 * found. This needs to be done before the root device is
417 * selected, since finalization may create the root device.
418 */
419 config_finalize();
420
421 /*
422 * Now that autoconfiguration has completed, we can determine
423 * the root and dump devices.
424 */
425 cpu_rootconf();
426 cpu_dumpconf();
427
428 /* Mount the root file system. */
429 do {
430 domountroothook();
431 if ((error = vfs_mountroot())) {
432 printf("cannot mount root, error = %d\n", error);
433 boothowto |= RB_ASKNAME;
434 setroot(root_device,
435 (rootdev != NODEV) ? DISKPART(rootdev) : 0);
436 }
437 } while (error != 0);
438 mountroothook_destroy();
439
440 /*
441 * Initialise the time-of-day clock, passing the time recorded
442 * in the root filesystem (if any) for use by systems that
443 * don't have a non-volatile time-of-day device.
444 */
445 inittodr(rootfstime);
446
447 CIRCLEQ_FIRST(&mountlist)->mnt_flag |= MNT_ROOTFS;
448 #ifdef ROOTFS_MAGICLINKS
449 CIRCLEQ_FIRST(&mountlist)->mnt_flag |= MNT_MAGICLINKS;
450 #endif
451 CIRCLEQ_FIRST(&mountlist)->mnt_op->vfs_refcount++;
452
453 /*
454 * Get the vnode for '/'. Set filedesc0.fd_fd.fd_cdir to
455 * reference it.
456 */
457 error = VFS_ROOT(CIRCLEQ_FIRST(&mountlist), &rootvnode);
458 if (error)
459 panic("cannot find root vnode, error=%d", error);
460 cwdi0.cwdi_cdir = rootvnode;
461 VREF(cwdi0.cwdi_cdir);
462 VOP_UNLOCK(rootvnode, 0);
463 cwdi0.cwdi_rdir = NULL;
464
465 /*
466 * Now that root is mounted, we can fixup initproc's CWD
467 * info. All other processes are kthreads, which merely
468 * share proc0's CWD info.
469 */
470 initproc->p_cwdi->cwdi_cdir = rootvnode;
471 VREF(initproc->p_cwdi->cwdi_cdir);
472 initproc->p_cwdi->cwdi_rdir = NULL;
473
474 /*
475 * Now can look at time, having had a chance to verify the time
476 * from the file system. Reset p->p_rtime as it may have been
477 * munched in mi_switch() after the time got set.
478 */
479 proclist_lock_read();
480 s = splsched();
481 LIST_FOREACH(p, &allproc, p_list) {
482 KASSERT((p->p_flag & P_MARKER) == 0);
483 p->p_stats->p_start = mono_time = boottime = time;
484 LIST_FOREACH(l, &p->p_lwps, l_sibling) {
485 if (l->l_cpu != NULL)
486 l->l_cpu->ci_schedstate.spc_runtime = time;
487 }
488 p->p_rtime.tv_sec = p->p_rtime.tv_usec = 0;
489 }
490 splx(s);
491 proclist_unlock_read();
492
493 /* Create the pageout daemon kernel thread. */
494 uvm_swap_init();
495 if (kthread_create1(uvm_pageout, NULL, NULL, "pagedaemon"))
496 panic("fork pagedaemon");
497
498 /* Create the filesystem syncer kernel thread. */
499 if (kthread_create1(sched_sync, NULL, NULL, "ioflush"))
500 panic("fork syncer");
501
502 /* Create the aiodone daemon kernel thread. */
503 if (kthread_create1(uvm_aiodone_daemon, NULL, &uvm.aiodoned_proc,
504 "aiodoned"))
505 panic("fork aiodoned");
506
507 #if defined(MULTIPROCESSOR)
508 /* Boot the secondary processors. */
509 cpu_boot_secondary_processors();
510 #endif
511
512 /* Initialize exec structures */
513 exec_init(1);
514
515 /*
516 * Okay, now we can let init(8) exec! It's off to userland!
517 */
518 start_init_exec = 1;
519 wakeup(&start_init_exec);
520
521 /* The scheduler is an infinite loop. */
522 uvm_scheduler();
523 /* NOTREACHED */
524 }
525
526 void
527 setrootfstime(time_t t)
528 {
529
530 rootfstime = t;
531 }
532
533 static void
534 check_console(struct proc *p)
535 {
536 struct nameidata nd;
537 int error;
538
539 NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/console", p);
540 error = namei(&nd);
541 if (error == 0)
542 vrele(nd.ni_vp);
543 else if (error == ENOENT)
544 printf("warning: no /dev/console\n");
545 else
546 printf("warning: lookup /dev/console: error %d\n", error);
547 }
548
549 /*
550 * List of paths to try when searching for "init".
551 */
552 static const char *initpaths[] = {
553 "/sbin/init",
554 "/sbin/oinit",
555 "/sbin/init.bak",
556 NULL,
557 };
558
559 /*
560 * Start the initial user process; try exec'ing each pathname in "initpaths".
561 * The program is invoked with one argument containing the boot flags.
562 */
563 static void
564 start_init(void *arg)
565 {
566 struct lwp *l = arg;
567 struct proc *p = l->l_proc;
568 vaddr_t addr;
569 struct sys_execve_args /* {
570 syscallarg(const char *) path;
571 syscallarg(char * const *) argp;
572 syscallarg(char * const *) envp;
573 } */ args;
574 int options, i, error;
575 register_t retval[2];
576 char flags[4], *flagsp;
577 const char *path, *slash;
578 char *ucp, **uap, *arg0, *arg1 = NULL;
579 char ipath[129];
580 int ipx, len;
581
582 /*
583 * Now in process 1.
584 */
585 strncpy(p->p_comm, "init", MAXCOMLEN);
586
587 /*
588 * Wait for main() to tell us that it's safe to exec.
589 */
590 while (start_init_exec == 0)
591 (void) tsleep(&start_init_exec, PWAIT, "initexec", 0);
592
593 /*
594 * This is not the right way to do this. We really should
595 * hand-craft a descriptor onto /dev/console to hand to init,
596 * but that's a _lot_ more work, and the benefit from this easy
597 * hack makes up for the "good is the enemy of the best" effect.
598 */
599 check_console(p);
600
601 /*
602 * Need just enough stack to hold the faked-up "execve()" arguments.
603 */
604 addr = (vaddr_t)STACK_ALLOC(USRSTACK, PAGE_SIZE);
605 if (uvm_map(&p->p_vmspace->vm_map, &addr, PAGE_SIZE,
606 NULL, UVM_UNKNOWN_OFFSET, 0,
607 UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
608 UVM_ADV_NORMAL,
609 UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)
610 panic("init: couldn't allocate argument space");
611 p->p_vmspace->vm_maxsaddr = (caddr_t)STACK_MAX(addr, PAGE_SIZE);
612
613 ipx = 0;
614 while (1) {
615 if (boothowto & RB_ASKNAME) {
616 printf("init path");
617 if (initpaths[ipx])
618 printf(" (default %s)", initpaths[ipx]);
619 printf(": ");
620 len = cngetsn(ipath, sizeof(ipath)-1);
621 if (len == 0) {
622 if (initpaths[ipx])
623 path = initpaths[ipx++];
624 else
625 continue;
626 } else {
627 ipath[len] = '\0';
628 path = ipath;
629 }
630 } else {
631 if ((path = initpaths[ipx++]) == NULL)
632 break;
633 }
634
635 ucp = (char *)USRSTACK;
636
637 /*
638 * Construct the boot flag argument.
639 */
640 flagsp = flags;
641 *flagsp++ = '-';
642 options = 0;
643
644 if (boothowto & RB_SINGLE) {
645 *flagsp++ = 's';
646 options = 1;
647 }
648 #ifdef notyet
649 if (boothowto & RB_FASTBOOT) {
650 *flagsp++ = 'f';
651 options = 1;
652 }
653 #endif
654
655 /*
656 * Move out the flags (arg 1), if necessary.
657 */
658 if (options != 0) {
659 *flagsp++ = '\0';
660 i = flagsp - flags;
661 #ifdef DEBUG
662 printf("init: copying out flags `%s' %d\n", flags, i);
663 #endif
664 arg1 = STACK_ALLOC(ucp, i);
665 ucp = STACK_MAX(arg1, i);
666 (void)copyout((caddr_t)flags, arg1, i);
667 }
668
669 /*
670 * Move out the file name (also arg 0).
671 */
672 i = strlen(path) + 1;
673 #ifdef DEBUG
674 printf("init: copying out path `%s' %d\n", path, i);
675 #else
676 if (boothowto & RB_ASKNAME || path != initpaths[0])
677 printf("init: trying %s\n", path);
678 #endif
679 arg0 = STACK_ALLOC(ucp, i);
680 ucp = STACK_MAX(arg0, i);
681 (void)copyout(path, arg0, i);
682
683 /*
684 * Move out the arg pointers.
685 */
686 ucp = (caddr_t)STACK_ALIGN(ucp, ALIGNBYTES);
687 uap = (char **)STACK_ALLOC(ucp, sizeof(char *) * 3);
688 SCARG(&args, path) = arg0;
689 SCARG(&args, argp) = uap;
690 SCARG(&args, envp) = NULL;
691 slash = strrchr(path, '/');
692 if (slash)
693 (void)suword((caddr_t)uap++,
694 (long)arg0 + (slash + 1 - path));
695 else
696 (void)suword((caddr_t)uap++, (long)arg0);
697 if (options != 0)
698 (void)suword((caddr_t)uap++, (long)arg1);
699 (void)suword((caddr_t)uap++, 0); /* terminator */
700
701 /*
702 * Now try to exec the program. If can't for any reason
703 * other than it doesn't exist, complain.
704 */
705 error = sys_execve(LIST_FIRST(&p->p_lwps), &args, retval);
706 if (error == 0 || error == EJUSTRETURN) {
707 KERNEL_PROC_UNLOCK(l);
708 return;
709 }
710 printf("exec %s: error %d\n", path, error);
711 }
712 printf("init: not found\n");
713 panic("no init");
714 }
715