]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/reboot/nextboot.8
loader: zfs should support bootonce an nextboot
[FreeBSD/FreeBSD.git] / sbin / reboot / nextboot.8
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 September 19, 2020
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
42 The
43 .Nm
44 utility allows specifying some combination of an alternate kernel, boot flags
45 and kernel environment for the
46 next time the machine is booted.
47 Once the
48 .Xr loader 8
49 loads in the new kernel
50 information, it is deleted so in case the new kernel hangs the machine,
51 once it is rebooted, the machine will automatically revert to its previous
52 configuration.
53 .Pp
54 The options are as follows:
55 .Bl -tag -width ".Fl o Ar options"
56 .It Fl a
57 This option causes
58 .Nm
59 to append to an existing configuration in
60 .Pa /boot/nextboot.conf .
61 By default any existing configuration is overwritten.
62 .It Fl D
63 Invoking
64 .Nm
65 with this
66 option removes an existing
67 .Nm
68 configuration.
69 .It Fl e Ar variable=value
70 This option adds the provided variable and value to the kernel environment.
71 The value is quoted when written to the
72 .Nm
73 configuration.
74 .It Fl f
75 This
76 option disables the sanity checking which checks if the kernel really exists
77 before writing the
78 .Nm
79 configuration.
80 .It Fl k Ar kernel
81 This option specifies a kernel directory relative to
82 .Pa /boot
83 to load the kernel and any modules from.
84 .It Fl o Ar options
85 This option
86 allows 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
91 The configuration file that the
92 .Nm
93 configuration is written into.
94 .El
95 .Sh EXAMPLES
96 To boot the
97 .Pa GENERIC
98 kernel with the
99 .Nm
100 command:
101 .Pp
102 .Dl "nextboot -k GENERIC"
103 .Pp
104 To enable into single user mode with the normal kernel:
105 .Pp
106 .Dl "nextboot -o ""-s"" -k kernel"
107 .Pp
108 To remove an existing nextboot configuration:
109 .Pp
110 .Dl "nextboot -D"
111 .Sh SEE ALSO
112 .Xr boot 8 ,
113 .Xr loader 8
114 .Sh HISTORY
115 The original
116 .Nm
117 manual page first appeared in
118 .Fx 2.2 .
119 It used a very different interface to achieve similar results.
120 .Pp
121 The current incarnation of
122 .Nm
123 appeared in
124 .Fx 5.0 .
125 .Sh AUTHORS
126 This manual page was written by
127 .An Gordon Tetlow Aq Mt gordon@FreeBSD.org .
128 .Sh BUGS
129 The
130 .Nm
131 code is implemented in the
132 .Xr loader 8 .
133 It is not the most thoroughly tested code.
134 It is also my first attempt to write in Forth.
135 .Pp
136 Finally, it does some evil things like writing to the file system before it
137 has been checked.
138 If it scrambles your file system, do not blame me.