BOOTHOWTO(9)
πΈ NAME πΈ
okay so welcome to BOOTHOWTO(9), straight outta the Kernel Developer's Manual π The icons here are boothowto and BOOT_FLAG, and they're literally all about flags passed to the kernel during boot or shutdown. periodt.
β¨ SYNOPSIS β¨
#include <sys/reboot.h>
#include <sys/systm.h>
extern int boothowto;
#include <sys/boot_flag.h>
#define BOOT_FLAG(arg, retval) ...
π DESCRIPTION π
The boothowto variable is lowkey a little bag of flags that the boot loader hands to the kernel (see boot(8)), or that come in through the reboot(2) system call. The value is interpreted as a bit mask, with bits defined by the RB_* and AB_* symbols in <sys/reboot.h>. It's also made available via the sysctl(7) variable kern.boothowto. iykyk.
The BOOT_FLAG macro lives in <sys/boot_flag.h>, and lots of boot loaders use it to turn command line options into boothowto flags. Note that not all boot loaders use this macro, and some boot loaders may have incompatible options. so like... vibe check your boot loader, bestie.
Where possible, flags set by the reboot(2) system call will be passed to the new kernel after a reboot; the extent to which this is possible is machine dependent.
The lists below give each flag's symbolic name, the corresponding numeric value defined in <sys/reboot.h>, and the BOOT_FLAG option letter (if any) understood by the macro. obsessed with a complete inventory, honestly.
π Flags that affect booting or shutting down π
The following flags affect actions taken during system boot or shutdown.
RB_AUTOBOOTβ value0βBOOT_FLAGletter: none β The default if no other flags are set. Causes the system to boot in the normal way.RB_ASKNAMEβ value0x00000001βBOOT_FLAGletter:-aβ This flag causes various parts of the system to prompt:- The boot loader may prompt for the name or location of the kernel to be booted.
- The kernel will prompt for the root file system device.
- The kernel will prompt for the root file system type.
- The kernel will prompt for the location of the dump device.
- The kernel will prompt for the path to the
init(8)program.
Some subsystems set this flag when they are unable to automatically make a decision.
RB_SINGLEβ value0x00000002βBOOT_FLAGletter:-sβ Boot in single-user mode. If this flag is set, the kernel passes the-soption toinit(8).RB_NOSYNCβ value0x00000004βBOOT_FLAGletter: none β If this flag is set, then some parts of the shutdown process will be less graceful than usual:- Disks will not be synced (see
sync(2)andcpu_reboot(9)). - Devices will not be detached (see
autoconf(9)). - File systems will not be unmounted (see
cpu_reboot(9), andvfs_shutdown(9)). - The time of day clock will not be set (see
resettodr(9)).
- Disks will not be synced (see
RB_HALTβ value0x00000008βBOOT_FLAGletter:-bβ If this flag is set, thenreboot(2)will cause the system to halt instead of rebooting. This flag may be set at boot time, and cannot be cleared byreboot(2).RB_INITNAMEβ value0x00000010βBOOT_FLAGletter: none β This flag is obsolete. It was previously used to cause the kernel to prompt for the name of theinit(8)program, but that function is now controlled by theRB_ASKNAMEflag.RB_KDBβ value0x00000040βBOOT_FLAGletter:-dβ Gives control to a kernel debugger early in the boot sequence. Seeddb(4)andoptions KGDBinoptions(4).RB_RDONLYβ value0x00000080βBOOT_FLAGletter: none β This flag is deprecated. It previously caused the kernel to mount the root file system in read-only mode, but now that is the default, and this flag has no effect.RB_DUMPβ value0x00000100βBOOT_FLAGletter: none β Causes the kernel to dump memory to the dump device during shutdown. Seesavecore(8),cpu_reboot(9), anddumpsys(9).RB_MINIROOTβ value0x00000200βBOOT_FLAGletter:-mβ This flag informs the kernel that a mini-root file system is present in memory. Seemd(4), andmdsetimage(8).RB_STRINGβ value0x00000400βBOOT_FLAGletter: none β This flag indicates that a boot string is present. The string may be provided byreboot(2)and will be passed to the boot loader if possible.RB_POWERDOWNβ value(RB_HALT|0x800)βBOOT_FLAGletter: none β This flag is used in conjunction withRB_HALT. If this flag is set, then the system will be powered down if possible. If powerdown is not supported, then the system will halt.RB_USERCONFβ value0x00001000βBOOT_FLAGletter:-cβ This flag causes the kernel to invoke theuserconf(4)device configuration manager early in the boot sequence.
π Flags that affect verbosity π
The following flags affect the verbosity of messages printed by the kernel. These flags are used by several functions described in kprintf(9) to control whether output is sent to the console, the system log, both, or neither.
β οΈ bestie, this part matters: the use of flags that increase verbosity simultaneously with the use of flags that decrease verbosity is not well defined. like, don't mix and match and expect a clean vibe.
AB_NORMALβ value0βBOOT_FLAGletter: none β The default, if none of the otherAB_*flags is set, is that ordinary kernel messages are sent both to the console and to the system log.AB_QUIETβ value0x00010000βBOOT_FLAGletter:-qβ Boot quietly. Ordinary kernel messages are sent to the system log, but not to the console. Messages printed withaprint_naive(9)are sent to the console, but not to the system log.AB_VERBOSEβ value0x00020000βBOOT_FLAGletter:-vβ Boot verbosely. Some messages will be printed that would otherwise not be printed. Both ordinary kernel messages, and messages printed withaprint_verbose(9), will be sent both to the console and to the system log. If this flag is not set, then messages printed withaprint_verbose(9)will be sent only to the system log.AB_SILENTβ value0x00040000βBOOT_FLAGletter:-zβ Boot silently. Most kernel messages will be sent only to the system log, not to the console. Theaprint_*()functions display a spinning symbol on the console.AB_DEBUGβ value0x00080000βBOOT_FLAGletter:-xβ Boot with debug messages.
π¦ Machine-dependent flags π¦
The following flags have machine-dependent meanings.
RB_MD1β value0x10000000βBOOT_FLAGletter:-1β Some ports use this flag to disable multiprocessor mode, making them use only a single CPU. The zaurus port uses this flag to enable the serial console.RB_MD2β value0x20000000βBOOT_FLAGletter:-2β The i386 and amd64 ports use this flag to disableacpi(4).RB_MD3β value0x40000000βBOOT_FLAGletter:-3β This flag is currently not used by any ports.RB_MD4β value0x80000000βBOOT_FLAGletter:-4β This flag is currently not used by any ports.
π SEE ALSO π
okay bestie, go read: reboot(2), ddb(4), userconf(4), sysctl(7), boot(8), crash(8), init(8), reboot(8), savecore(8), sync(8), cpu_reboot(9), kprintf(9).
π HISTORY π
The boothowto variable appeared in 4.0BSD. The BOOT_FLAG macro appeared in NetBSD 1.6.
The RB_DFLTROOT option is now obsolete.
this iconic little page was brought to you by Debian, dated July 14, 2018, and it's literally BOOTHOWTO(9) β mwah π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2009 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms