Index: kern.post.mk =================================================================== RCS file: /home/dcvs/src/sys/conf/kern.post.mk,v retrieving revision 1.8 diff -u -r1.8 kern.post.mk --- kern.post.mk 19 Jan 2007 07:23:42 -0000 1.8 +++ kern.post.mk 28 Jan 2007 13:30:13 -0000 @@ -103,7 +103,7 @@ rm -f tags1 sed -e 's, ../, ,' tags > tags1 -# Note: when moving the existing kernel to .old, make sure it is stripped +# Note: when moving the existing kernel to .old, it is by default stripped # so we do not have two full debug environments sitting in / eating up space. # kernel-install: @@ -112,16 +112,24 @@ exit 1 ; \ fi .ifdef NOFSCHG -.if exists(${DESTDIR}/${KERNEL}) +. if exists(${DESTDIR}/${KERNEL}) +. ifdef NO_KERNEL_OLD_STRIP + mv -f ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +. else ${OBJCOPY} --strip-debug ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old -.endif +. endif +. endif ${INSTALL} -m 555 -o root -g wheel \ ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} .else -.if exists(${DESTDIR}/${KERNEL}) +. if exists(${DESTDIR}/${KERNEL}) -chflags noschg ${DESTDIR}/${KERNEL} +. ifdef NO_KERNEL_OLD_STRIP + mv -f ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +. else ${OBJCOPY} --strip-debug ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old -.endif +. endif +. endif ${INSTALL} -m 555 -o root -g wheel -fschg \ ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} .endif @@ -172,11 +180,20 @@ modules-tags: cd $S ; env ${MKMODULESENV} ${MAKE} -f Makefile.modules tags -# Note: when moving the existing modules to .old, make sure they are stripped +# Note: when moving the existing modules to .old, they are by default stripped # so we do not have two full debug environments sitting in / eating up space. # modules-install: .if !defined(NO_MODULES_OLD) +. ifdef NO_KERNEL_OLD_STRIP + set -- ${DESTDIR}/modules/*; \ + if [ -f "$$1" ]; then \ + mkdir -p ${DESTDIR}/modules.old; \ + for file; do \ + mv -f $$file ${DESTDIR}/modules.old; \ + done; \ + fi +. else set -- ${DESTDIR}/modules/*; \ if [ -f "$$1" ]; then \ mkdir -p ${DESTDIR}/modules.old; \ @@ -184,6 +201,7 @@ ${OBJCOPY} --strip-debug $$file ${DESTDIR}/modules.old/$${file##*/}; \ done; \ fi +. endif .endif cd $S ; env ${MKMODULESENV} ${MAKE} -f Makefile.modules install