make 'PM: INIT died' message debuggable

. PM: print init stacktrace and exit status
	. init: include debug info in executable
	. sanity-check against one of the possible causes, missing dev
	  nodes on the ramdisk

Change-Id: I813bae174c00dba51a07daf3b7def240e8d1f87b
This commit is contained in:
Ben Gras 2014-08-25 18:35:59 +02:00
parent 3260d16f34
commit 26d9d3e4e6
3 changed files with 11 additions and 3 deletions

View File

@ -201,8 +201,9 @@ proto.dev.mtree:
proto.dev: proto.dev.mtree etc/pwd.db etc/spwd.db etc/passwd etc/group
${TOOL_MTREE} -f ${.TARGET}.mtree -N ${.OBJDIR}/etc -C -K device | \
${TOOL_TOPROTO} | ${TOOL_SED} -e '1,4d' | \
${TOOL_SED} -e '$$d' |${TOOL_SED} -e '$$d' > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
${TOOL_SED} -e '$$d' |${TOOL_SED} -e '$$d' > ${.TARGET}.tmp
grep console ${.TARGET}.tmp # sanity check; is there a console entry?
mv ${.TARGET}.tmp ${.TARGET}
proto.gen: ${PROTO} ${PROTO_FILES} proto.dev ${PROGRAMS}
${STRIP} ${PROGRAMS}

View File

@ -314,7 +314,8 @@ int dump_core; /* flag indicating whether to dump core */
vm_notify_sig_wrapper(rmp->mp_endpoint);
if (proc_nr_e == INIT_PROC_NR)
{
printf("PM: INIT died\n");
printf("PM: INIT died with exit status %d; showing stacktrace\n", exit_status);
sys_diagctl_stacktrace(proc_nr_e);
return;
}
if (proc_nr_e == VFS_PROC_NR)

View File

@ -7,6 +7,12 @@ DPADD= ${LIBUTIL}
LDADD= -lutil
CPPFLAGS+= -DMFS_DEV_IF_NO_CONSOLE -DSUPPORT_UTMP -DSUPPORT_UTMPX
#.if defined(__MINIX)
# BJG - by default produce line numbers in case init exits without producing
# output
DBG=-g
#.endif
.ifdef INIT_CHROOT
CPPFLAGS+= -DCHROOT
.elifdef SMALLPROG