diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 94132b5b515f..3acd43f539e3 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -68,6 +68,15 @@ ${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.symbols ${FULLKERNEL} ${.TARGET} ${KERNEL_KO}.symbols: ${FULLKERNEL} ${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET} +.if defined(MFS_IMAGE) + @dd if="${MFS_IMAGE}" ibs=8192 of="${KERNEL_KO}" \ + obs=`strings -at d "${KERNEL_KO}" | \ + grep "MFS Filesystem goes here" | awk '{print $$1}'` \ + oseek=1 conv=notrunc 2>/dev/null && \ + strings ${KERNEL_KO} | \ + grep 'MFS Filesystem had better STOP here' > /dev/null || \ + (rm ${KERNEL_KO} && echo 'MFS image too large' && false) +.endif install.debug reinstall.debug: gdbinit cd ${.CURDIR}; ${MAKE} ${.TARGET:R}