diff options
author | brian <brian@FreeBSD.org> | 2001-11-01 02:17:49 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-11-01 02:17:49 +0000 |
commit | 6e6ddbcf2e624d3d29f0bcbd5257cfc6e9f85de8 (patch) | |
tree | 7fdc0117c2168cd2335f5237e79c6f8eebb4c924 /sys/conf/Makefile.i386 | |
parent | cf94102c076de27b80883815338fef5116bae7d2 (diff) | |
download | FreeBSD-src-6e6ddbcf2e624d3d29f0bcbd5257cfc6e9f85de8.zip FreeBSD-src-6e6ddbcf2e624d3d29f0bcbd5257cfc6e9f85de8.tar.gz |
Only overwrite ${DESTDIR}${KODIR}.old/${KERNEL_KO} if we haven't
booted from it when doing an installkernel.
Only change kern.bootfile from ${DESTDIR}${KODIR}/${KERNEL_KO}
to ${DESTDIR}${KODIR}.old/${KERNEL_KO}, and only when we're renaming
a booted ${DESTDIR}${KODIR}/${KERNEL_KO} kernel.
Diffstat (limited to 'sys/conf/Makefile.i386')
-rw-r--r-- | sys/conf/Makefile.i386 | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index d9e1945..0d72924 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -234,13 +234,20 @@ kernel-install kernel-install.debug: exit 1 ; \ fi .if exists(${DESTDIR}${KODIR}) -.if exists(${DESTDIR}${KODIR}.old) - @-chflags -R noschg ${DESTDIR}${KODIR}.old - -rm -rf ${DESTDIR}${KODIR}.old -.endif - mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old - [ "`sysctl -n kern.bootfile`" != "${DESTDIR}${KODIR}/kernel" ] || \ - sysctl kern.bootfile=${DESTDIR}${KODIR}.old/kernel + -thiskernel=`sysctl -n kern.bootfile` ; \ + if [ "$$thiskernel" = ${DESTDIR}${KODIR}.old/${KERNEL_KO} ] ; then \ + chflags -R noschg ${DESTDIR}${KODIR} ; \ + rm -rf ${DESTDIR}${KODIR} ; \ + else \ + if [ -d ${DESTDIR}${KODIR}.old ] ; then \ + chflags -R noschg ${DESTDIR}${KODIR}.old ; \ + rm -rf ${DESTDIR}${KODIR}.old ; \ + fi ; \ + mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \ + if [ "$$thiskernel" = ${DESTDIR}${KODIR}/${KERNEL_KO} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}${KODIR}.old/${KERNEL_KO} ; \ + fi; \ + fi .endif mkdir -p ${DESTDIR}${KODIR} install -c -m 555 -o root -g wheel \ |