1.\" Copyright (c) 2002 Gordon Tetlow 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd April 9, 2016 28.Dt NEXTBOOT 8 29.Os 30.Sh NAME 31.Nm nextboot 32.Nd "specify an alternate kernel and boot flags for the next reboot" 33.Sh SYNOPSIS 34.Nm 35.Op Fl a 36.Op Fl e Ar variable=value 37.Op Fl f 38.Op Fl k Ar kernel 39.Op Fl o Ar options 40.Nm 41.Fl D 42.Sh DESCRIPTION 43The 44.Nm 45utility allows specifying some combination of an alternate kernel, boot flags 46and kernel environment for the 47next time the machine is booted. 48Once the 49.Xr loader 8 50loads in the new kernel 51information, it is deleted so in case the new kernel hangs the machine, 52once it is rebooted, the machine will automatically revert to its previous 53configuration. 54.Pp 55The options are as follows: 56.Bl -tag -width ".Fl o Ar options" 57.It Fl a 58This option causes 59.Nm 60to append to an existing configuration in 61.Pa /boot/nextboot.conf . 62By default any existing configuration is overwritten. 63.It Fl D 64Invoking 65.Nm 66with this 67option removes an existing 68.Nm 69configuration. 70.It Fl e Ar variable=value 71This option adds the provided variable and value to the kernel environment. 72The value is quoted when written to the 73.Nm 74configuration. 75.It Fl f 76This 77option disables the sanity checking which checks if the kernel really exists 78before writing the 79.Nm 80configuration. 81.It Fl k Ar kernel 82This option specifies a kernel directory relative to 83.Pa /boot 84to load the kernel and any modules from. 85.It Fl o Ar options 86This option 87allows the passing of kernel flags for the next boot. 88.El 89.Sh FILES 90.Bl -tag -width ".Pa /boot/nextboot.conf" -compact 91.It Pa /boot/nextboot.conf 92The configuration file that the 93.Nm 94configuration is written into. 95.El 96.Sh EXAMPLES 97To boot the 98.Pa GENERIC 99kernel with the 100.Nm 101command: 102.Pp 103.Dl "nextboot -k GENERIC" 104.Pp 105To enable into single user mode with the normal kernel: 106.Pp 107.Dl "nextboot -o ""-s"" -k kernel" 108.Pp 109To remove an existing nextboot configuration: 110.Pp 111.Dl "nextboot -D" 112.Sh SEE ALSO 113.Xr boot 8 , 114.Xr loader 8 115.Sh HISTORY 116The original 117.Nm 118manual page first appeared in 119.Fx 2.2 . 120It used a very different interface to achieve similar results. 121.Pp 122The current incarnation of 123.Nm 124appeared in 125.Fx 5.0 . 126.Sh AUTHORS 127This manual page was written by 128.An Gordon Tetlow Aq Mt gordon@FreeBSD.org . 129.Sh BUGS 130The 131.Nm 132code is implemented in the 133.Xr loader 8 . 134It is not the most thoroughly tested code. 135It is also my first attempt to write in Forth. 136.Pp 137Finally, it does some evil things like writing to the file system before it 138has been checked. 139If it scrambles your file system, do not blame me. 140.Pp 141.Xr loader 8 142is only able to read ZFS, not write to it. 143.Pa nextboot.conf 144will NOT be reset in case of a kernel boot failure. 145