xref: /netbsd-src/share/man/man9/boothowto.9 (revision b1c86f5f087524e68db12794ee9c3e3da1ab17a0)
1.\"	$NetBSD: boothowto.9,v 1.6 2010/02/25 17:15:55 wiz Exp $
2.\"
3.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd September 11, 2009
28.Dt BOOTHOWTO 9
29.Os
30.Sh NAME
31.Nm boothowto ,
32.Nm BOOT_FLAG
33.Nd flags passed to kernel during boot or shutdown
34.Sh SYNOPSIS
35.In sys/reboot.h
36.In sys/systm.h
37.Vt extern int boothowto;
38.In sys/boot_flag.h
39.Vt #define BOOT_FLAG(arg, retval) ...
40.Sh DESCRIPTION
41The
42.Va boothowto
43variable contains flags passed to the kernel by the boot loader (see
44.Xr boot 8 ) ,
45or the
46.Xr reboot 2
47system call.
48The value is interpreted as a bit mask, with bits defined by the
49.Dq Sy RB_ Ns No *
50and
51.Dq Sy AB_ Ns No *
52symbols in
53.In sys/reboot.h .
54The value is made available via the
55.Xr sysctl 7
56variable
57.Va kern.boothowto .
58.Pp
59The
60.Dv BOOT_FLAG
61macro defined in
62.In sys/boot_flag.h
63is used by many boot loaders to convert command line options into
64.Va boothowto
65flags.
66Note that not all boot loaders use this macro, and some boot loaders
67may have incompatible options.
68.Pp
69Where possible, flags set by the
70.Xr reboot 2
71system call will be passed to the new kernel after a reboot;
72the extent to which this is possible is machine dependent.
73.Pp
74In the following tables,
75each flag is listed with
76its symbolic name,
77the corresponding numeric value defined in
78.In sys/reboot.h ,
79and the option letter (if any) understood by the
80.Dv BOOT_FLAG
81macro.
82.
83.Ss Flags that affect booting or shutting down
84The following flags affect actions taken during system boot
85or shutdown.
86.Bl -column RB_INITNAMEA 0x00000000 \&-x
87.It Dv RB_AUTOBOOT Ta Li 0 Ta Ta
88The default if no other flags are set.
89Causes the system to boot in the normal way.
90.It Dv RB_ASKNAME Ta Li 0x00000001 Ta Fl a Ta
91This flag causes various parts of the system to prompt:
92.Bl -bullet -compact
93.It
94The boot loader may prompt for the name or location of the
95kernel to be booted.
96.It
97The kernel will prompt for the root file system device.
98.It
99The kernel will prompt for the root file system type.
100.It
101The kernel will prompt for the location of the dump device.
102.It
103The kernel will prompt for the path to the
104.Xr init 8
105program.
106.El
107Some subsystems set this flag when they are unable to automatically
108make a decision.
109.It Dv RB_SINGLE Ta Li 0x00000002 Ta Fl s Ta
110Boot in single-user mode.
111If this flag is set, the kernel passes the
112.Fl s
113option to
114.Xr init 8 .
115.It Dv RB_NOSYNC Ta Li 0x00000004 Ta Ta
116If this flag is set, then some parts of the shutdown process will
117be less graceful than usual:
118.Bl -bullet -compact
119.It
120Disks will not be synced
121(see
122.Xr sync 2
123and
124.Xr cpu_reboot 9 ) .
125.It
126Devices will not be detached (see
127.Xr autoconf 9 ) .
128.\" actually, see config_detach_all, but that is undocumented
129.It
130File systems will not be unmounted (see
131.Xr cpu_reboot 9 ,
132and
133.Xr vfs_shutdown 9 ) .
134.It
135The time of day clock will not be set (see
136.Xr resettodr 9 ) .
137.El
138.It Dv RB_HALT Ta Li 0x00000008 Ta Fl b Ta
139If this flag is set, then
140.Xr reboot 2
141will cause the system to halt instead of rebooting.
142This flag may be set at boot time, and cannot be cleared by
143.Xr reboot 2 .
144.It Dv RB_INITNAME Ta Li 0x00000010 Ta Ta
145This flag is obsolete.
146It was previously used to cause the kernel to prompt for the name of the
147.Xr init 8
148program, but that function is now controlled by the
149.Dv RB_ASKNAME
150flag.
151.It Dv RB_KDB Ta Li 0x00000040 Ta Fl d Ta
152Gives control to a kernel debugger early in the boot sequence.
153See
154.Xr ddb 4 ,
155.Dq "options KGDB"
156in
157.Xr options 4 ,
158.\" the kgdb_* functions are undocumented
159and
160.Xr ipkdb 9 .
161.It Dv RB_RDONLY Ta Li 0x00000080 Ta Ta
162This flag is deprecated.
163It previously caused the kernel to mount the root file system
164in read-only mode, but now that is the default, and this flag
165has no effect.
166.It Dv RB_DUMP Ta Li 0x00000100 Ta Ta
167Causes the kernel to dump memory to the dump device during shutdown.
168See
169.Xr savecore 8 ,
170.Xr cpu_reboot 9 ,
171and
172.Xr dumpsys 9 .
173.It Dv RB_MINIROOT Ta Li 0x00000200 Ta Fl m Ta
174This flag informs the kernel that a mini-root file system is present
175in memory.
176See
177.Xr md 4 ,
178and
179.Xr mdsetimage 8 .
180.It Dv RB_STRING Ta Li 0x00000400 Ta Ta
181This flag indicates that a boot string is present.
182The string may be provided by
183.Xr reboot 2
184and will be passed to the boot loader if possible.
185.It Dv RB_POWERDOWN Ta Li (RB_HALT|0x800) Ta Ta
186This flag is used in conjunction with
187.Dv RB_HALT .
188If this flag is set, then then system will be powered down if possible.
189If powerdown is not supported, then the system will halt.
190.It Dv RB_USERCONF Ta Li 0x00001000 Ta Fl c Ta
191This flag causes the kernel to invoke the
192.Xr userconf 4
193device configuration manager early in the boot sequence.
194.El
195.
196.Ss Flags that affect verbosity
197The following flags affect the verbosity of messages printed by the kernel.
198These flags are used by several functions described in
199.Xr kprintf 9
200to control whether output is sent to the console, the system log,
201.\" the /dev/log device driver is undocumented
202both, or neither.
203The use of flags that increase verbosity simultaneously with
204the use of flags that decrease verbosity,
205is not well defined.
206.Bl -column RB_INITNAMEA 0x00000000 \&-x
207.It Dv AB_NORMAL Ta Li 0 Ta Ta
208The default, if none of the other
209.Dv AB_*
210flags is set, is that ordinary kernel messages are sent
211both to the console and to the system log.
212.It Dv AB_QUIET Ta Li 0x00010000 Ta Fl q Ta
213Boot quietly.
214Ordinary kernel messages are sent to the system log,
215but not to the console.
216Messages printed with
217.Xr aprint_naive 9
218are sent to the console, but not to the system log.
219.It Dv AB_VERBOSE Ta Li 0x00020000 Ta Fl v Ta
220Boot verbosely.
221Some messages will be printed that would otherwise not be printed.
222Both ordinary kernel messages, and messages printed with
223.Xr aprint_verbose 9 ,
224will be sent both to the console and to the system log.
225If this flag is not set, then messages printed with
226.Xr aprint_verbose 9
227will be sent only to the system log.
228.It Dv AB_SILENT Ta Li 0x00040000 Ta Fl z Ta
229Boot silently.
230Most kernel messages will be sent only to the system log, not to the console.
231The
232.Fn aprint_*
233functions display a spinning symbol on the console.
234.It Dv AB_DEBUG Ta Li 0x00080000 Ta Fl x Ta
235Boot with debug messages.
236.El
237.
238.Ss Machine-dependent flags
239The following flags have machine-dependent meanings.
240.Bl -column RB_INITNAMEA 0x00000000 \&-x
241.It Dv RB_MD1 Ta Li 0x10000000 Ta Fl 1 Ta
242Some ports use this flag to disable multiprocessor mode,
243making them use only a single CPU.
244The zaurus port uses this flag to enable the serial console.
245.It Dv RB_MD2 Ta Li 0x20000000 Ta Fl 2 Ta
246The i386 and amd64 ports use this flag to disable
247.Xr acpi 4 .
248.It Dv RB_MD3 Ta Li 0x40000000 Ta Fl 3 Ta
249This flag is currently not used by any ports.
250.It Dv RB_MD4 Ta Li 0x80000000 Ta Fl 4 Ta
251This flag is currently not used by any ports.
252.El
253.
254.Sh SEE ALSO
255.\" sets boothowto
256.Xr reboot 2 ,
257.\" RB_KDB
258.Xr ddb 4 ,
259.\" RB_USERCONF
260.Xr userconf 4 ,
261.\" sysctl kern.boothowto
262.Xr sysctl 7 ,
263.\" sets boothowto
264.Xr boot 8 ,
265.Xr crash 8 ,
266.\" RB_SINGLE, RB_INITNAME
267.Xr init 8 ,
268.\" reboot/poweroff/halt calls reboot(2)
269.Xr reboot 8 ,
270.\" useful after RB_DUMP
271.Xr savecore 8 ,
272.\" RB_NOSYNC
273.Xr sync 8 ,
274.\" RB_NOSYNC, RB_HALT, RB_DUMP
275.Xr cpu_reboot 9 ,
276.\" aprint_*() functions use AB_* flags
277.Xr kprintf 9
278.Sh HISTORY
279The
280.Va boothowto
281variable appeared in
282.Bx 4.0 .
283The
284.Sy BOOT_FLAG
285macro appeared in
286.Nx 1.6 .
287.Pp
288The
289.Dv RB_DFLTROOT
290option is now
291.Em obsolete .
292