From bdea3adca698d000989df190c8535655d01b6b2b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 10 Jul 2018 00:01:14 +0000 Subject: [PATCH] Tweak documentation to RB_ constants to reflect current use RB_ASKNAME is no longer instructions to the boot loader to request a prompt for which kernel to boot. Instead, it asks for what the root file system to use. RB_INITNAME is unused, and never has been in FreeBSD as far as I can tell. Remove it from the documentation and fix comment. RB_SELFTEST and RB_MINIROOT likewise (though they were completely undocumented). These last three constants can likely just be deleted as nothing references them (even to set useless bits). RB_ASKNAME doesn't actually survive reboot, however, so needs to be communicated to the bootloader via other means. If the bootloader sets it, though, it will be honored. --- lib/libc/sys/reboot.2 | 22 +++++----------------- sys/sys/reboot.h | 8 ++++---- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/lib/libc/sys/reboot.2 b/lib/libc/sys/reboot.2 index 3629070c60d1..99d5dcc42808 100644 --- a/lib/libc/sys/reboot.2 +++ b/lib/libc/sys/reboot.2 @@ -28,7 +28,7 @@ .\" @(#)reboot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 24, 2017 +.Dd July 10, 2018 .Dt REBOOT 2 .Os .Sh NAME @@ -58,18 +58,13 @@ options, defined in the include file .In sys/reboot.h , to be passed to the new kernel or the new bootstrap and init programs. -.Bl -tag -width RB_INITNAMEA +.Bl -tag -width RB_POWERCYCLE .It Dv RB_AUTOBOOT The default, causing the system to reboot in its usual fashion. .It Dv RB_ASKNAME -Interpreted by the bootstrap program itself, causing it to -prompt on the console as to what file should be booted. -Normally, the system is booted from the file -.Dq Ar xx Ns No (0,0)kernel , -where -.Ar xx -is the default disk name, -without prompting for the file name. +Normally the system only prompts the user if the loader specified root +file system has an error. +This flag forces it to always prompt the user for the root partition. .It Dv RB_DFLTROOT Use the compiled in root device. Normally, the system uses the device from which it was booted @@ -96,13 +91,6 @@ driver implements this feature. After halting, the shutdown code will do what it can to turn off the power. This requires hardware support. -.It Dv RB_INITNAME -An option allowing the specification of an init program (see -.Xr init 8 ) -other than -.Pa /sbin/init -to be run when the system reboots. -This switch is not currently available. .It Dv RB_KDB Load the symbol table and enable a built-in debugger in the system. This option will have no useful function if the kernel is not configured diff --git a/sys/sys/reboot.h b/sys/sys/reboot.h index d0dff6098c22..7668642fe1b4 100644 --- a/sys/sys/reboot.h +++ b/sys/sys/reboot.h @@ -41,23 +41,23 @@ */ #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ -#define RB_ASKNAME 0x001 /* ask for file name to reboot from */ +#define RB_ASKNAME 0x001 /* force prompt of device of root filesystem */ #define RB_SINGLE 0x002 /* reboot to single user only */ #define RB_NOSYNC 0x004 /* dont sync before reboot */ #define RB_HALT 0x008 /* don't reboot, just halt */ -#define RB_INITNAME 0x010 /* name given for /etc/init (unused) */ +#define RB_INITNAME 0x010 /* Unused placeholder to specify init path */ #define RB_DFLTROOT 0x020 /* use compiled-in rootdev */ #define RB_KDB 0x040 /* give control to kernel debugger */ #define RB_RDONLY 0x080 /* mount root fs read-only */ #define RB_DUMP 0x100 /* dump kernel memory before reboot */ -#define RB_MINIROOT 0x200 /* mini-root present in memory at boot time */ +#define RB_MINIROOT 0x200 /* Unused placeholder */ #define RB_VERBOSE 0x800 /* print all potentially useful info */ #define RB_SERIAL 0x1000 /* use serial port as console */ #define RB_CDROM 0x2000 /* use cdrom as root */ #define RB_POWEROFF 0x4000 /* turn the power off if possible */ #define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */ #define RB_MUTE 0x10000 /* start up with the console muted */ -#define RB_SELFTEST 0x20000 /* don't complete the boot; do selftest */ +#define RB_SELFTEST 0x20000 /* unused placeholder */ #define RB_RESERVED1 0x40000 /* reserved for internal use of boot blocks */ #define RB_RESERVED2 0x80000 /* reserved for internal use of boot blocks */ #define RB_PAUSE 0x100000 /* pause after each output line during probe */