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.
This commit is contained in:
Brian Somers 2001-11-01 02:17:49 +00:00
parent 37397b32c9
commit 143281f43c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85797
6 changed files with 84 additions and 42 deletions

View File

@ -276,13 +276,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 \

View File

@ -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 \

View File

@ -246,13 +246,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 \

View File

@ -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 \

View File

@ -243,13 +243,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 \

View File

@ -251,13 +251,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 \