Page MenuHomeFreeBSD

D18933.diff
No OneTemporary

D18933.diff

Index: usr.sbin/freebsd-update/freebsd-update.sh
===================================================================
--- usr.sbin/freebsd-update/freebsd-update.sh
+++ usr.sbin/freebsd-update/freebsd-update.sh
@@ -690,7 +690,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # With old kernels, "/kernel" may be returned by sysctl.
+ # In this case, assume the default location.
+ KERNELDIR=${KERNELDIR:-/boot/kernel}
+
+ if ! [ -d ${KERNELDIR} ] ||
+ ! [ -f ${KERNELDIR}/${BOOTFILE} ]; then
echo "Cannot identify running kernel"
exit 1
fi
@@ -833,7 +838,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # With old kernels, "/kernel" may be returned by sysctl.
+ # In this case, assume the default location.
+ KERNELDIR=${KERNELDIR:-/boot/kernel}
+
+ if ! [ -d ${KERNELDIR} ] ||
+ ! [ -f ${KERNELDIR}/${BOOTFILE} ]; then
echo "Cannot identify running kernel"
exit 1
fi
@@ -927,7 +937,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # With old kernels, "/kernel" may be returned by sysctl.
+ # In this case, assume the default location.
+ KERNELDIR=${KERNELDIR:-/boot/kernel}
+
+ if ! [ -d ${KERNELDIR} ] ||
+ ! [ -f ${KERNELDIR}/${BOOTFILE} ]; then
echo "Cannot identify running kernel"
exit 1
fi

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 12, 12:42 PM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23623543
Default Alt Text
D18933.diff (1 KB)

Event Timeline