1 .\" $NetBSD: boothowto.9,v 1.4 2009/09/11 19:44:03 wiz Exp $
3 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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.
27 .Dd September 11, 2009
33 .Nd flags passed to kernel during boot or shutdown
37 .Vt extern int boothowto;
39 .Vt #define BOOT_FLAG(arg, retval) ...
43 variable contains flags passed to the kernel by the boot loader (see
48 The value is interpreted as a bit mask, with bits defined by the
54 The value is made available via the
63 is used by many boot loaders to convert command line options into
66 Note that not all boot loaders use this macro, and some boot loaders
67 may have incompatible options.
69 Where possible, flags set by the
71 system call will be passed to the new kernel after a reboot;
72 the extent to which this is possible is machine dependent.
74 In the following tables,
75 each flag is listed with
77 the corresponding numeric value defined in
79 and the option letter (if any) understood by the
83 .Ss Flags that affect booting or shutting down
84 The following flags affect actions taken during system boot
86 .Bl -column RB_INITNAMEA 0x00000000 \&-x
87 .It Dv RB_AUTOBOOT Ta Li 0 Ta Ta
88 The default if no other flags are set.
89 Causes the system to boot in the normal way.
90 .It Dv RB_ASKNAME Ta Li 0x00000001 Ta Fl a Ta
91 This flag causes various parts of the system to prompt:
94 The boot loader may prompt for the name or location of the
97 The kernel will prompt for the root file system device.
99 The kernel will prompt for the root file system type.
101 The kernel will prompt for the location of the dump device.
103 The kernel will prompt for the path to the
107 Some subsystems set this flag when they are unable to automatically
109 .It Dv RB_SINGLE Ta Li 0x00000002 Ta Fl s Ta
110 Boot in single-user mode.
111 If this flag is set, the kernel passes the
115 .It Dv RB_NOSYNC Ta Li 0x00000004 Ta Ta
116 If this flag is set, then some parts of the shutdown process will
117 be less graceful than usual:
120 Disks will not be synced
126 Devices will not be detached (see
128 .\" actually, see config_detach_all, but that is undocumented
130 File systems will not be unmounted (see
133 .Xr vfs_shutdown 9 ) .
135 The time of day clock will not be set (see
138 .It Dv RB_HALT Ta Li 0x00000008 Ta Fl b Ta
139 If this flag is set, then
141 will cause the system to halt instead of rebooting.
142 This flag may be set at boot time, and cannot be cleared by
144 .It Dv RB_INITNAME Ta Li 0x00000010 Ta Ta
145 This flag is obsolete.
146 It was previously used to cause the kernel to prompt for the name of the
148 program, but that function is now controlled by the
151 .It Dv RB_KDB Ta Li 0x00000040 Ta Fl d Ta
152 Gives control to a kernel debugger early in the boot sequence.
158 .\" the kgdb_* functions are undocumented
161 .It Dv RB_RDONLY Ta Li 0x00000080 Ta Ta
162 This flag is deprecated.
163 It previously caused the kernel to mount the root file system
164 in read-only mode, but now that is the default, and this flag
166 .It Dv RB_DUMP Ta Li 0x00000100 Ta Ta
167 Causes the kernel to dump memory to the dump device during shutdown.
173 .It Dv RB_MINIROOT Ta Li 0x00000200 Ta Fl m Ta
174 This flag informs the kernel that a mini-root file system is present
180 .It Dv RB_STRING Ta Li 0x00000400 Ta Ta
181 This flag indicates that a boot string is present.
182 The string may be provided by
184 and will be passed to the boot loader if possible.
185 .It Dv RB_POWERDOWN Ta Li (RB_HALT|0x800) Ta Ta
186 This flag is used in conjunction with
188 If this flag is set, then then system will be powered down if possible.
189 If powerdown is not supported, then the system will halt.
190 .It Dv RB_USERCONF Ta Li 0x00001000 Ta Fl c Ta
191 This flag causes the kernel to invoke the
193 device configuration manager early in the boot sequence.
196 .Ss Flags that affect verbosity
197 The following flags affect the verbosity of messages printed by the kernel.
198 These flags are used by several functions described in
200 to control whether output is sent to the console, the system log,
201 .\" the /dev/log device driver is undocumented
203 The use of flags that increase verbosity simultaneously with
204 the use of flags that decrease verbosity,
206 .Bl -column RB_INITNAMEA 0x00000000 \&-x
207 .It Dv AB_NORMAL Ta Li 0 Ta Ta
208 The default, if none of the other
210 flags is set, is that ordinary kernel messages are sent
211 both to the console and to the system log.
212 .It Dv AB_QUIET Ta Li 0x00010000 Ta Fl q Ta
214 Ordinary kernel messages are sent to the system log,
215 but not to the console.
216 Messages printed with
218 are sent to the console, but not to the system log.
219 .It Dv AB_VERBOSE Ta Li 0x00020000 Ta Fl v Ta
221 Some messages will be printed that would otherwise not be printed.
222 Both ordinary kernel messages, and messages printed with
223 .Xr aprint_verbose 9 ,
224 will be sent both to the console and to the system log.
225 If this flag is not set, then messages printed with
227 will be sent only to the system log.
228 .It Dv AB_SILENT Ta Li 0x00040000 Ta Fl z Ta
230 Most kernel messages will be sent only to the system log, not to the console.
233 functions display a spinning symbol on the console.
234 .It Dv AB_DEBUG Ta Li 0x00080000 Ta Fl x Ta
235 Boot with debug messages.
238 .Ss Machine-dependent flags
239 The 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
242 Some ports use this flag to disable multiprocessor mode,
243 making them use only a single CPU.
244 The zaurus port uses this flag to enable the serial console.
245 .It Dv RB_MD2 Ta Li 0x20000000 Ta Fl 2 Ta
246 The i386 and amd64 ports use this flag to disable
248 .It Dv RB_MD3 Ta Li 0x40000000 Ta Fl 3 Ta
249 This flag is currently not used by any ports.
250 .It Dv RB_MD4 Ta Li 0x80000000 Ta Fl 4 Ta
251 This flag is currently not used by any ports.
261 .\" sysctl kern.boothowto
266 .\" RB_SINGLE, RB_INITNAME
268 .\" reboot/poweroff/halt calls reboot(2)
270 .\" useful after RB_DUMP
274 .\" RB_NOSYNC, RB_HALT, RB_DUMP
276 .\" aprint_*() functions use AB_* flags