Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164960644
D18933.id53117.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18933.id53117.diff
View Options
Index: usr.sbin/freebsd-update/freebsd-update.sh
===================================================================
--- usr.sbin/freebsd-update/freebsd-update.sh
+++ usr.sbin/freebsd-update/freebsd-update.sh
@@ -689,7 +689,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # If a non-default bootloader is being used the bootfile, "/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
@@ -831,7 +836,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # If a non-default bootloader is being used the bootfile, "/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
@@ -925,7 +935,12 @@
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
KERNELDIR=${BOOTFILE%/kernel}
- if ! [ -d ${KERNELDIR} ]; then
+ # If a non-default bootloader is being used the bootfile, "/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
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 6, 3:22 AM (2 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36068496
Default Alt Text
D18933.id53117.diff (1 KB)
Attached To
Mode
D18933: Ensure kernel.bootfile is a real file
Attached
Detach File
Event Timeline
Log In to Comment