Question About Tracking the Stable Branch

Freddie Cash fjwcash at
Tue Aug 28 21:12:18 UTC 2012

On Tue, Aug 28, 2012 at 2:03 PM, Kevin Oberman <kob6558 at> wrote:
> In all cases, if you rebuild the kernel, be sure that the old kernel
> is saved to kernel.old so you can go back to it if there si a problem.
> 'make installkernel' does this) and, should you fix a problem and
> re-link the kernel, be sure NOT to overwrite the working kernel ('make
> reinstallkernel' does this.

It's not mentioned often on the lists, but KODIR and nextboot(8) are
wonderful things:
  # make <whatever options> buildworld
  # make KERNCONF=MYKERNEL <whatever other options> buildkernel
  # make KERNCONF=MYKERNEL KODIR=/boot/MYKERNEL <whatever other
options> installkernel
  # nextboot -k MYKERNEL
  # shutdown -r now

That will install your new kernel into /boot/MYKERNEL, leaving
/boot/kernel alone.  nextboot configures the boot process to use
/boot/MYKERNEL, again leaving /boot/kernel along.  If anything goes
wrong, a simple reboot of the box returns you to using /boot/kernel as

If the new kernel works correctly, then you can manually copy/moves
things around as needed:
  # mv /boot/kernel /boot/kernel.old
  # cp -Rvp /boot/MYKERNEL /boot/kernel

Especially useful when testing new kernels on remote systems, as "hit
the reset switch" on a locked up box puts things back to the way they
were before.  No loader commands required.  :)

Freddie Cash
fjwcash at

More information about the freebsd-stable mailing list