xref: /freebsd/sbin/reboot/nextboot.8 (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
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 March 29, 2022
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 af
36.Op Fl e Ar variable=value
37.Op Fl k Ar kernel
38.Op Fl o Ar options
39.Nm
40.Fl D
41.Sh DESCRIPTION
42The
43.Nm
44utility allows specifying some combination of an alternate kernel, boot
45flags, and kernel environment for the next time the machine is booted.
46Once the
47.Xr loader 8
48loads in the new kernel information from the
49.Pa /boot/nextboot.conf
50file, it is disabled so in case the new kernel hangs the machine, once
51it is rebooted, the machine will automatically revert to its previous
52configuration.
53.Pp
54The options are as follows:
55.Bl -tag -width ".Fl o Ar options"
56.It Fl a
57This option causes
58.Nm
59to append to an existing configuration in
60.Pa /boot/nextboot.conf .
61By default any existing configuration is overwritten.
62.It Fl D
63Invoking
64.Nm
65with this
66option removes an existing
67.Nm
68configuration.
69.It Fl e Ar variable=value
70This option adds the provided variable and value to the kernel environment.
71The value is quoted when written to the
72.Nm
73configuration.
74.It Fl f
75This
76option disables the sanity checking which checks if the kernel really exists
77before writing the
78.Nm
79configuration.
80.It Fl k Ar kernel
81This option specifies a kernel directory relative to
82.Pa /boot
83to load the kernel and any modules from.
84.It Fl o Ar options
85This option
86allows the passing of kernel flags for the next boot.
87.El
88.Sh FILES
89.Bl -tag -width ".Pa /boot/nextboot.conf" -compact
90.It Pa /boot/nextboot.conf
91The configuration file that the
92.Nm
93configuration is written into.
94.El
95.Sh EXAMPLES
96To boot the
97.Pa GENERIC
98kernel with the
99.Nm
100command:
101.Pp
102.Dl "nextboot -k GENERIC"
103.Pp
104To enable into single user mode with the normal kernel:
105.Pp
106.Dl "nextboot -o ""-s"" -k kernel"
107.Pp
108To remove an existing nextboot configuration:
109.Pp
110.Dl "nextboot -D"
111.Sh SEE ALSO
112.Xr boot 8 ,
113.Xr freebsd-update 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