diff options
author | Brian Somers <brian@FreeBSD.org> | 2001-11-01 02:17:49 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2001-11-01 02:17:49 +0000 |
commit | 143281f43cace3898ad507032ecdf11155114dc0 (patch) | |
tree | 7fdc0117c2168cd2335f5237e79c6f8eebb4c924 /sys/conf/Makefile.pc98 | |
parent | 37397b32c9698c609ebdabb375fe4b37929d7136 (diff) |
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.
Notes
Notes:
svn path=/head/; revision=85797
Diffstat (limited to 'sys/conf/Makefile.pc98')
-rw-r--r-- | sys/conf/Makefile.pc98 | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98 index 9990506e90ed..6237801ab0d5 100644 --- a/sys/conf/Makefile.pc98 +++ b/sys/conf/Makefile.pc98 @@ -237,13 +237,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 \ |