Bug 199054 - freebsd-update should use /boot/kernel.old and not kernel.old1
Summary: freebsd-update should use /boot/kernel.old and not kernel.old1
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 9.3-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2015-03-30 22:33 UTC by Walter von Entferndt
Modified: 2017-08-10 14:54 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Walter von Entferndt 2015-03-30 22:33:34 UTC
After 'freebsd-update' the old kernel saved in /boot/kernel.old1 and not /kernel.old, but kernel/old1 is not in the boot loader's menu by default.  Thus one can't go back after an update in case something went wrong.

FreeBSD paul-lifebook.local.lan 9.3-RELEASE-p10 FreeBSD 9.3-RELEASE-p10 #0: Tue Feb 24 21:28:03 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
(I booted kernel.old after update)

have /boot/kernel.old and issue 'freebsd-update'

Add this line to /boot/loader.conf:
kernels="kernel kernel.old kernel.old1"
Comment 1 Ed Maste freebsd_committer 2017-08-10 14:53:57 UTC
Note that FreeBSD-update first tries kernel.old, then kernel.old1 etc.:

# We could not use current directory name, so add counter to
# the end and try again.
CNT=$((CNT + 1))
if [ $CNT -gt 9 ]; then
        echo "Could not find valid backup dir ($BASEDIR/$BACKUPKERNELDIR)"
        exit 1
BACKUPKERNELDIR="`echo $BACKUPKERNELDIR | sed -Ee 's/[0-9]\$//'`"

Allan has some WIP to automatically determine the available kernel list; this problem will likely be solved with that work.