summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/boot/Makefile.version2
-rw-r--r--usr/src/boot/lib/libstand/libstand.3676
-rw-r--r--usr/src/boot/sys/boot/common/multiboot2.c344
-rw-r--r--usr/src/man/man4/Makefile1
-rw-r--r--usr/src/man/man4/loader.conf.4 (renamed from usr/src/boot/sys/boot/forth/loader.conf.5)198
-rw-r--r--usr/src/man/man5/Makefile12
-rw-r--r--usr/src/man/man5/beastie.4th.5 (renamed from usr/src/boot/sys/boot/forth/beastie.4th.8)72
-rw-r--r--usr/src/man/man5/brand.4th.5 (renamed from usr/src/boot/sys/boot/forth/brand.4th.8)57
-rw-r--r--usr/src/man/man5/check-password.4th.5 (renamed from usr/src/boot/sys/boot/forth/check-password.4th.8)75
-rw-r--r--usr/src/man/man5/color.4th.5 (renamed from usr/src/boot/sys/boot/forth/color.4th.8)41
-rw-r--r--usr/src/man/man5/delay.4th.5 (renamed from usr/src/boot/sys/boot/forth/delay.4th.8)47
-rw-r--r--usr/src/man/man5/gptzfsboot.5 (renamed from usr/src/boot/sys/boot/i386/gptzfsboot/gptzfsboot.8)146
-rw-r--r--usr/src/man/man5/loader.4th.5 (renamed from usr/src/boot/sys/boot/forth/loader.4th.8)79
-rw-r--r--usr/src/man/man5/loader.5 (renamed from usr/src/boot/sys/boot/common/loader.8)604
-rw-r--r--usr/src/man/man5/menu.4th.5 (renamed from usr/src/boot/sys/boot/forth/menu.4th.8)84
-rw-r--r--usr/src/man/man5/menusets.4th.5 (renamed from usr/src/boot/sys/boot/forth/menusets.4th.8)55
-rw-r--r--usr/src/man/man5/pxeboot.5 (renamed from usr/src/boot/sys/boot/i386/pxeldr/pxeboot.8)57
-rw-r--r--usr/src/man/man5/version.4th.5 (renamed from usr/src/boot/sys/boot/forth/version.4th.8)43
-rw-r--r--usr/src/man/man5/zfsloader.5 (renamed from usr/src/boot/sys/boot/common/zfsloader.8)51
-rw-r--r--usr/src/pkg/manifests/developer-build-onbld.mf1
-rw-r--r--usr/src/pkg/manifests/system-boot-loader.mf17
-rw-r--r--usr/src/tools/btxld/Makefile8
-rw-r--r--usr/src/tools/btxld/btxld.1onbld (renamed from usr/src/tools/btxld/btxld.8)10
23 files changed, 727 insertions, 1953 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version
index 132d1eb155..4f0316219d 100644
--- a/usr/src/boot/Makefile.version
+++ b/usr/src/boot/Makefile.version
@@ -33,4 +33,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
-BOOT_VERSION = $(LOADER_VERSION)-2017.4.23.2
+BOOT_VERSION = $(LOADER_VERSION)-2017.4.23.3
diff --git a/usr/src/boot/lib/libstand/libstand.3 b/usr/src/boot/lib/libstand/libstand.3
deleted file mode 100644
index 42289c1bce..0000000000
--- a/usr/src/boot/lib/libstand/libstand.3
+++ /dev/null
@@ -1,676 +0,0 @@
-.\" Copyright (c) Michael Smith
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd August 6, 2004
-.Dt LIBSTAND 3
-.Os
-.Sh NAME
-.Nm libstand
-.Nd support library for standalone executables
-.Sh SYNOPSIS
-.In stand.h
-.Sh DESCRIPTION
-The
-.Nm
-library provides a set of supporting functions for standalone
-applications, mimicking where possible the standard
-.Bx
-programming
-environment.
-The following sections group these functions by kind.
-Unless specifically described here, see the corresponding section 3
-manpages for the given functions.
-.Sh STRING FUNCTIONS
-String functions are available as documented in
-.Xr string 3
-and
-.Xr bstring 3 .
-.Sh MEMORY ALLOCATION
-.Bl -hang -width 10n
-.It Xo
-.Ft "void *"
-.Fn malloc "size_t size"
-.Xc
-.Pp
-Allocate
-.Fa size
-bytes of memory from the heap using a best-fit algorithm.
-.It Xo
-.Ft void
-.Fn free "void *ptr"
-.Xc
-.Pp
-Free the allocated object at
-.Fa ptr .
-.It Xo
-.Ft void
-.Fn setheap "void *start" "void *limit"
-.Xc
-.Pp
-Initialise the heap.
-This function must be called before calling
-.Fn alloc
-for the first time.
-The region between
-.Fa start
-and
-.Fa limit
-will be used for the heap; attempting to allocate beyond this will result
-in a panic.
-.It Xo
-.Ft "char *"
-.Fn sbrk "int junk"
-.Xc
-.Pp
-Provides the behaviour of
-.Fn sbrk 0 ,
-i.e., returns the highest point that the heap has reached.
-This value can
-be used during testing to determine the actual heap usage.
-The
-.Fa junk
-argument is ignored.
-.El
-.Sh ENVIRONMENT
-A set of functions are provided for manipulating a flat variable space similar
-to the traditional shell-supported environment.
-Major enhancements are support
-for set/unset hook functions.
-.Bl -hang -width 10n
-.It Xo
-.Ft "char *"
-.Fn getenv "const char *name"
-.Xc
-.It Xo
-.Ft int
-.Fn setenv "const char *name" "const char *value" "int overwrite"
-.Xc
-.It Xo
-.Ft int
-.Fn putenv "const char *string"
-.Xc
-.It Xo
-.Ft int
-.Fn unsetenv "const char *name"
-.Xc
-.Pp
-These functions behave similarly to their standard library counterparts.
-.It Xo
-.Ft "struct env_var *"
-.Fn env_getenv "const char *name"
-.Xc
-.Pp
-Looks up a variable in the environment and returns its entire
-data structure.
-.It Xo
-.Ft int
-.Fn env_setenv "const char *name" "int flags" "const void *value" "ev_sethook_t sethook" "ev_unsethook_t unsethook"
-.Xc
-.Pp
-Creates a new or sets an existing environment variable called
-.Fa name .
-If creating a new variable, the
-.Fa sethook
-and
-.Fa unsethook
-arguments may be specified.
-.Pp
-The set hook is invoked whenever an attempt
-is made to set the variable, unless the EV_NOHOOK flag is set.
-Typically
-a set hook will validate the
-.Fa value
-argument, and then call
-.Fn env_setenv
-again with EV_NOHOOK set to actually save the value.
-The predefined function
-.Fn env_noset
-may be specified to refuse all attempts to set a variable.
-.Pp
-The unset hook is invoked when an attempt is made to unset a variable.
-If it
-returns zero, the variable will be unset.
-The predefined function
-.Fa env_nounset
-may be used to prevent a variable being unset.
-.El
-.Sh STANDARD LIBRARY SUPPORT
-.Bl -hang -width 10n
-.It Xo
-.Ft int
-.Fn getopt "int argc" "char * const *argv" "const char *optstring"
-.Xc
-.It Xo
-.Ft long
-.Fn strtol "const char *nptr" "char **endptr" "int base"
-.Xc
-.It Xo
-.Ft void
-.Fn srandom "unsigned long seed"
-.Xc
-.It Xo
-.Ft "unsigned long"
-.Fn random void
-.Xc
-.It Xo
-.Ft "char *"
-.Fn strerror "int error"
-.Xc
-.Pp
-Returns error messages for the subset of errno values supported by
-.Nm .
-.It Fn assert expression
-.Pp
-Requires
-.In assert.h .
-.It Xo
-.Ft int
-.Fn setjmp "jmp_buf env"
-.Xc
-.It Xo
-.Ft void
-.Fn longjmp "jmp_buf env" "int val"
-.Xc
-.Pp
-Defined as
-.Fn _setjmp
-and
-.Fn _longjmp
-respectively as there is no signal state to manipulate.
-Requires
-.In setjmp.h .
-.El
-.Sh CHARACTER I/O
-.Bl -hang -width 10n
-.It Xo
-.Ft void
-.Fn gets "char *buf"
-.Xc
-.Pp
-Read characters from the console into
-.Fa buf .
-All of the standard cautions apply to this function.
-.It Xo
-.Ft void
-.Fn ngets "char *buf" "int size"
-.Xc
-.Pp
-Read at most
-.Fa size
-- 1 characters from the console into
-.Fa buf .
-If
-.Fa size
-is less than 1, the function's behaviour is as for
-.Fn gets .
-.It Xo
-.Ft int
-.Fn fgetstr "char *buf" "int size" "int fd"
-.Xc
-.Pp
-Read a line of at most
-.Fa size
-characters into
-.Fa buf .
-Line terminating characters are stripped, and the buffer is always
-.Dv NUL
-terminated.
-Returns the number of characters in
-.Fa buf
-if successful, or -1 if a read error occurs.
-.It Xo
-.Ft int
-.Fn printf "const char *fmt" "..."
-.Xc
-.It Xo
-.Ft void
-.Fn vprintf "const char *fmt" "va_list ap"
-.Xc
-.It Xo
-.Ft int
-.Fn sprintf "char *buf" "const char *fmt" "..."
-.Xc
-.It Xo
-.Ft void
-.Fn vsprintf "char *buf" "const char *fmt" "va_list ap"
-.Xc
-.Pp
-The *printf functions implement a subset of the standard
-.Fn printf
-family functionality and some extensions.
-The following standard conversions
-are supported: c,d,n,o,p,s,u,x.
-The following modifiers are supported:
-+,-,#,*,0,field width,precision,l.
-.Pp
-The
-.Li b
-conversion is provided to decode error registers.
-Its usage is:
-.Bd -ragged -offset indent
-printf(
-.Qq reg=%b\en ,
-regval,
-.Qq <base><arg>*
-);
-.Ed
-.Pp
-where <base> is the output expressed as a control character, e.g.\& \e10 gives
-octal, \e20 gives hex.
-Each <arg> is a sequence of characters, the first of
-which gives the bit number to be inspected (origin 1) and the next characters
-(up to a character less than 32) give the text to be displayed if the bit is set.
-Thus
-.Bd -ragged -offset indent
-printf(
-.Qq reg=%b\en ,
-3,
-.Qq \e10\e2BITTWO\e1BITONE
-);
-.Ed
-.Pp
-would give the output
-.Bd -ragged -offset indent
-reg=3<BITTWO,BITONE>
-.Ed
-.Pp
-The
-.Li D
-conversion provides a hexdump facility, e.g.
-.Bd -ragged -offset indent
-printf(
-.Qq %6D ,
-ptr,
-.Qq \&:
-); gives
-.Qq XX:XX:XX:XX:XX:XX
-.Ed
-.Bd -ragged -offset indent
-printf(
-.Qq %*D ,
-len,
-ptr,
-.Qq "\ "
-); gives
-.Qq XX XX XX ...
-.Ed
-.El
-.Sh CHARACTER TESTS AND CONVERSIONS
-.Bl -hang -width 10n
-.It Xo
-.Ft int
-.Fn isupper "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn islower "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn isspace "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn isdigit "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn isxdigit "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn isascii "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn isalpha "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn toupper "int c"
-.Xc
-.It Xo
-.Ft int
-.Fn tolower "int c"
-.Xc
-.El
-.Sh FILE I/O
-.Bl -hang -width 10n
-.It Xo
-.Ft int
-.Fn open "const char *path" "int flags"
-.Xc
-.Pp
-Similar to the behaviour as specified in
-.Xr open 2 ,
-except that file creation is not supported, so the mode parameter is not
-required.
-The
-.Fa flags
-argument may be one of O_RDONLY, O_WRONLY and O_RDWR (although no file systems
-currently support writing).
-.It Xo
-.Ft int
-.Fn close "int fd"
-.Xc
-.It Xo
-.Ft void
-.Fn closeall void
-.Xc
-.Pp
-Close all open files.
-.It Xo
-.Ft ssize_t
-.Fn read "int fd" "void *buf" "size_t len"
-.Xc
-.It Xo
-.Ft ssize_t
-.Fn write "int fd" "void *buf" "size_t len"
-.Xc
-.Pp
-(No file systems currently support writing.)
-.It Xo
-.Ft off_t
-.Fn lseek "int fd" "off_t offset" "int whence"
-.Xc
-.Pp
-Files being automatically uncompressed during reading cannot seek backwards
-from the current point.
-.It Xo
-.Ft int
-.Fn stat "const char *path" "struct stat *sb"
-.Xc
-.It Xo
-.Ft int
-.Fn fstat "int fd" "struct stat *sb"
-.Xc
-.Pp
-The
-.Fn stat
-and
-.Fn fstat
-functions only fill out the following fields in the
-.Fa sb
-structure: st_mode,st_nlink,st_uid,st_gid,st_size.
-The
-.Nm tftp
-file system cannot provide meaningful values for this call, and the
-.Nm cd9660
-file system always reports files having uid/gid of zero.
-.El
-.Sh PAGER
-The
-.Nm
-library supplies a simple internal pager to ease reading the output of large
-commands.
-.Bl -hang -width 10n
-.It Xo
-.Ft void
-.Fn pager_open
-.Xc
-.Pp
-Initialises the pager and tells it that the next line output will be the top of the
-display.
-The environment variable LINES is consulted to determine the number of
-lines to be displayed before pausing.
-.It Xo
-.Ft void
-.Fn pager_close void
-.Xc
-.Pp
-Closes the pager.
-.It Xo
-.Ft int
-.Fn pager_output "const char *lines"
-.Xc
-.Pp
-Sends the lines in the
-.Dv NUL Ns
--terminated buffer at
-.Fa lines
-to the pager.
-Newline characters are counted in order to determine the number
-of lines being output (wrapped lines are not accounted for).
-The
-.Fn pager_output
-function will return zero when all of the lines have been output, or nonzero
-if the display was paused and the user elected to quit.
-.It Xo
-.Ft int
-.Fn pager_file "const char *fname"
-.Xc
-.Pp
-Attempts to open and display the file
-.Fa fname .
-Returns -1 on error, 0 at EOF, or 1 if the user elects to quit while reading.
-.El
-.Sh MISC
-.Bl -hang -width 10n
-.It Xo
-.Ft void
-.Fn twiddle void
-.Xc
-.Pp
-Successive calls emit the characters in the sequence |,/,-,\\ followed by a
-backspace in order to provide reassurance to the user.
-.El
-.Sh REQUIRED LOW-LEVEL SUPPORT
-The following resources are consumed by
-.Nm
-- stack, heap, console and devices.
-.Pp
-The stack must be established before
-.Nm
-functions can be invoked.
-Stack requirements vary depending on the functions
-and file systems used by the consumer and the support layer functions detailed
-below.
-.Pp
-The heap must be established before calling
-.Fn alloc
-or
-.Fn open
-by calling
-.Fn setheap .
-Heap usage will vary depending on the number of simultaneously open files,
-as well as client behaviour.
-Automatic decompression will allocate more
-than 64K of data per open file.
-.Pp
-Console access is performed via the
-.Fn getchar ,
-.Fn putchar
-and
-.Fn ischar
-functions detailed below.
-.Pp
-Device access is initiated via
-.Fn devopen
-and is performed through the
-.Fn dv_strategy ,
-.Fn dv_ioctl
-and
-.Fn dv_close
-functions in the device switch structure that
-.Fn devopen
-returns.
-.Pp
-The consumer must provide the following support functions:
-.Bl -hang -width 10n
-.It Xo
-.Ft int
-.Fn getchar void
-.Xc
-.Pp
-Return a character from the console, used by
-.Fn gets ,
-.Fn ngets
-and pager functions.
-.It Xo
-.Ft int
-.Fn ischar void
-.Xc
-.Pp
-Returns nonzero if a character is waiting from the console.
-.It Xo
-.Ft void
-.Fn putchar int
-.Xc
-.Pp
-Write a character to the console, used by
-.Fn gets ,
-.Fn ngets ,
-.Fn *printf ,
-.Fn panic
-and
-.Fn twiddle
-and thus by many other functions for debugging and informational output.
-.It Xo
-.Ft int
-.Fn devopen "struct open_file *of" "const char *name" "const char **file"
-.Xc
-.Pp
-Open the appropriate device for the file named in
-.Fa name ,
-returning in
-.Fa file
-a pointer to the remaining body of
-.Fa name
-which does not refer to the device.
-The
-.Va f_dev
-field in
-.Fa of
-will be set to point to the
-.Vt devsw
-structure for the opened device if successful.
-Device identifiers must
-always precede the path component, but may otherwise be arbitrarily formatted.
-Used by
-.Fn open
-and thus for all device-related I/O.
-.It Xo
-.Ft int
-.Fn devclose "struct open_file *of"
-.Xc
-.Pp
-Close the device allocated for
-.Fa of .
-The device driver itself will already have been called for the close; this call
-should clean up any allocation made by devopen only.
-.It Xo
-.Ft void
-.Fn panic "const char *msg" "..."
-.Xc
-.Pp
-Signal a fatal and unrecoverable error condition.
-The
-.Fa msg ...
-arguments are as for
-.Fn printf .
-.El
-.Sh INTERNAL FILE SYSTEMS
-Internal file systems are enabled by the consumer exporting the array
-.Vt struct fs_ops *file_system[] ,
-which should be initialised with pointers
-to
-.Vt struct fs_ops
-structures.
-The following file system handlers are supplied by
-.Nm ,
-the consumer may supply other file systems of their own:
-.Bl -hang -width ".Va cd9660_fsops"
-.It Va ufs_fsops
-The
-.Bx
-UFS.
-.It Va ext2fs_fsops
-Linux ext2fs file system.
-.It Va tftp_fsops
-File access via TFTP.
-.It Va nfs_fsops
-File access via NFS.
-.It Va cd9660_fsops
-ISO 9660 (CD-ROM) file system.
-.It Va gzipfs_fsops
-Stacked file system supporting gzipped files.
-When trying the gzipfs file system,
-.Nm
-appends
-.Li .gz
-to the end of the filename, and then tries to locate the file using the other
-file systems.
-Placement of this file system in the
-.Va file_system[]
-array determines whether gzipped files will be opened in preference to non-gzipped
-files.
-It is only possible to seek a gzipped file forwards, and
-.Fn stat
-and
-.Fn fstat
-on gzipped files will report an invalid length.
-.It Va bzipfs_fsops
-The same as
-.Va gzipfs_fsops ,
-but for
-.Xr bzip2 1 Ns -compressed
-files.
-.El
-.Pp
-The array of
-.Vt struct fs_ops
-pointers should be terminated with a NULL.
-.Sh DEVICES
-Devices are exported by the supporting code via the array
-.Vt struct devsw *devsw[]
-which is a NULL terminated array of pointers to device switch structures.
-.Sh HISTORY
-The
-.Nm
-library contains contributions from many sources, including:
-.Bl -bullet -compact
-.It
-.Nm libsa
-from
-.Nx
-.It
-.Nm libc
-and
-.Nm libkern
-from
-.Fx 3.0 .
-.It
-.Nm zalloc
-from
-.An Matthew Dillon Aq Mt dillon@backplane.com
-.El
-.Pp
-The reorganisation and port to
-.Fx 3.0 ,
-the environment functions and this manpage were written by
-.An Mike Smith Aq Mt msmith@FreeBSD.org .
-.Sh BUGS
-The lack of detailed memory usage data is unhelpful.
diff --git a/usr/src/boot/sys/boot/common/multiboot2.c b/usr/src/boot/sys/boot/common/multiboot2.c
index fa9775ea32..74f6e9c4cd 100644
--- a/usr/src/boot/sys/boot/common/multiboot2.c
+++ b/usr/src/boot/sys/boot/common/multiboot2.c
@@ -19,6 +19,7 @@
* not support xen.
*/
#include <sys/cdefs.h>
+#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/exec.h>
@@ -303,122 +304,6 @@ out:
}
/*
- * Since for now we have no way to pass the environment to the kernel other than
- * through arguments, we need to take care of console setup.
- *
- * If the console is in mirror mode, set the kernel console from $os_console.
- * If it's unset, use first item from $console.
- * If $console is "ttyX", also pass $ttyX-mode, since it may have been set by
- * the user.
- *
- * In case of memory allocation errors, just return the original command line
- * so we have a chance of booting.
- *
- * On success, cl will be freed and a new, allocated command line string is
- * returned.
- */
-static char *
-update_cmdline(char *cl)
-{
- char *os_console = getenv("os_console");
- char *ttymode = NULL;
- char mode[10];
- char *tmp;
- int len;
-
- if (os_console == NULL) {
- tmp = strdup(getenv("console"));
- os_console = strsep(&tmp, ", ");
- } else {
- os_console = strdup(os_console);
- }
-
- if (os_console == NULL)
- return (cl);
-
- if (strncmp(os_console, "tty", 3) == 0) {
- snprintf(mode, sizeof (mode), "%s-mode", os_console);
- ttymode = getenv(mode); /* We will never get NULL. */
- }
-
- if (strstr(cl, "-B") != NULL) {
- len = strlen(cl) + 1;
- /*
- * If console is not present, add it.
- * If console is ttyX, add ttymode.
- */
- tmp = strstr(cl, "console");
- if (tmp == NULL) {
- len += 12; /* " -B console=" */
- len += strlen(os_console);
- if (ttymode != NULL) {
- len += 13; /* ",ttyX-mode=\"\"" */
- len += strlen(ttymode);
- }
- tmp = malloc(len);
- if (tmp == NULL) {
- free(os_console);
- return (cl);
- }
- if (ttymode != NULL) {
- snprintf(tmp, len,
- "%s -B console=%s,%s-mode=\"%s\"",
- cl, os_console, os_console, ttymode);
- } else {
- snprintf(tmp, len, "%s -B console=%s",
- cl, os_console);
- }
- } else {
- /* console is set, do we need tty mode? */
- tmp += 8;
- if (strstr(tmp, "tty") == tmp) {
- strncpy(mode, tmp, 4);
- mode[4] = '\0';
- strncat(mode, "-mode", 5);
- ttymode = getenv(mode);
- } else { /* nope */
- free(os_console);
- return (cl);
- }
- len = strlen(cl) + 1;
- len += 13; /* ",ttyX-mode=\"\"" */
- len += strlen(ttymode);
- tmp = malloc(len);
- if (tmp == NULL) {
- free(os_console);
- return (cl);
- }
- snprintf(tmp, len, "%s,%s=\"%s\"", cl, mode, ttymode);
- }
- } else {
- /*
- * no -B, so we need to add " -B console=%s[,ttyX-mode=\"%s\"]"
- */
- len = strlen(cl) + 1;
- len += 12; /* " -B console=" */
- len += strlen(os_console);
- if (ttymode != NULL) {
- len += 13; /* ",ttyX-mode=\"\"" */
- len += strlen(ttymode);
- }
- tmp = malloc(len);
- if (tmp == NULL) {
- free(os_console);
- return (cl);
- }
- if (ttymode != NULL) {
- snprintf(tmp, len, "%s -B console=%s,%s-mode=\"%s\"",
- cl, os_console, os_console, ttymode);
- } else {
- snprintf(tmp, len, "%s -B console=%s", cl, os_console);
- }
- }
- free(os_console);
- free(cl);
- return (tmp);
-}
-
-/*
* Search the command line for named property.
*
* Return codes:
@@ -505,17 +390,194 @@ find_property_value(const char *cmd, const char *name, const char **value,
}
/*
+ * If command line has " -B ", insert property after "-B ", otherwise
+ * append to command line.
+ */
+static char *
+insert_cmdline(const char *head, const char *prop)
+{
+ const char *prop_opt = " -B ";
+ char *cmdline, *tail;
+ int len = 0;
+
+ tail = strstr(head, prop_opt);
+ if (tail != NULL) {
+ ptrdiff_t diff;
+ tail += strlen(prop_opt);
+ diff = tail - head;
+ if (diff >= INT_MAX)
+ return (NULL);
+ len = (int)diff;
+ }
+
+ if (tail == NULL)
+ asprintf(&cmdline, "%s%s%s", head, prop_opt, prop);
+ else
+ asprintf(&cmdline, "%.*s%s,%s", len, head, prop, tail);
+
+ return (cmdline);
+}
+
+/*
+ * Since we have no way to pass the environment to the mb1 kernel other than
+ * through arguments, we need to take care of console setup.
+ *
+ * If the console is in mirror mode, set the kernel console from $os_console.
+ * If it's unset, use first item from $console.
+ * If $console is "ttyX", also pass $ttyX-mode, since it may have been set by
+ * the user.
+ *
+ * In case of memory allocation errors, just return the original command line
+ * so we have a chance of booting.
+ *
+ * On success, cl will be freed and a new, allocated command line string is
+ * returned.
+ *
+ * For the mb2 kernel, we only set command line console if os_console is set.
+ * We can not overwrite console in the environment, as it can disrupt the
+ * loader console messages, and we do not want to deal with the os_console
+ * in the kernel.
+ */
+static char *
+update_cmdline(char *cl, bool mb2)
+{
+ char *os_console = getenv("os_console");
+ char *ttymode = NULL;
+ char mode[10];
+ char *tmp;
+ const char *prop;
+ size_t plen;
+ int rv;
+
+ if (mb2 == true && os_console == NULL)
+ return (cl);
+
+ if (os_console == NULL) {
+ tmp = strdup(getenv("console"));
+ os_console = strsep(&tmp, ", ");
+ } else {
+ os_console = strdup(os_console);
+ }
+
+ if (os_console == NULL)
+ return (cl);
+
+ if (mb2 == false && strncmp(os_console, "tty", 3) == 0) {
+ snprintf(mode, sizeof (mode), "%s-mode", os_console);
+ /*
+ * The ttyX-mode variable is set by our serial console
+ * driver for ttya-ttyd. However, since the os_console
+ * values are not verified, it is possible we get bogus
+ * name and no mode variable. If so, we do not set console
+ * property and let the kernel use defaults.
+ */
+ if ((ttymode = getenv(mode)) == NULL)
+ return (cl);
+ }
+
+ rv = find_property_value(cl, "console", &prop, &plen);
+ if (rv != 0 && rv != ENOENT) {
+ free(os_console);
+ return (cl);
+ }
+
+ /* If console is set and this is MB2 boot, we are done. */
+ if (rv == 0 && mb2 == true) {
+ free(os_console);
+ return (cl);
+ }
+
+ /* If console is set, do we need to set tty mode? */
+ if (rv == 0) {
+ const char *ttyp = NULL;
+ size_t ttylen;
+
+ free(os_console);
+ os_console = NULL;
+ *mode = '\0';
+ if (strncmp(prop, "tty", 3) == 0 && plen == 4) {
+ strncpy(mode, prop, plen);
+ mode[plen] = '\0';
+ strncat(mode, "-mode", 5);
+ find_property_value(cl, mode, &ttyp, &ttylen);
+ }
+
+ if (*mode != '\0' && ttyp == NULL)
+ ttymode = getenv(mode);
+ else
+ return (cl);
+ }
+
+ /* Build updated command line. */
+ if (os_console != NULL) {
+ char *propstr;
+
+ asprintf(&propstr, "console=%s", os_console);
+ free(os_console);
+ if (propstr == NULL) {
+ return (cl);
+ }
+
+ tmp = insert_cmdline(cl, propstr);
+ free(propstr);
+ if (tmp == NULL)
+ return (cl);
+
+ free(cl);
+ cl = tmp;
+ }
+ if (ttymode != NULL) {
+ char *propstr;
+
+ asprintf(&propstr, "%s=\"%s\"", mode, ttymode);
+ if (propstr == NULL)
+ return (cl);
+
+ tmp = insert_cmdline(cl, propstr);
+ free(propstr);
+ if (tmp == NULL)
+ return (cl);
+ free(cl);
+ cl = tmp;
+ }
+
+ return (cl);
+}
+
+/*
* Build the kernel command line. Shared function between MB1 and MB2.
+ *
+ * In both cases, if fstype is set and is not zfs, we do not set up
+ * zfs-bootfs property. But we set kernel file name and options.
+ *
+ * For the MB1, we only can pass properties on command line, so
+ * we will set console, ttyX-mode (for serial console) and zfs-bootfs.
+ *
+ * For the MB2, we can pass properties in environment, but if os_console
+ * is set in environment, we need to add console property on the kernel
+ * command line.
+ *
+ * The console properties are managed in update_cmdline().
*/
int
mb_kernel_cmdline(struct preloaded_file *fp, struct devdesc *rootdev,
char **line)
{
const char *fs = getenv("fstype");
- char *cmdline = NULL;
+ char *cmdline;
size_t len;
bool zfs_root = false;
- int rv = 0;
+ bool mb2;
+ int rv;
+
+ /*
+ * 64-bit kernel has aout header, 32-bit kernel is elf, and the
+ * type strings are different. Lets just search for "multiboot2".
+ */
+ if (strstr(fp->f_type, "multiboot2") == NULL)
+ mb2 = false;
+ else
+ mb2 = true;
if (rootdev->d_type == DEVT_ZFS)
zfs_root = true;
@@ -529,44 +591,36 @@ mb_kernel_cmdline(struct preloaded_file *fp, struct devdesc *rootdev,
* reset zfs_root if needed.
*/
rv = find_property_value(fp->f_args, "fstype", &fs, &len);
- switch (rv) {
- case EINVAL: /* invalid command line */
- default:
+ if (rv != 0 && rv != ENOENT)
return (rv);
- case ENOENT: /* fall through */
- case 0:
- break;
- }
if (fs != NULL && strncmp(fs, "zfs", len) != 0)
zfs_root = false;
- len = strlen(fp->f_name) + 1;
-
- if (fp->f_args != NULL)
- len += strlen(fp->f_args) + 1;
-
+ /* zfs_bootfs() will set the environment, it must be called. */
if (zfs_root == true)
- len += 3 + strlen(zfs_bootfs(rootdev)) + 1;
+ fs = zfs_bootfs(rootdev);
+
+ if (fp->f_args == NULL)
+ cmdline = strdup(fp->f_name);
+ else
+ asprintf(&cmdline, "%s %s", fp->f_name, fp->f_args);
- cmdline = malloc(len);
if (cmdline == NULL)
return (ENOMEM);
- if (zfs_root == true) {
- if (fp->f_args != NULL) {
- snprintf(cmdline, len, "%s %s -B %s", fp->f_name,
- fp->f_args, zfs_bootfs(rootdev));
- } else {
- snprintf(cmdline, len, "%s -B %s", fp->f_name,
- zfs_bootfs(rootdev));
- }
- } else if (fp->f_args != NULL)
- snprintf(cmdline, len, "%s %s", fp->f_name, fp->f_args);
- else
- snprintf(cmdline, len, "%s", fp->f_name);
+ /* Append zfs-bootfs for MB1 command line. */
+ if (mb2 == false && zfs_root == true) {
+ char *tmp;
+
+ tmp = insert_cmdline(cmdline, fs);
+ free(cmdline);
+ if (tmp == NULL)
+ return (ENOMEM);
+ cmdline = tmp;
+ }
- *line = update_cmdline(cmdline);
+ *line = update_cmdline(cmdline, mb2);
return (0);
}
diff --git a/usr/src/man/man4/Makefile b/usr/src/man/man4/Makefile
index ad2b996c45..999bd0f47f 100644
--- a/usr/src/man/man4/Makefile
+++ b/usr/src/man/man4/Makefile
@@ -100,6 +100,7 @@ _MANFILES= Intro.4 \
ldapfilter.conf.4 \
ldapsearchprefs.conf.4 \
ldaptemplates.conf.4 \
+ loader.conf.4 \
logadm.conf.4 \
logindevperm.4 \
loginlog.4 \
diff --git a/usr/src/boot/sys/boot/forth/loader.conf.5 b/usr/src/man/man4/loader.conf.4
index 0320e988cd..dc4a44b5b2 100644
--- a/usr/src/boot/sys/boot/forth/loader.conf.5
+++ b/usr/src/man/man4/loader.conf.4
@@ -22,13 +22,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.Dd January 6, 2016
-.Dt LOADER.CONF 5
+.Dd Apr 20, 2016
+.Dt LOADER.CONF 4
.Os
.Sh NAME
.Nm loader.conf
.Nd "system bootstrap configuration information"
+.Sh SYNOPSIS
+.Nm /boot/loader.conf
.Sh DESCRIPTION
The file
.Nm
@@ -37,7 +38,17 @@ Through
it you can specify the kernel to be booted, parameters to be passed to
it, and additional modules to be loaded; and generally set all variables
described in
-.Xr loader 8 .
+.Xr loader 5 .
+.Pp
+Loader implements set of builtin commands and functions and script
+interpreter as standalone binary program. When starting, the loader will
+read the file
+.Pa /boot/loader.rc
+as initialization and startup script, to include other support files
+and to read the configuration, describing current boot environment.
+All loader scripts and configuration files are located in the
+.Pa /boot
+directory tree.
.Pp
The file
.Pa /boot/loader.rc
@@ -45,24 +56,40 @@ must contain the following two lines for
.Nm
to be automatically processed:
.Pp
-.Dl include /boot/loader.4th
+.Dl include /boot/forth/loader.4th
.Dl start
.Pp
-If no
+The default
.Pa /boot/loader.rc
-exists at installworld time, one with the above lines will be installed.
-.Sh SYNTAX
-Though
-.Nm Ns 's
-format was defined explicitly to resemble
-.Xr rc.conf 5 ,
-and can be sourced by
-.Xr sh 1 ,
-some settings are treated in a special fashion.
-Also, the
-behavior of some settings is defined by the setting's suffix;
-the prefix identifies which module the setting controls.
+is provided by the operating system and may be replaced on operating
+system update. The local updates are advised to be added into the
+.Pa /boot/loader.rc.local
.Pp
+The configuration variables are read from the following files:
+.Bl -tag -width Ar
+.It Ar /boot/solaris/bootenv.rc
+Managed by the
+.Xr eeprom 1M
+command.
+.It Ar /boot/defaults/loader.conf
+Loader defaults provided by the operating system.
+.It Ar /boot/loader.conf
+System specific loader configuration. May be provided by the operating system.
+.It Ar /boot/loader.conf.local
+User editable loader configuration.
+.It Ar /boot/conf.d/*
+User editable loader configuration snippets. The files are proccessed in
+lexicographical order. The configuration snippets mechanism is not
+available in case of TFTP boot as TFTP does not provide the directory list.
+.It Ar /boot/transient.conf
+Configuration file for transient boot. This file is created by the
+.Xr reboot 1M
+command and is automatically removed when system is reaching the multi-user
+run level.
+.El
+.Pp
+The configuration is processed in the order listed above.
+.Ss SYNTAX
The general parsing rules are:
.Bl -bullet
.It
@@ -79,7 +106,7 @@ All settings have the following format:
.Pp
Unless it belongs to one of the classes of settings that receive special
treatment, a setting will set the value of a
-.Xr loader 8
+.Xr loader 5
environment variable.
The settings that receive special
treatment are listed below.
@@ -92,11 +119,11 @@ prefix refer to the same module.
.Bl -tag -width Ar
.It Ar exec
Immediately executes a
-.Xr loader 8
+.Xr loader 5
command.
This type of setting cannot be processed by programs other
than
-.Xr loader 8 ,
+.Xr loader 5 ,
so its use should be avoided.
Multiple instances of it will be processed
independently.
@@ -107,10 +134,7 @@ present file.
Name of the kernel to be loaded.
If no kernel name is set, no additional
modules will be loaded.
-The name must be a subdirectory of
-.Pa /boot
-that contains a kernel.
-.It Ar kernel_options
+.It Ar boot-args
Flags to be passed to the kernel.
.It Ar password
Protect boot menu with a password without interrupting
@@ -162,42 +186,20 @@ special value
.Dq abort ,
which aborts the bootstrap process, use of this setting should be avoided.
.El
-.Pp
-.Em WARNING:
-developers should never use these suffixes for any kernel environment
-variables (tunables) or conflicts will result.
-.Sh DEFAULT SETTINGS
+.Ss DEFAULT SETTINGS
Most of
.Nm Ns 's
default settings can be ignored.
The few of them which are important
or useful are:
.Bl -tag -width bootfile -offset indent
-.It Va bitmap_load
-.Pq Dq NO
-If set to
-.Dq YES ,
-a bitmap will be loaded to be displayed on screen while booting.
-.It Va bitmap_name
-.Pq Dq Pa /boot/splash.bmp
-Name of the bitmap to be loaded.
-Any other name can be used.
-.It Va comconsole_speed
-.Dq ( 9600
-or the value of the
-.Va BOOT_COMCONSOLE_SPEED
-variable when
-.Xr loader 8
-was compiled).
-Sets the speed of the serial console.
-If the previous boot loader stage specified that a serial console
-is in use then the default speed is determined from the current
-serial port speed setting.
.It Va console
-.Pq Dq vidconsole
-.Dq comconsole
+.Pq Dq text
+.Dq ttya
+-
+.Dq ttyd
selects serial console,
-.Dq vidconsole
+.Dq text
selects the video console,
.Dq nullconsole
selects a mute console
@@ -208,98 +210,36 @@ replacing it with
.Dq spinning
character (useful for embedded products and such).
.It Va kernel
-.Pq Dq kernel
-.It Va kernels
-.Pq Dq kernel kernel.old
-Space or comma separated list of kernels to present in the boot menu.
+.Pq Dq i86pc/kernel/${ISADIR}
+.Ar /platform
+sub-directory containing kernel
.It Va loader_conf_files
.Pq Dq Pa /boot/loader.conf /boot/loader.conf.local
-.It Va splash_bmp_load
-.Pq Dq NO
-If set to
-.Dq YES ,
-will load the splash screen module, making it possible to display a bmp image
-on the screen while booting.
-.It Va splash_pcx_load
-.Pq Dq NO
-If set to
-.Dq YES ,
-will load the splash screen module, making it possible to display a pcx image
-on the screen while booting.
-.It Va vesa_load
-.Pq Dq NO
-If set to
-.Dq YES ,
-the vesa module will be loaded, enabling bitmaps above VGA resolution to
-be displayed.
.It Va beastie_disable
If set to
.Dq YES ,
the beastie boot menu will be skipped.
The beastie boot menu is always skipped if running non-x86 hardware.
-.It Va loader_logo Pq Dq Li orbbw
+.It Va loader_logo Pq Dq Li illumos
Selects a desired logo in the beastie boot menu.
-Possible values are:
-.Dq Li orbbw ,
-.Dq Li orb ,
-.Dq Li fbsdbw ,
-.Dq Li beastiebw ,
-.Dq Li beastie ,
-and
-.Dq Li none .
+Possible values depend on distribution;
+.Dq Li none
+will disable the logo.
.It Va loader_color
If set to
.Dq NO ,
the beastie boot menu will be displayed without ANSI coloring.
-.It Va entropy_cache_load
-.Pq Dq YES
-If set to
-.Dq NO ,
-the very early
-boot-time entropy file
-will not be loaded.
-See the entropy entries in
-.Xr rc.conf 5 .
-.It Va entropy_cache_name
-.Pq Dq /boot/entropy
-The name of the very early
-boot-time entropy cache file.
-.El
-.Sh FILES
-.Bl -tag -width /boot/defaults/loader.conf -compact
-.It Pa /boot/defaults/loader.conf
-default settings -- do not change this file.
-.It Pa /boot/loader.4th
-defines the commands used by loader to read and process
-.Nm .
-.It Pa /boot/loader.conf
-user defined settings.
-.It Pa /boot/loader.conf.local
-machine-specific settings for sites with a common loader.conf.
-.It Pa /boot/loader.rc
-contains the instructions to automatically process
-.Nm .
.El
.Sh SEE ALSO
-.Xr rc.conf 5 ,
-.Xr boot 8 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The file
-.Nm
-first appeared in
-.Fx 3.2 .
-.Sh AUTHORS
-This manual page was written by
-.An Daniel C. Sobral Aq dcs@FreeBSD.org .
-.Sh BUGS
+.Xr boot 1M ,
+.Xr eeprom 1M ,
+.Xr loader 5 ,
+.Xr loader.4th 5
+.Sh NOTES
The
-.Xr loader 8
+.Xr loader 5
stops reading
.Nm
when it encounters a syntax error, so any options which are vital for
-booting a particular system (i.e.\&
-.Dq Va hw.ata.ata_dma Ns "=0" )
-should precede any experimental additions to
+booting a particular system should precede any experimental additions to
.Nm .
diff --git a/usr/src/man/man5/Makefile b/usr/src/man/man5/Makefile
index 62a46e52fd..422ce7435f 100644
--- a/usr/src/man/man5/Makefile
+++ b/usr/src/man/man5/Makefile
@@ -29,17 +29,21 @@ MANFILES= Intro.5 \
audit_binfile.5 \
audit_remote.5 \
audit_syslog.5 \
+ brand.4th.5 \
brands.5 \
byteorder.5 \
cancellation.5 \
charmap.5 \
+ check-password.4th.5 \
condition.5 \
+ color.4th.5 \
crypt_bsdbf.5 \
crypt_bsdmd5.5 \
crypt_sha256.5 \
crypt_sha512.5 \
crypt_sunmd5.5 \
crypt_unix.5 \
+ delay.4th.5 \
device_clean.5 \
dhcp.5 \
environ.5 \
@@ -52,6 +56,7 @@ MANFILES= Intro.5 \
fnmatch.5 \
formats.5 \
fsattr.5 \
+ gptzfsboot.5 \
grub.5 \
gss_auth_rules.5 \
hal.5 \
@@ -69,6 +74,8 @@ MANFILES= Intro.5 \
lf64.5 \
lfcompile.5 \
lfcompile64.5 \
+ loader.5 \
+ loader.4th.5 \
locale.5 \
lx.5 \
man.5 \
@@ -78,6 +85,8 @@ MANFILES= Intro.5 \
mdoc.5 \
me.5 \
mech_spnego.5 \
+ menu.4th.5 \
+ menusets.4th.5 \
mm.5 \
ms.5 \
mutex.5 \
@@ -111,6 +120,7 @@ MANFILES= Intro.5 \
pkcs11_tpm.5 \
privileges.5 \
prof.5 \
+ pxeboot.5 \
rbac.5 \
regex.5 \
regexp.5 \
@@ -130,7 +140,9 @@ MANFILES= Intro.5 \
threads.5 \
timerfd.5 \
trusted_extensions.5 \
+ version.4th.5 \
vgrindefs.5 \
+ zfsloader.5 \
zones.5 \
zpool-features.5
diff --git a/usr/src/boot/sys/boot/forth/beastie.4th.8 b/usr/src/man/man5/beastie.4th.5
index 9f77d5db29..8f2f40bd74 100644
--- a/usr/src/boot/sys/boot/forth/beastie.4th.8
+++ b/usr/src/man/man5/beastie.4th.5
@@ -22,27 +22,26 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd January 6, 2016
-.Dt BEASTIE.4TH 8
+.Dd Apr 22, 2017
+.Dt BEASTIE.4TH 5
.Os
.Sh NAME
.Nm beastie.4th
-.Nd FreeBSD ASCII art boot module
+.Nd loader ASCII art boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
is a set of commands designed to draw the ASCII art FreeBSD mascot
.Nd known simply as
.Ic beastie
-.Nd to the right of the boot loader menu.
+.Nd to the right of the boot loader menu. In illumos based systems, the
+distribution specific logo is used.
The commands of
.Nm
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -60,27 +59,19 @@ The commands provided by it are:
.Pp
.Bl -tag -width disable-module_module -compact -offset indent
.It Ic draw-beastie
-Draws the FreeBSD logo.
+Draws the logo.
.Pp
The logo that is drawn is configured by setting the
.Ic loader_logo
variable in
-.Xr loader.conf 5
-to one of
-.Dq Li beastie ,
-.Dq Li beastiebw ,
-.Dq Li fbsdbw ,
-.Dq Li orb ,
-and
-.Dq Li orbbw
-(the default).
+.Xr loader.conf 4 .
.Pp
The position of the logo can be configured by setting the
.Ic loader_logo_x
and
.Ic loader_logo_y
variables in
-.Xr loader.conf 5 .
+.Xr loader.conf 4 .
The default values are 46 (x) and 4 (y).
.Pp
.It Ic clear-beastie
@@ -92,7 +83,7 @@ Initializes the interactive boot loader menu.
The
.Ic loader_delay
variable can be configured in
-.Xr loader.conf 5
+.Xr loader.conf 4
to the number of seconds you would like to delay loading the boot menu.
During the delay the user can press Ctrl-C to fall back to
.Ic autoboot
@@ -103,14 +94,7 @@ The default behavior is to not delay.
The environment variables that effect its behavior are:
.Bl -tag -width bootfile -offset indent
.It Va loader_logo
-Selects the desired logo in the beastie boot menu. Possible values are:
-.Dq Li fbsdbw ,
-.Dq Li beastie ,
-.Dq Li beastiebw ,
-.Dq Li orb ,
-.Dq Li orbbw
-(default), and
-.Dq Li none .
+Selects the desired logo in the beastie boot menu.
.It Va loader_logo_x
Sets the desired column position of the logo. Default is 46.
.It Va loader_logo_y
@@ -127,15 +111,15 @@ the menu or ENTER to proceed to the menu. The default is to not delay when
loading the menu.
.El
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/beastie.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/beastie.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
@@ -143,31 +127,17 @@ Standard i386
.Pa /boot/loader.rc :
.Pp
.Bd -literal -offset indent -compact
-include /boot/beastie.4th
+include /boot/forth/beastie.4th
beastie-start
.Ed
.Pp
Set a different logo in
-.Xr loader.conf 5 :
+.Xr loader.conf 4 :
.Pp
.Bd -literal -offset indent -compact
loader_logo="beastie"
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 5.1 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Scott Long Aq scottl@FreeBSD.org ,
-.An Aleksander Fafula Aq alex@fafula.com
-and
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr loader 5 ,
+.Xr loader.4th 5
diff --git a/usr/src/boot/sys/boot/forth/brand.4th.8 b/usr/src/man/man5/brand.4th.5
index dfd188d0ff..ce74b382a6 100644
--- a/usr/src/boot/sys/boot/forth/brand.4th.8
+++ b/usr/src/man/man5/brand.4th.5
@@ -22,25 +22,23 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd May 18, 2011
-.Dt BRAND.4TH 8
+.Dd Apr 22, 2017
+.Dt BRAND.4TH 5
.Os
.Sh NAME
.Nm brand.4th
-.Nd FreeBSD ASCII art boot module
+.Nd loader ASCII art boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
-is a set of commands designed to draw the ASCII art BSD brand above the boot
-loader menu.
+is a set of commands designed to draw the ASCII art illumos brand above the
+boot loader menu.
The commands of
.Nm
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -51,21 +49,21 @@ through the command:
.Dl include brand.4th
.Pp
This line is present in the default
-.Pa /boot/menu.rc
+.Pa /boot/forth/menu.rc
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
.Pp
.Bl -tag -width disable-module_module -compact -offset indent
.It Ic draw-brand
-Draws the BSD brand.
+Draws the illumos brand.
.Pp
The brand that is drawn is configured by setting the
.Ic loader_brand
variable in
-.Xr loader.conf 5
+.Xr loader.conf 4
to one of
-.Dq Li fbsd
+.Dq Li illumos
(the default) or
.Dq Li none .
.Pp
@@ -74,7 +72,7 @@ The position of the logo can be configured by setting the
and
.Ic loader_brand_y
variables in
-.Xr loader.conf 5 .
+.Xr loader.conf 4 .
The default values are 2 (x) and 1 (y).
.El
.Pp
@@ -82,7 +80,7 @@ The environment variables that effect its behavior are:
.Bl -tag -width bootfile -offset indent
.It Va loader_brand
Selects the desired brand in the beastie boot menu. Possible values are:
-.Dq Li fbsd
+.Dq Li illumos
(default) or
.Dq Li none .
.It Va loader_brand_x
@@ -91,35 +89,24 @@ Sets the desired column position of the brand. Default is 2.
Sets the desired row position of the brand. Default is 1.
.El
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/brand.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/brand.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 4
bootstrapping script.
.El
.Sh EXAMPLES
-Set FreeBSD brand in
-.Xr loader.conf 5 :
+Set illumos brand in
+.Xr loader.conf 4 :
.Pp
.Bd -literal -offset indent -compact
-loader_brand="fbsd"
+loader_brand="illumos"
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr loader 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr loader 5
diff --git a/usr/src/boot/sys/boot/forth/check-password.4th.8 b/usr/src/man/man5/check-password.4th.5
index db0aa4bc6b..3446df9799 100644
--- a/usr/src/boot/sys/boot/forth/check-password.4th.8
+++ b/usr/src/man/man5/check-password.4th.5
@@ -22,14 +22,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd March 20, 2015
-.Dt CHECK-PASSWORD.4TH 8
+.Dd Apr 22, 2017
+.Dt CHECK-PASSWORD.4TH 5
.Os
.Sh NAME
.Nm check-password.4th
-.Nd FreeBSD password-checking boot module
+.Nd loader password-checking boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
@@ -37,14 +35,13 @@ is a set of commands designed to do one or more of the following:
.Pp
.Dl o Prevent booting without password
.Dl o Prevent modification of boot options without password
-.Dl o Provide a password to mount geli(8) encrypted root disk(s)
.Pp
The commands of
.Nm
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -55,7 +52,7 @@ through the command:
.Dl include check-password.4th
.Pp
This line is present in
-.Pa /boot/loader.4th
+.Pa /boot/forth/loader.4th
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -63,28 +60,20 @@ The commands provided by it are:
.Bl -tag -width disable-module_module -compact -offset indent
.It Ic check-password
Multi-purpose function that can protect the interactive boot menu,
-prevent boot without password, or prompt for geli(8) passphrase
-.Pq depending on Xr loader.conf 5 settings .
+prevent boot without password
+.Pq depending on Xr loader.conf 4 settings .
.Pp
First checks
.Va bootlock_password
and if-set, the user cannot continue until the correct password is entered.
.Pp
-Next, checks
-.Va geom_eli_passphrase_prompt
-and if set to
-.Li YES
-.Pq case-insensitive
-prompts the user to enter their GELI password for later mounting of the root
-device(s) during boot.
-.Pp
Last, checks
.Va password
and if-set, tries to
.Ic autoboot
and only prompts for password on failure or user-interrupt.
See
-.Xr loader.conf 5
+.Xr loader.conf 4
for additional information.
.El
.Pp
@@ -94,26 +83,21 @@ The environment variables that effect its behavior are:
Sets the bootlock password (up to 16 characters long) that is required by
.Ic check-password
to be entered before the system is allowed to boot.
-.It Va geom_eli_passphrase_prompt
-Selects whether loader(8) will prompt for GELI credentials, handing-off to the
-kernel for later mounting of
-.Xr geli 8
-encrypted root device(s).
.It Va password
Sets the password (up to 16 characters long) that is required by
.Ic check-password
before the user is allowed to visit the boot menu.
.El
.Sh FILES
-.Bl -tag -width /boot/check-password.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/check-password.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/check-password.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/check-password.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
@@ -121,12 +105,12 @@ Standard i386
.Pa /boot/loader.rc :
.Pp
.Bd -literal -offset indent -compact
-include /boot/loader.4th
+include /boot/forth/loader.4th
check-password
.Ed
.Pp
Set a password in
-.Xr loader.conf 5
+.Xr loader.conf 4
to prevent modification of boot options:
.Pp
.Bd -literal -offset indent -compact
@@ -134,34 +118,13 @@ password="abc123"
.Ed
.Pp
Set a password in
-.Xr loader.conf 5
+.Xr loader.conf 4
to prevent booting without password:
.Pp
.Bd -literal -offset indent -compact
bootlock_password="boot"
.Ed
-.Pp
-Add the following to
-.Xr loader.conf 5
-to generate a prompt at boot to collect GELI credentials for mounting
-.Xr geli 8
-encrypted root device(s):
-.Pp
-.Bd -literal -offset indent -compact
-geom_eli_passphrase_prompt="YES"
-.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr loader 5 ,
+.Xr loader.4th 5
diff --git a/usr/src/boot/sys/boot/forth/color.4th.8 b/usr/src/man/man5/color.4th.5
index 9191da0f04..7031034d3d 100644
--- a/usr/src/boot/sys/boot/forth/color.4th.8
+++ b/usr/src/man/man5/color.4th.5
@@ -22,14 +22,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd August 6, 2013
-.Dt COLOR.4TH 8
+.Dd Apr 22, 2017
+.Dt COLOR.4TH 5
.Os
.Sh NAME
.Nm color.4th
-.Nd FreeBSD color-detection boot module
+.Nd loader color-detection boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
@@ -39,7 +37,7 @@ The commands of
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -50,7 +48,7 @@ through the command:
.Dl include color.4th
.Pp
This line is present in
-.Pa /boot/loader.4th
+.Pa /boot/forth/loader.4th
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -79,20 +77,20 @@ causes
to return FALSE, indicating to many modules that color should not be used.
.El
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/color.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/color.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
Standard i386
-.Pa /boot/loader.rc :
+.Pa /boot/loader.conf :
.Pp
Use color where applicable:
.Pp
@@ -100,17 +98,6 @@ Use color where applicable:
loader_color="YES"
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr loader 5 ,
+.Xr loader.4th 5
diff --git a/usr/src/boot/sys/boot/forth/delay.4th.8 b/usr/src/man/man5/delay.4th.5
index af31fd04ba..4c6da7071d 100644
--- a/usr/src/boot/sys/boot/forth/delay.4th.8
+++ b/usr/src/man/man5/delay.4th.5
@@ -22,25 +22,23 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd May 18, 2011
-.Dt DELAY.4TH 8
+.Dd Apr 22, 2017
+.Dt DELAY.4TH 5
.Os
.Sh NAME
.Nm delay.4th
-.Nd FreeBSD debugging boot module
+.Nd loader debugging boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
is a set of commands designed to add debugging capabilities to
-.Xr loader 8 .
+.Xr loader 5 .
The commands of
.Nm
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -51,7 +49,7 @@ through the command:
.Dl include delay.4th
.Pp
This line is present in
-.Pa /boot/beastie.4th
+.Pa /boot/forth/beastie.4th
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -86,15 +84,15 @@ If set, will cause
to print a continuous series of dots during the delay duration.
.El
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/delay.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/delay.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
@@ -102,25 +100,14 @@ Introducing a 5-second delay before including another file from
.Pa /boot/loader.rc :
.Pp
.Bd -literal -offset indent -compact
-include /boot/delay.4th
-set delay_command="include /boot/other.4th"
+include /boot/forth/delay.4th
+set delay_command="include /boot/forth/other.4th"
set delay_showdots
set loader_delay=5
delay_execute
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr beastie.4th 8 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr beastie.4th 5 ,
+.Xr loader 5 ,
+.Xr loader.4th 5
diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/gptzfsboot.8 b/usr/src/man/man5/gptzfsboot.5
index 66feb6d350..e74ef30d32 100644
--- a/usr/src/boot/sys/boot/i386/gptzfsboot/gptzfsboot.8
+++ b/usr/src/man/man5/gptzfsboot.5
@@ -22,92 +22,81 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd September 15, 2014
-.Dt GPTZFSBOOT 8
+.Dd Apr 21, 2017
+.Dt GPTZFSBOOT 5
.Os
.Sh NAME
.Nm gptzfsboot
-.Nd GPT bootcode for ZFS on BIOS-based computers
+.Nd disk bootcode for BIOS-based computers
.Sh DESCRIPTION
.Nm
-is used on BIOS-based computers to boot from a filesystem in
-a ZFS pool.
+is used on BIOS-based computers to boot from a filesystem on disk device.
+Depending on disk partitioning and boot file system, the
.Nm
is installed in a
-.Cm freebsd-boot
-partition of a GPT-partitioned disk with
-.Xr gpart 8 .
-.Sh IMPLEMENTATION NOTES
+.Cm zfs pool boot area
+or
+.Cm boot
+partition of a disk with
+.Xr installboot 1M .
+.Ss IMPLEMENTATION NOTES
The GPT standard allows a variable number of partitions, but
.Nm
only boots from tables with 128 partitions or less.
-.Sh BOOTING
+.Ss BOOTING
.Nm
tries to find all ZFS pools that are composed of BIOS-visible
hard disks or partitions on them.
.Nm
looks for ZFS device labels on all visible disks and in discovered
supported partitions for all supported partition scheme types.
-The search starts with the disk from which
-.Nm
-itself was loaded.
-Other disks are probed in BIOS defined order.
+Disks are probed in BIOS defined order.
After a disk is probed and
.Nm
determines that the whole disk is not a ZFS pool member, the
individual partitions are probed in their partition table order.
Currently GPT and MBR partition schemes are supported.
-With the GPT scheme, only partitions of type
-.Cm freebsd-zfs
-are probed.
-The first pool seen during probing is used as a default boot pool.
+.Pp
+The default boot partition is recorded into
+.Nm
+binary by
+.Xr installboot 1M
+and the default boot file system is determined at run time.
+.Nm
+does support booting from the
+.Cm ZFS ,
+.Cm UFS
+and
+.Cm PCFS
+file systems.
.Pp
The filesystem specified by the
.Cm bootfs
-property of the pool is used as a default boot filesystem.
+property of the ZFS pool is used as a default boot filesystem.
If the
.Cm bootfs
property is not set, then the root filesystem of the pool is used as
the default.
-.Xr zfsloader 8
+.Xr zfsloader 5
is loaded from the boot filesystem.
If
-.Pa /boot.config
-or
.Pa /boot/config
-is present in the boot filesystem, boot options are read from it
-in the same way as
-.Xr boot 8 .
+is present in the boot filesystem, boot options are read from it.
.Pp
-The ZFS GUIDs of the first successfully probed device and the first
-detected pool are made available to
-.Xr zfsloader 8
-in the
-.Cm vfs.zfs.boot.primary_vdev
-and
-.Cm vfs.zfs.boot.primary_pool
-variables.
-.Sh USAGE
+The ZFS GUIDs of the boot pool and boot file system are made available to
+.Xr zfsloader 8 .
+.Ss USAGE
Normally
.Nm
will boot in fully automatic mode.
-However, like
-.Xr boot 8 ,
-it is possible to interrupt the automatic boot process and interact with
+However, it is possible to interrupt the automatic boot process and
+interact with
.Nm
through a prompt.
-.Nm
-accepts all the options that
-.Xr boot 8
-supports.
.Pp
The filesystem specification and the path to
-.Xr zfsloader 8
-are different from
-.Xr boot 8 .
-The format is
+.Xr zfsloader 5
+is specified as
.Pp
.Sm off
.Oo zfs:pool/filesystem: Oc Oo /path/to/loader Oc
@@ -120,74 +109,49 @@ If only a pool and filesystem are specified, then
is used as a path.
.Pp
Additionally, the
+.Nm
+does support two commands to get information about the system.
+.Ic ?directoryname
+can be used to list the content of named directory and
.Ic status
-command can be used to query information about discovered pools.
-The output format is similar to that of
+command can be used to query information about discovered devices.
+The output format for ZFS pools is similar to that of
.Cm zpool status
-.Pq see Xr zpool 8 .
+.Pq see Xr zpool 1M .
.Pp
The configured or automatically determined ZFS boot filesystem is
stored in the
-.Xr zfsloader 8
+.Xr zfsloader 5
.Cm loaddev
variable, and also set as the initial value of the
.Cm currdev
variable.
.Sh FILES
.Bl -tag -width /boot/gptzfsboot -compact
-.It Pa /boot/gptzfsboot
-boot code binary
-.It Pa /boot.config
-parameters for the boot block
-.Pq optional
.It Pa /boot/config
-alternative parameters for the boot block
+parameters for the boot block
.Pq optional
+.It Pa /boot/gptzfsboot
+boot code binary
.El
.Sh EXAMPLES
.Nm
-is typically installed in combination with a
+is installed in combination with a
.Dq protective MBR
.Po
see
-.Xr gpart 8
+.Xr installboot 1M
.Pc .
To install
.Nm
on the
-.Pa ada0
+.Pa c0t0d0s0
drive:
.Bd -literal -offset indent
-gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
-.Ed
-.Pp
-.Nm
-can also be installed without the PMBR:
-.Bd -literal -offset indent
-gpart bootcode -p /boot/gptzfsboot -i 1 ada0
+installboot /boot/pmbr /boot/gptzfsboot /dev/rdsk/c0t0d0s0
.Ed
.Sh SEE ALSO
-.Xr boot.config 5 ,
-.Xr boot 8 ,
-.Xr gpart 8 ,
-.Xr loader 8 ,
-.Xr zfsloader 8 ,
-.Xr zpool 8
-.Sh HISTORY
-.Nm
-appeared in FreeBSD 7.3.
-.Sh AUTHORS
-This manual page was written by
-.An Andriy Gapon Aq avg@FreeBSD.org .
-.Sh BUGS
-.Nm
-looks for ZFS meta-data only in MBR partitions
-.Pq known on FreeBSD as slices .
-It does not look into BSD
-.Xr disklabel 8
-partitions that are traditionally called partitions.
-If a disklabel partition happens to be placed so that ZFS meta-data can be
-found at the fixed offsets relative to a slice, then
-.Nm
-will recognize the partition as a part of a ZFS pool,
-but this is not guaranteed to happen.
+.Xr installboot 1M ,
+.Xr zpool 1M ,
+.Xr loader 5 ,
+.Xr zfsloader 5
diff --git a/usr/src/boot/sys/boot/forth/loader.4th.8 b/usr/src/man/man5/loader.4th.5
index b689077058..0e6dd01413 100644
--- a/usr/src/boot/sys/boot/forth/loader.4th.8
+++ b/usr/src/man/man5/loader.4th.5
@@ -22,10 +22,8 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd November 13, 2013
-.Dt LOADER.4TH 8
+.Dd Apr 22, 2017
+.Dt LOADER.4TH 5
.Os
.Sh NAME
.Nm loader.4th
@@ -34,7 +32,7 @@
The file that goes by the name of
.Nm
is a set of commands designed to manipulate
-.Xr loader.conf 5
+.Xr loader.conf 4
files.
The default
.Pa /boot/loader.rc
@@ -42,7 +40,7 @@ includes
.Nm
and uses one of its commands to automatically read and process
the standard
-.Xr loader.conf 5
+.Xr loader.conf 4
files.
Other commands exists to help the user specify alternate
configurations.
@@ -52,7 +50,7 @@ The commands of
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -73,7 +71,7 @@ The commands provided by it are:
.It Ic boot Ar directory Op Cm ...
.It Ic boot Fl flag Cm ...
Boot as specified by the
-.Xr loader.conf 5
+.Xr loader.conf 4
files read.
.Pp
Depending on the arguments passed, it can override boot flags and
@@ -93,7 +91,7 @@ so it can be stopped.
Reads
.Pa /boot/defaults/loader.conf ,
all other
-.Xr loader.conf 5
+.Xr loader.conf 4
files specified in it, then loads the desired kernel and modules
.Pq if not already loaded .
After which you can use the
@@ -107,7 +105,7 @@ is not set to NO) to boot the system.
is the command used in the default
.Pa /boot/loader.rc
file
-.Pq see Xr loader 8 .
+.Pq see Xr loader 5 .
.Pp
.It Ic initialize
Initialize the support library so commands can be used without executing
@@ -118,7 +116,7 @@ Like
it reads
.Pa /boot/defaults/loader.conf
and all other
-.Xr loader.conf 5
+.Xr loader.conf 4
files specified in it
.Pq but does not load kernel or modules .
Returns a flag on the stack to indicate
@@ -126,7 +124,7 @@ if any configuration files were successfully loaded.
.Pp
.It Ic read-conf Ar filename
Reads and processes a
-.Xr loader.conf 5
+.Xr loader.conf 4
file.
Does not proceed to boot.
.Pp
@@ -145,18 +143,23 @@ on and off.
.Pp
.It Ic show-module Ar module
Shows the information gathered in the
-.Xr loader.conf 5
+.Xr loader.conf 4
files about the module
.Ar module .
.Pp
+.It Ic show-module-options
+Shows all modules defined in current
+.Xr loader.conf 4
+configuration.
+.Pp
.It Ic retry
Used inside
-.Xr loader.conf 5
+.Xr loader.conf 4
files to specify the action after a module loading fails.
.Pp
.It Ic ignore
Used inside
-.Xr loader.conf 5
+.Xr loader.conf 4
files to specify the action after a module loading fails.
.It Ic try-include Ar file Op Ar
Process script files if they exist.
@@ -167,15 +170,15 @@ command aborts immediately, without reading any other files, and
silently returns without error.
.El
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/loader.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/loader.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.It Pa /boot/defaults/loader.conf
File loaded by the
@@ -187,18 +190,10 @@ Standard
.Pa /boot/loader.rc :
.Pp
.Bd -literal -offset indent -compact
-include /boot/loader.4th
+include /boot/forth/loader.4th
start
.Ed
.Pp
-Load a different kernel with the standard configuration:
-.Pp
-.Bd -literal -offset indent -compact
-set kernel="kernel.old"
-unload
-boot-conf
-.Ed
-.Pp
Read an additional configuration file and then proceed to boot:
.Pp
.Bd -literal -offset indent -compact
@@ -206,28 +201,6 @@ unload
read-conf /boot/special.conf
boot-conf
.Ed
-.Pp
-Disable the loading of the splash screen module and bitmap and then
-proceed to boot:
-.Pp
-.Bd -literal -offset indent -compact
-unload
-disable-module splash_bmp
-disable-module bitmap
-boot-conf
-.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr loader 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 3.2 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An Daniel C. Sobral Aq dcs@FreeBSD.org .
-.Sh BUGS
-A British espionage series.
+.Xr loader.conf 4 ,
+.Xr loader 5
diff --git a/usr/src/boot/sys/boot/common/loader.8 b/usr/src/man/man5/loader.5
index 55cbad4b1d..ef651b02a1 100644
--- a/usr/src/boot/sys/boot/common/loader.8
+++ b/usr/src/man/man5/loader.5
@@ -22,29 +22,49 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd November 18, 2015
-.Dt LOADER 8
+.Dd Apr 20, 2017
+.Dt LOADER 5
.Os
.Sh NAME
.Nm loader
.Nd kernel bootstrapping final stage
.Sh DESCRIPTION
-The program called
+The
.Nm
is the final stage of
-.Fx Ns 's
-kernel bootstrapping process.
-On IA32 (i386) architectures, it is a
+.Nm illumos Ns 's
+kernel bootstrapping process. The actual name for the stage depends on
+the platform. On IA32 (i386) architectures with BIOS firmware, it is a
.Pa BTX
-client.
-It is linked statically to
-.Xr libstand 3
-and usually located in the directory
+client and named
+.Nm zfsloader .
+It is linked statically to libstand and usually located in the directory
.Pa /boot .
.Pp
-It provides a scripting language that can be used to
+.Nm
+supports booting from
+.Cm ZFS ,
+.Cm UFS ,
+.Cm PCFS ,
+.Cm HSFS
+and
+.Cm NFS
+file systems. Additionally,
+.Nm
+can load files from the
+.Cm TFTP
+file service. The NFS and TFTP based boot is enabled via
+.Xr pxeboot 5 .
+The
+.Nm
+also does support uncompressing gzip files while reading. The uncompression
+will happen automatically if the compressed file is stored without .gz
+suffix or if the file is accessed by leaving out the .gz suffix from the name.
+If the file is referred by full name, including .gz suffix, then the file
+content is read as is and the uncompression is not performed.
+.Pp
+.Nm
+provides a scripting language that can be used to
automate tasks, do pre-configuration or assist in recovery
procedures.
This scripting language is roughly divided in
@@ -63,22 +83,22 @@ During initialization,
will probe for a console and set the
.Va console
variable, or set it to serial console
-.Pq Dq Li comconsole
+.Pq Do Li ttya Dc - Dq Li ttyd
if the previous boot stage used that.
-If multiple consoles are selected, they will be listed separated by spaces.
+If multiple consoles are selected, they will be listed separated by commas.
Then, devices are probed,
.Va currdev
and
.Va loaddev
are set, and
-.Va LINES
-is set to 24.
+.Va COLUMNS ,
+.Va LINES ,
+and
+.Va ISADIR
+are set.
Next,
.Tn FICL
-is initialized, the builtin words are added to its vocabulary, and
-.Pa /boot/boot.4th
-is processed if it exists.
-No disk switching is possible while that file is being read.
+is initialized, the builtin words are added to its vocabulary.
The inner interpreter
.Nm
will use with
@@ -126,14 +146,10 @@ in this case
will engage interactive mode only if
.Ic autoboot
has failed.
-.Sh BUILTIN COMMANDS
+.Ss Builtin Commands
In
.Nm ,
builtin commands take parameters from the command line.
-Presently,
-the only way to call them from a script is by using
-.Pa evaluate
-on a string.
If an error condition occurs, an exception will be generated,
which can be intercepted using
.Tn ANS
@@ -169,9 +185,13 @@ must precede the kernel name, if a kernel name is provided.
.Pp
.Em WARNING :
The behavior of this builtin is changed if
-.Xr loader.4th 8
+.Xr loader.4th 5
is loaded.
.Pp
+.It Ic chain Ar device
+Chain load another boot loader from the specified device. Device can be either
+disk name or partition.
+.Pp
.It Ic echo Xo
.Op Fl n
.Op Aq message
@@ -205,30 +225,11 @@ returns an error itself (see
.Op Fl t Ar type
.Ar file Cm ...
.Xc
-Loads a kernel, kernel loadable module (kld), disk image,
-or file of opaque contents tagged as being of the type
+Loads a kernel or file of opaque contents tagged as being of the type
.Ar type .
Kernel and modules can be either in a.out or ELF format.
Any arguments passed after the name of the file to be loaded
will be passed as arguments to that file.
-Use the
-.Li md_image
-type to make the kernel create a file-backed
-.Xr md 4
-disk.
-This is useful for booting from a temporary rootfs.
-Currently, argument passing does not work for the kernel.
-.Pp
-.It Ic load_geli Xo
-.Op Fl n Ar keyno
-.Ar prov Ar file
-.Xc
-Loads a
-.Xr geli 8
-encryption keyfile for the given provider name.
-The key index can be specified via
-.Ar keyno
-or will default to zero.
.Pp
.It Ic ls Xo
.Op Fl l
@@ -260,10 +261,6 @@ Display the files specified, with a pause at each
.Va LINES
displayed.
.Pp
-.It Ic pnpscan Op Fl v
-Scans for Plug-and-Play devices.
-This is not functional at present.
-.Pp
.It Ic read Xo
.Op Fl t Ar seconds
.Op Fl p Ar prompt
@@ -303,7 +300,7 @@ from the environment.
.It Ic \&?
Lists available commands.
.El
-.Ss BUILTIN ENVIRONMENT VARIABLES
+.Ss Builtin Environment Variables
The
.Nm
has actually two different kinds of
@@ -371,172 +368,59 @@ no delay will be inserted and
will engage interactive mode only if
.Ic autoboot
has failed for some reason.
-.It Va boot_askname
-Instructs the kernel to prompt the user for the name of the root device
-when the kernel is booted.
-.It Va boot_cdrom
-Instructs the kernel to try to mount the root file system from CD-ROM.
-.It Va boot_ddb
-Instructs the kernel to start in the DDB debugger, rather than
-proceeding to initialize when booted.
-.It Va boot_dfltroot
-Instructs the kernel to mount the statically compiled-in root file system.
-.It Va boot_gdb
-Selects gdb-remote mode for the kernel debugger by default.
-.It Va boot_multicons
-Enables multiple console support in the kernel early on boot.
-In a running system, console configuration can be manipulated
-by the
-.Xr conscontrol 8
-utility.
-.It Va boot_mute
-All console output is suppressed when console is muted.
-In a running system, the state of console muting can be manipulated by the
-.Xr conscontrol 8
-utility.
-.It Va boot_pause
-During the device probe, pause after each line is printed.
-.It Va boot_serial
-Force the use of a serial console even when an internal console
-is present.
+.It Va boot_ask
+Will set
+.Xr kernel 1M
+.Fl a
+option.
+.It Va boot_debug
+Will set
+.Xr kernel 1M
+.Fl d
+option.
+.It Va boot_kmdb
+Will set
+.Xr kernel 1M
+.Fl k
+option.
+.It Va boot_reconfigure
+Will set
+.Xr kernel 1M
+.Fl r
+option.
.It Va boot_single
-Prevents the kernel from initiating a multi-user startup; instead,
-a single-user mode will be entered when the kernel has finished
-device probing.
+Will set
+.Xr kernel 1M
+.Fl s
+option.
.It Va boot_verbose
-Setting this variable causes extra debugging information to be printed
-by the kernel during the boot phase.
-.It Va bootfile
-List of semicolon-separated search path for bootable kernels.
-The default is
-.Dq Li kernel .
-.It Va comconsole_speed
-Defines the speed of the serial console (i386 and amd64 only).
-If the previous boot stage indicated that a serial console is in use
-then this variable is initialized to the current speed of the console
-serial port.
-Otherwise it is set to 9600 unless this was overridden using the
-.Va BOOT_COMCONSOLE_SPEED
-variable when
+Will set
+.Xr kernel 1M
+.Fl v
+option.
+.It Va boot-args
+Will set custom arguments for the kernel. If set in
.Nm
-was compiled.
-Changes to the
-.Va comconsole_speed
-variable take effect immediately.
-.It Va comconsole_port
-Defines the base i/o port used to access console UART
-(i386 and amd64 only).
-If the variable is not set, its assumed value is 0x3F8, which
-corresponds to PC port COM1, unless overridden by
-.Va BOOT_COMCONSOLE_PORT
-variable during the compilation of
-.Nm .
-Setting the
-.Va comconsole_port
-variable automatically set
-.Va hw.uart.console
-environment variable to provide a hint to kernel for location of the console.
-Loader console is changed immediately after variable
-.Va comconsole_port
-is set.
-.It Va comconsole_pcidev
-Defines the location of a PCI device of the 'simple communication'
-class to be used as the serial console UART (i386 and amd64 only).
-The syntax of the variable is
-.Li 'bus:device:function[:bar]' ,
-where all members must be numeric, with possible
-.Li 0x
-prefix to indicate a hexadecimal value.
-The
-.Va bar
-member is optional and assumed to be 0x10 if omitted.
-The bar must decode i/o space.
-Setting the variable
-.Va comconsole_pcidev
-automatically sets the variable
-.Va comconsole_port
-to the base of the selected bar, and hint
-.Va hw.uart.console .
-Loader console is changed immediately after variable
-.Va comconsole_pcidev
-is set.
+configuration, the
+.Nm
+startup will parse the
+.Va boot-args
+value to set boot prefixed variables listed above, any unrecognized options
+are added to kernel command line verbatim.
+.It Va bootfile
+The name of the kernel.
.It Va console
Defines the current console or consoles.
Multiple consoles may be specified.
In that case, the first listed console will become the default console for
-userland output (e.g.\& from
-.Xr init 8 ) .
+the
+.Xr kernel 1M .
.It Va currdev
Selects the default device.
Syntax for devices is odd.
-.It Va dumpdev
-Sets the device for kernel dumps.
-This can be used to ensure that a device is configured before the corresponding
-.Va dumpdev
-directive from
-.Xr rc.conf 5
-has been processed, allowing kernel panics that happen during the early stages
-of boot to be captured.
-.It Va init_chroot
-If set to a valid directory in the root file system, it causes
-.Xr init 8
-to perform a
-.Xr chroot 2
-operation on that directory, making it the new root directory.
-That happens before entering single-user mode or multi-user
-mode (but after executing the
-.Va init_script
-if enabled).
-.It Va init_path
-Sets the list of binaries which the kernel will try to run as the initial
-process.
-The first matching binary is used.
-The default list is
-.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init .
-.It Va init_script
-If set to a valid file name in the root file system,
-instructs
-.Xr init 8
-to run that script as the very first action,
-before doing anything else.
-Signal handling and exit code interpretation is similar to
-running the
-.Pa /etc/rc
-script.
-In particular, single-user operation is enforced
-if the script terminates with a non-zero exit code,
-or if a SIGTERM is delivered to the
-.Xr init 8
-process (PID 1).
-.It Va init_shell
-Defines the shell binary to be used for executing the various shell scripts.
-The default is
-.Dq Li /bin/sh .
-It is used for running the
-.Va init_script
-if set, as well as for the
-.Pa /etc/rc
-and
-.Pa /etc/rc.shutdown
-scripts.
-The value of the corresponding
-.Xr kenv 2
-variable is evaluated every time
-.Xr init 8
-calls a shell script, so it can be changed later on using the
-.Xr kenv 1
-utility.
-In particular, if a non-default shell is used for running an
-.Va init_script ,
-it might be desirable to have that script reset the value of
-.Va init_shell
-back to the default, so that the
-.Pa /etc/rc
-script is executed with the standard shell
-.Pa /bin/sh .
.It Va interpret
Has the value
-.Dq Li OK
+.Dq Li ok
if the Forth's current state is interpreting.
.It Va LINES
Define the number of lines on the screen, to be used by the pager.
@@ -544,12 +428,7 @@ Define the number of lines on the screen, to be used by the pager.
Sets the list of directories which will be searched for modules
named in a load command or implicitly required by a dependency.
The default value for this variable is
-.Dq Li /boot/kernel;/boot/modules .
-.It Va num_ide_disks
-Sets the number of IDE disks as a workaround for some problems in
-finding the root disk at boot.
-This has been deprecated in favor of
-.Va root_disk_unit .
+.Dq Li /platform/i86pc/${ISADIR}
.It Va prompt
Value of
.Nm Ns 's
@@ -560,151 +439,16 @@ If variable
.Va prompt
is unset, the default prompt is
.Ql > .
-.It Va root_disk_unit
-If the code which detects the disk unit number for the root disk is
-confused, e.g.\& by a mix of SCSI and IDE disks, or IDE disks with
-gaps in the sequence (e.g.\& no primary slave), the unit number can
-be forced by setting this variable.
-.It Va rootdev
-By default the value of
-.Va currdev
-is used to set the root file system
-when the kernel is booted.
-This can be overridden by setting
-.Va rootdev
-explicitly.
+.It Va os_console
+If set, the value is used to set
+.Xr kernel 1M
+.Va console
+property.
.El
.Pp
-Other variables are used to override kernel tunable parameters.
-The following tunables are available:
-.Bl -tag -width Va
-.It Va hw.physmem
-Limit the amount of physical memory the system will use.
-By default the size is in bytes, but the
-.Cm k , K , m , M , g
-and
-.Cm G
-suffixes
-are also accepted and indicate kilobytes, megabytes and gigabytes
-respectively.
-An invalid suffix will result in the variable being ignored by the
-kernel.
-.It Va hw.pci.host_start_mem , hw.acpi.host_start_mem
-When not otherwise constrained, this limits the memory start
-address.
-The default is 0x80000000 and should be set to at least size of the
-memory and not conflict with other resources.
-Typically, only systems without PCI bridges need to set this variable
-since PCI bridges typically constrain the memory starting address
-(and the variable is only used when bridges do not constrain this
-address).
-.It Va hw.pci.enable_io_modes
-Enable PCI resources which are left off by some BIOSes or are not
-enabled correctly by the device driver.
-Tunable value set to ON (1) by default, but this may cause problems
-with some peripherals.
-.It Va kern.maxusers
-Set the size of a number of statically allocated system tables; see
-.Xr tuning 7
-for a description of how to select an appropriate value for this
-tunable.
-When set, this tunable replaces the value declared in the kernel
-compile-time configuration file.
-.It Va kern.ipc.nmbclusters
-Set the number of mbuf clusters to be allocated.
-The value cannot be set below the default
-determined when the kernel was compiled.
-.It Va kern.ipc.nsfbufs
-Set the number of
-.Xr sendfile 2
-buffers to be allocated.
-Overrides
-.Dv NSFBUFS .
-Not all architectures use such buffers; see
-.Xr sendfile 2
-for details.
-.It Va kern.maxswzone
-Limits the amount of KVM to be used to hold swap
-metadata, which directly governs the
-maximum amount of swap the system can support,
-at the rate of approximately 200 MB of swap space
-per 1 MB of metadata.
-This value is specified in bytes of KVA space.
-If no value is provided, the system allocates
-enough memory to handle an amount of swap
-that corresponds to eight times the amount of
-physical memory present in the system.
-.Pp
-Note that swap metadata can be fragmented,
-which means that the system can run out of
-space before it reaches the theoretical limit.
-Therefore, care should be taken to not configure
-more swap than approximately half of the
-theoretical maximum.
-.Pp
-Running out of space for swap metadata can leave
-the system in an unrecoverable state.
-Therefore, you should only change
-this parameter if you need to greatly extend the
-KVM reservation for other resources such as the
-buffer cache or
-.Va kern.ipc.nmbclusters .
-Modifies kernel option
-.Dv VM_SWZONE_SIZE_MAX .
-.It Va kern.maxbcache
-Limits the amount of KVM reserved for use by the
-buffer cache, specified in bytes.
-The default maximum is 200MB on i386,
-and 400MB on amd64 and sparc64.
-This parameter is used to
-prevent the buffer cache from eating too much
-KVM in large-memory machine configurations.
-Only mess around with this parameter if you need to
-greatly extend the KVM reservation for other resources
-such as the swap zone or
-.Va kern.ipc.nmbclusters .
-Note that
-the NBUF parameter will override this limit.
-Modifies
-.Dv VM_BCACHE_SIZE_MAX .
-.It Va kern.msgbufsize
-Sets the size of the kernel message buffer.
-The default limit of 64KB is usually sufficient unless
-large amounts of trace data need to be collected
-between opportunities to examine the buffer or
-dump it to a file.
-Overrides kernel option
-.Dv MSGBUF_SIZE .
-.It Va machdep.disable_mtrrs
-Disable the use of i686 MTRRs (x86 only).
-.It Va net.inet.tcp.tcbhashsize
-Overrides the compile-time set value of
-.Dv TCBHASHSIZE
-or the preset default of 512.
-Must be a power of 2.
-.It Va twiddle_divisor
-Throttles the output of the
-.Sq twiddle
-I/O progress indicator displayed while loading the kernel and modules.
-This is useful on slow serial consoles where the time spent waiting for
-these characters to be written can add up to many seconds.
-The default is 1 (full speed); a value of 2 spins half as fast, and so on.
-.It Va vm.kmem_size
-Sets the size of kernel memory (bytes).
-This overrides the value determined when the kernel was compiled.
-Modifies
-.Dv VM_KMEM_SIZE .
-.It Va vm.kmem_size_min
-.It Va vm.kmem_size_max
-Sets the minimum and maximum (respectively) amount of kernel memory
-that will be automatically allocated by the kernel.
-These override the values determined when the kernel was compiled.
-Modifies
-.Dv VM_KMEM_SIZE_MIN
-and
-.Dv VM_KMEM_SIZE_MAX .
-.El
-.Ss BUILTIN PARSER
+Other variables are used for loader or to set kernel properties or for
+informational purposes.
+.Ss Builtin Parser
When a builtin command is executed, the rest of the line is taken
by it as arguments, and it is processed by a special parser which
is not used for regular Forth commands.
@@ -756,8 +500,8 @@ Spaces can also be escaped through the use of \e\e .
.El
.Pp
An exception to this parsing rule exists, and is described in
-.Sx BUILTINS AND FORTH .
-.Ss BUILTINS AND FORTH
+.Sx Builtins And FORTH .
+.Ss Builtins And FORTH
All builtin words are state-smart, immediate words.
If interpreted, they behave exactly as described previously.
If they are compiled, though,
@@ -799,7 +543,7 @@ handle exceptions.
In this case, the use of a proxy is recommended.
For example:
.Dl : (boot) boot ;
-.Sh FICL
+.Ss FICL
.Tn FICL
is a Forth interpreter written in C, in the form of a forth
virtual machine library that can be called by C functions and vice
@@ -836,7 +580,7 @@ Forth standard words are listed in the
section.
The words falling in the two other groups are described in the
following subsections.
-.Ss FICL EXTRA WORDS
+.Ss FICL Extra Words
.Bl -tag -width wid-set-super
.It Ic .env
.It Ic .ver
@@ -862,7 +606,7 @@ This is the STRING word set's
.It Ic cell-
.It Ic -rot
.El
-.Ss FREEBSD EXTRA WORDS
+.Ss Loader Extra Words
.Bl -tag -width XXXXXXXX
.It Ic \&$ Pq --
Evaluates the remainder of the input buffer, after having printed it first.
@@ -893,7 +637,7 @@ The constants
and
.Dv O_RDWR
are defined in
-.Pa /boot/support.4th ,
+.Pa /boot/forth/support.4th ,
indicating read only, write only, and read-write access, respectively.
.It Xo
.Ic fread
@@ -928,82 +672,17 @@ Writes a byte to a port.
Returns the number of seconds since midnight.
.It Ic tib> Pq -- Ar addr len
Returns the remainder of the input buffer as a string on the stack.
-.It Ic trace! Pq Ar flag --
-Activates or deactivates tracing.
-Does not work with
-.Ic catch .
.El
-.Ss FREEBSD DEFINED ENVIRONMENTAL QUERIES
+.Ss Loader Defined Environmental Queries
.Bl -tag -width Ds
.It arch-i386
.Ic TRUE
if the architecture is IA32.
-.It FreeBSD_version
-.Fx
-version at compile time.
.It loader_version
.Nm
version.
.El
-.Ss SYSTEM DOCUMENTATION
-.Sh FILES
-.Bl -tag -width /boot/defaults/loader.conf -compact
-.It Pa /boot/loader
-.Nm
-itself.
-.It Pa /boot/boot.4th
-Additional
-.Tn FICL
-initialization.
-.It Pa /boot/defaults/loader.conf
-.It Pa /boot/loader.conf
-.It Pa /boot/loader.conf.local
-.Nm
-configuration files, as described in
-.Xr loader.conf 5 .
-.It Pa /boot/loader.rc
-.Nm
-bootstrapping script.
-.It Pa /boot/loader.help
-Loaded by
-.Ic help .
-Contains the help messages.
-.El
-.Sh EXAMPLES
-Boot in single user mode:
-.Pp
-.Dl boot -s
-.Pp
-Load the kernel, a splash screen, and then autoboot in five seconds.
-Notice that a kernel must be loaded before any other
-.Ic load
-command is attempted.
-.Bd -literal -offset indent
-load kernel
-load splash_bmp
-load -t splash_image_data /boot/chuckrulez.bmp
-autoboot 5
-.Ed
-.Pp
-Set the disk unit of the root device to 2, and then boot.
-This would be needed in a system with two IDE disks,
-with the second IDE disk hardwired to ada2 instead of ada1.
-.Bd -literal -offset indent
-set root_disk_unit=2
-boot /boot/kernel/kernel
-.Ed
-.Pp
-See also:
-.Bl -tag -width /usr/share/examples/bootforth/X
-.It Pa /boot/loader.4th
-Extra builtin-like words.
-.It Pa /boot/support.4th
-.Pa loader.conf
-processing words.
-.It Pa /usr/share/examples/bootforth/
-Assorted examples.
-.El
-.Sh ERRORS
+.Ss Errors
The following values are thrown by
.Nm :
.Bl -tag -width XXXXX -offset indent
@@ -1028,12 +707,49 @@ executed.
.It -259
Unspecified error.
.El
+.Sh FILES
+.Bl -tag -width /boot/defaults/loader.conf -compact
+.It Pa /boot/defaults/loader.conf
+.It Pa /boot/conf.d/*
+.It Pa /boot/loader.conf
+.It Pa /boot/loader.conf.local
+.Nm
+configuration files, as described in
+.Xr loader.conf 5 .
+.It Pa /boot/loader.help
+Loaded by
+.Ic help .
+Contains the help messages.
+.It Pa /boot/loader.rc
+.Nm
+bootstrapping script.
+.It Pa /boot/forth/loader.4th
+Extra builtin-like words.
+.It Pa /boot/forth/support.4th
+.Pa loader.conf
+processing words.
+.It Pa /boot/zfsloader
+.Nm
+itself.
+.El
+.Sh EXAMPLES
+Boot in single user mode:
+.Pp
+.Dl boot -s
+.Pp
+Load the kernel, a boot_archive, and then autoboot in five seconds.
+Notice that a kernel must be loaded before any other
+.Ic load
+command is attempted.
+.Bd -literal -offset indent
+load /platform/i86pc/kernel/amd64/unix
+load -t rootfs /platform/i86pc/amd64/boot_archive
+autoboot 5
+.Ed
.Sh SEE ALSO
-.Xr libstand 3 ,
-.Xr loader.conf 5 ,
-.Xr tuning 7 ,
-.Xr boot 8 ,
-.Xr btxld 8
+.Xr boot 1M ,
+.Xr btxld 1onbld ,
+.Xr loader.conf 5
.Sh STANDARDS
For the purposes of ANS Forth compliance, loader is an
.Bf Em
@@ -1067,25 +783,3 @@ bye, forget, see, words,
from the Programming-Tools extension word set, Providing the
Search-Order extensions word set.
.Ef
-.Sh HISTORY
-The
-.Nm
-first appeared in
-.Fx 3.1 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-was written by
-.An Michael Smith Aq msmith@FreeBSD.org .
-.Pp
-.Tn FICL
-was written by
-.An John Sadler Aq john_sadler@alum.mit.edu .
-.Sh BUGS
-The
-.Ic expect
-and
-.Ic accept
-words will read from the input buffer instead of the console.
-The latter will be fixed, but the former will not.
diff --git a/usr/src/boot/sys/boot/forth/menu.4th.8 b/usr/src/man/man5/menu.4th.5
index 3673eec74a..e4644008ed 100644
--- a/usr/src/boot/sys/boot/forth/menu.4th.8
+++ b/usr/src/man/man5/menu.4th.5
@@ -22,14 +22,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd August 6, 2013
-.Dt MENU.4TH 8
+.Dd Apr 22, 2017
+.Dt MENU.4TH 5
.Os
.Sh NAME
.Nm menu.4th
-.Nd FreeBSD dynamic menu boot module
+.Nd loader dynamic menu boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
@@ -40,7 +38,7 @@ The commands of
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -51,7 +49,7 @@ through the command:
.Dl include menu.4th
.Pp
This line is present in the default
-.Pa /boot/menu.rc
+.Pa /boot/forth/menu.rc
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -211,43 +209,9 @@ is enabled
.It Va menu_acpi
When set to a number
.Dq Li x
-associated with a given menuitem, that menuitem will only appear when
-running on i386-compatible hardware,
-.Va hint.acpi.0.rsdp
-is set (indicating the presence of hardware ACPI support as detected by
-.Xr loader 8 ) ,
-and
-.Va hint.acpi.0.disabled
-is not set.
-On non-i386 hardware, menuitems configured after the
-.Dq Li menu_acpi
-menuitem will use a lower number (to compensate for the missing ACPI menuitem)
-but continue to function as expected.
-On i386-compatible hardware lacking ACPI support (as detected by
-.Xr loader 8 ) ,
-subsequent menuitems will retain their associated numbers.
-.It Va hint.acpi.0.rsdp
-Set automatically by
-.Xr loader 8
-on i386-compatible hardware when ACPI support is detected at boot time.
-Effects the display of the
-.Dq Li menu_acpi
-menuitem (if configured).
-.It Va hint.acpi.0.disabled
-Effects the display of the
-.Va menu_acpi
-menuitem.
-If set, the menuitem will display
-.Va toggled_text[x]
-.Va ( toggled_ansi[x]
-if
-.Va loader_color
-is set), otherwise
-.Va menu_caption[x]
-.Va ( ansi_caption[x]
-if
-.Va loader_color
-is set).
+associated with a given menuitem, that menuitem will allow to select
+acpi-user-options
+.Pq see Xr eeprom 1M .
.It Va menu_options
When set to a number
.Dq Li x ,
@@ -307,22 +271,22 @@ For all values of
above, use any number between 1 through 9. Sorry, double-digits are not
currently supported.
.Sh FILES
-.Bl -tag -width /boot/loader.4th -compact
-.It Pa /boot/loader
+.Bl -tag -width /boot/forth/loader.4th -compact
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/menu.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/menu.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
A simple boot menu:
.Pp
.Bd -literal -offset indent -compact
-include /boot/menu.4th
+include /boot/forth/menu.4th
menu-init
set menu_caption[1]="Boot"
set menu_command[1]="boot"
@@ -335,18 +299,8 @@ set menu_reboot
menu-display
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr beastie.4th 8 ,
-.Xr loader 8 ,
-.Xr loader.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr eeprom 1M ,
+.Xr loader.conf 4 ,
+.Xr beastie.4th 5 ,
+.Xr loader 5 ,
+.Xr loader.4th 5
diff --git a/usr/src/boot/sys/boot/forth/menusets.4th.8 b/usr/src/man/man5/menusets.4th.5
index f785ae18ea..b2584e2030 100644
--- a/usr/src/boot/sys/boot/forth/menusets.4th.8
+++ b/usr/src/man/man5/menusets.4th.5
@@ -22,26 +22,24 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd November 5, 2012
-.Dt MENUSETS.4TH 8
+.Dd Apr 22, 2017
+.Dt MENUSETS.4TH 5
.Os
.Sh NAME
.Nm menusets.4th
-.Nd FreeBSD dynamic submenu boot module
+.Nd loader dynamic submenu boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
is a set of commands designed to add submenu functionality to the dynamic menu
system provided by
-.Xr menu.4th 8 .
+.Xr menu.4th 5 .
Submenus are managed through a system of carefully named environment variables.
The commands of
.Nm
by themselves are not enough for most uses.
Please refer to the examples below for the most common situations, and to
-.Xr menu.4th 8
+.Xr menu.4th 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -52,7 +50,7 @@ through the command:
.Dl include menusets.4th
.Pp
This line is present in the default
-.Pa /boot/menu-commands.4th
+.Pa /boot/forth/menu-commands.4th
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -306,26 +304,26 @@ For all values of
above, use any number between 1 and 65535.
.Sh FILES
.Bl -tag -width /boot/menu-commands.4th -compact
-.It Pa /boot/loader
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/menu.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/menu.4th
Dynamic menu module.
-.It Pa /boot/menu-commands.4th
+.It Pa /boot/forth/menu-commands.4th
Contains the goto_menu command.
-.It Pa /boot/menusets.4th
+.It Pa /boot/forth/menusets.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
A simple boot menu with a submenu:
.Pp
.Bd -literal -offset indent -compact
-include /boot/menu.4th
-include /boot/menu-commands.4th
+include /boot/forth/menu.4th
+include /boot/forth/menu-commands.4th
menu-init
set menuset1_caption[1]="Boot"
set menuset1_command[1]="boot"
@@ -341,8 +339,8 @@ menu-display
The same boot menu with named menusets:
.Pp
.Bd -literal -offset indent -compact
-include /boot/menu.4th
-include /boot/menu-commands.4th
+include /boot/forth/menu.4th
+include /boot/forth/menu-commands.4th
menu-init
set menuset_name1=main
set mainmenu_caption[1]="Boot"
@@ -354,19 +352,8 @@ set submenu_caption[1]="Back"
set submenu_command[1]="1 goto_menu"
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr beastie.4th 8 ,
-.Xr loader 8 ,
-.Xr loader.4th 8 ,
-.Xr menu.4th 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 10.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr beastie.4th 5 ,
+.Xr loader 5 ,
+.Xr loader.4th 5 ,
+.Xr menu.4th 5
diff --git a/usr/src/boot/sys/boot/i386/pxeldr/pxeboot.8 b/usr/src/man/man5/pxeboot.5
index 7f57d5a087..b6ddfa9f5f 100644
--- a/usr/src/boot/sys/boot/i386/pxeldr/pxeboot.8
+++ b/usr/src/man/man5/pxeboot.5
@@ -22,10 +22,8 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd May 1, 2000
-.Dt PXEBOOT 8
+.Dd Apr 21, 2017
+.Dt PXEBOOT 5
.Os
.Sh NAME
.Nm pxeboot
@@ -34,20 +32,16 @@
The
.Nm
bootloader is a modified version of the system third-stage bootstrap
-.Xr loader 8
+.Xr loader 5
configured to run under Intel's Preboot Execution Environment (PXE) system.
-PXE is a form of smart boot ROM, built into Intel EtherExpress Pro/100 and
-3Com 3c905c Ethernet cards, and Ethernet-equipped Intel motherboards.
+PXE is a form of smart boot ROM, built into Ethernet cards, and
+Ethernet-equipped motherboards.
PXE supports DHCP configuration and provides low-level NIC access services.
The
.Nm
bootloader retrieves the kernel, modules,
and other files either via NFS over UDP or by TFTP,
-selectable through compile-time options.
-In combination with a memory file system image or NFS-mounted root file system,
-.Nm
-allows for easy,
-EEPROM-burner free construction of diskless machines.
+selectable through DHCP options.
.Pp
The
.Nm
@@ -72,6 +66,7 @@ subnet 10.0.0.0 netmask 255.255.255.0 {
}
.Ed
+.Pp
.Nm
recognizes
.Va next-server
@@ -93,37 +88,23 @@ variable in
.Pa /boot/loader.conf .
Valid values range from 1024 to 4096 bytes.
.Pp
-In all other respects,
.Nm
-acts just like
-.Xr loader 8 .
+defaults to use NFS, to use TFTP loading, DHCP server must provide
+option
+.Va 150 .
+TFTP block size can be controlled by setting the
+.Va tftp.blksize
+variable in
+.Pa /boot/loader.conf .
+Valid values range from 8 to 9008 bytes.
.Pp
-As PXE is still in its infancy, some firmware versions may not work
-properly.
-The
+In all other respects,
.Nm
-bootloader has been extensively tested on version 0.99 of Intel firmware;
-pre-release versions of the newer 2.0 firmware are known to have
-problems.
-Check with the device's manufacturer for their latest stable release.
+acts just like
+.Xr loader 5 .
.Pp
For further information on Intel's PXE specifications and Wired for
Management (WfM) systems, see
.Li http://www.intel.com/design/archives/wfm/ .
.Sh SEE ALSO
-.Xr loader 8
-.Sh HISTORY
-The
-.Nm
-bootloader first appeared in
-.Fx 4.1 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-bootloader was written by
-.An John Baldwin Aq jhb@FreeBSD.org
-and
-.An Paul Saab Aq ps@FreeBSD.org .
-This manual page was written by
-.An Doug White Aq dwhite@FreeBSD.org .
+.Xr loader 5
diff --git a/usr/src/boot/sys/boot/forth/version.4th.8 b/usr/src/man/man5/version.4th.5
index 256df1ee5f..a0d9729294 100644
--- a/usr/src/boot/sys/boot/forth/version.4th.8
+++ b/usr/src/man/man5/version.4th.5
@@ -22,14 +22,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd August 6, 2013
-.Dt VERSION.4TH 8
+.Dd Apr 22, 2017
+.Dt VERSION.4TH 5
.Os
.Sh NAME
.Nm version.4th
-.Nd FreeBSD version string boot module
+.Nd loader version string boot module
.Sh DESCRIPTION
The file that goes by the name of
.Nm
@@ -40,7 +38,7 @@ The commands of
by themselves are not enough for most uses.
Please refer to the
examples below for the most common situations, and to
-.Xr loader 8
+.Xr loader 5
for additional commands.
.Pp
Before using any of the commands provided in
@@ -51,7 +49,7 @@ through the command:
.Dl include version.4th
.Pp
This line is present in the default
-.Pa /boot/menu.rc
+.Pa /boot/forth/menu.rc
file, so it is not needed (and should not be re-issued) in a normal setup.
.Pp
The commands provided by it are:
@@ -70,9 +68,9 @@ The environment variables that effect its behavior are:
.Bl -tag -width bootfile -offset indent
.It Va loader_version
Set automatically by
-.Xr loader 8 ,
+.Xr loader 5 ,
but you can override it by setting in
-.Xr loader.conf 5 .
+.Xr loader.conf 4 .
This should be the version of boot loader used.
.It Va loader_version_x
Sets the desired ending column position of
@@ -92,19 +90,19 @@ causes the version to be printed without color
.El
.Sh FILES
.Bl -tag -width /boot/version.4th -compact
-.It Pa /boot/loader
+.It Pa /boot/zfsloader
The
-.Xr loader 8 .
-.It Pa /boot/version.4th
+.Xr zfsloader 5 .
+.It Pa /boot/forth/version.4th
.Nm
itself.
.It Pa /boot/loader.rc
-.Xr loader 8
+.Xr loader 5
bootstrapping script.
.El
.Sh EXAMPLES
Override
-.Xr loader 8
+.Xr loader 5
version in
.Xr loader.conf 5 :
.Pp
@@ -112,17 +110,6 @@ version in
loader_version="loader 1.1"
.Ed
.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr color.4th 8 ,
-.Xr loader 8
-.Sh HISTORY
-The
-.Nm
-set of commands first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-set of commands was written by
-.An -nosplit
-.An Devin Teske Aq dteske@FreeBSD.org .
+.Xr loader.conf 4 ,
+.Xr color.4th 5 ,
+.Xr loader 5
diff --git a/usr/src/boot/sys/boot/common/zfsloader.8 b/usr/src/man/man5/zfsloader.5
index fd437d9399..f6b56a9245 100644
--- a/usr/src/boot/sys/boot/common/zfsloader.8
+++ b/usr/src/man/man5/zfsloader.5
@@ -22,10 +22,8 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd September 15, 2014
-.Dt ZFSLOADER 8
+.Dd Apr 20, 2017
+.Dt ZFSLOADER 5
.Os
.Sh NAME
.Nm zfsloader
@@ -33,15 +31,15 @@
.Sh DESCRIPTION
.Nm
is an extended variant of
-.Xr loader 8
+.Xr loader 5
with added support for booting from ZFS.
This document describes only differences from
-.Xr loader 8 .
-.Sh ZFS FEATURES
+.Xr loader 5 .
+.Ss ZFS Features
.Nm
supports the following format for specifying ZFS filesystems which
can be used wherever
-.Xr loader 8
+.Xr loader 5
refers to a device specification:
.Pp
.Ar zfs:pool/filesystem:
@@ -49,18 +47,16 @@ refers to a device specification:
where
.Pa pool/filesystem
is a ZFS filesystem name as described in
-.Xr zfs 8 .
+.Xr zfs 1M .
.Pp
-If
-.Pa /etc/fstab
-does not have an entry for the root filesystem and
-.Va vfs.root.mountfrom
+If the variable
+.Va fstype
is not set, but
.Va currdev
refers to a ZFS filesystem, then
.Nm
will instruct kernel to use that filesystem as the root filesystem.
-.Sh ZFS COMMAND EXTENSIONS
+.Ss ZFS Command Extensions
.Bl -tag -width Ds -compact
.It Ic lsdev Op Fl v
Lists ZFS pools in addition to disks and partitions.
@@ -87,20 +83,17 @@ itself.
.Sh EXAMPLES
Set the default device used for loading a kernel from a ZFS filesystem:
.Bd -literal -offset indent
-set currdev=zfs:tank/ROOT/knowngood:
+set currdev=zfs:rpool/ROOT/knowngood:
.Ed
.Sh SEE ALSO
-.Xr gptzfsboot 8 ,
-.Xr loader 8 ,
-.Xr zfs 8 ,
-.Xr zfsboot 8 ,
-.Xr zfsloader 8 ,
-.Xr zpool 8
-.Sh HISTORY
-The
-.Nm
-first appeared in
-.Fx 7.3 .
-.Sh AUTHORS
-This manual page was written by
-.An Andriy Gapon Aq avg@FreeBSD.org .
+.Xr zfs 1M ,
+.Xr zpool 1M ,
+.Xr gptzfsboot 5 ,
+.Xr loader 5
+.Sh NOTES
+Although setting the
+.Va currdev
+as shown in the example above is supported, it is advisable to use loader
+beadm command or boot environment menu instead. The reason is, the beadm
+or menu selection will also instruct loader to clean up the currently set
+configuration and load configuration from the new boot environment.
diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf
index d59171f086..8d861f2366 100644
--- a/usr/src/pkg/manifests/developer-build-onbld.mf
+++ b/usr/src/pkg/manifests/developer-build-onbld.mf
@@ -228,6 +228,7 @@ file path=opt/onbld/lib/python$(PYTHON_VERSION)/onbld/hgext/cdm.py mode=0444
file path=opt/onbld/man/man1onbld/Install.1onbld
file path=opt/onbld/man/man1onbld/bldenv.1onbld
file path=opt/onbld/man/man1onbld/bringovercheck.1onbld
+file path=opt/onbld/man/man1onbld/btxld.1onbld
file path=opt/onbld/man/man1onbld/cddlchk.1onbld
file path=opt/onbld/man/man1onbld/check_rtime.1onbld
file path=opt/onbld/man/man1onbld/checkpaths.1onbld
diff --git a/usr/src/pkg/manifests/system-boot-loader.mf b/usr/src/pkg/manifests/system-boot-loader.mf
index c2a2a2698f..03acd116ac 100644
--- a/usr/src/pkg/manifests/system-boot-loader.mf
+++ b/usr/src/pkg/manifests/system-boot-loader.mf
@@ -39,6 +39,10 @@ $(i386_ONLY)dir path=boot group=sys
$(i386_ONLY)dir path=boot/conf.d group=sys
$(i386_ONLY)dir path=boot/defaults group=sys
$(i386_ONLY)dir path=boot/forth group=sys
+$(i386_ONLY)dir path=usr/share/man
+$(i386_ONLY)dir path=usr/share/man/man3
+$(i386_ONLY)dir path=usr/share/man/man4
+$(i386_ONLY)dir path=usr/share/man/man5
$(i386_ONLY)file path=boot/cdboot group=sys mode=0444
$(i386_ONLY)file path=boot/defaults/loader.conf group=sys mode=0444
$(i386_ONLY)file path=boot/forth/beadm.4th group=sys mode=0444
@@ -72,6 +76,19 @@ $(i386_ONLY)file path=boot/loader.rc group=sys mode=0444
$(i386_ONLY)file path=boot/pmbr group=sys mode=0444
$(i386_ONLY)file path=boot/pxeboot group=sys mode=0444
$(i386_ONLY)file path=boot/zfsloader group=sys mode=0444
+$(i386_ONLY)file path=usr/share/man/man4/loader.conf.4
+$(i386_ONLY)file path=usr/share/man/man5/brand.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/check-password.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/color.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/delay.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/gptzfsboot.5
+$(i386_ONLY)file path=usr/share/man/man5/loader.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/loader.5
+$(i386_ONLY)file path=usr/share/man/man5/menu.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/menusets.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/pxeboot.5
+$(i386_ONLY)file path=usr/share/man/man5/version.4th.5
+$(i386_ONLY)file path=usr/share/man/man5/zfsloader.5
license lic_CDDL license=lic_CDDL
license usr/src/boot/COPYRIGHT license=usr/src/boot/COPYRIGHT
license usr/src/boot/sys/boot/common/linenoise/LICENSE \
diff --git a/usr/src/tools/btxld/Makefile b/usr/src/tools/btxld/Makefile
index fd106271ff..9428eb1620 100644
--- a/usr/src/tools/btxld/Makefile
+++ b/usr/src/tools/btxld/Makefile
@@ -23,20 +23,22 @@ UTILS_SRC= $(COMMON_SRC)/boot_utils.c
EXTRA_SRC= $(COMMON_SRC)/mboot_extra.c
PROG= btxld
-MAN= btxld.8
+MAN1ONBLDFILES= btxld.1onbld
SRCS= btxld.c elfh.c version.c $(UTILS_SRC) $(EINFO_SRC) $(EXTRA_SRC)
OBJS= btxld.o elfh.o version.o bblk_einfo.o mboot_extra.o boot_utils.o
LDLIBS += -lmd5
C99MODE= $(C99_ENABLE)
CPPFLAGS += -I$(SRC)/uts/common -I$(COMMON_SRC)
-all: $(PROG)
+$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE= 644
+
+all: $(PROG) $(MAN1ONBLDFILES)
$(PROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
-install: all .WAIT $(ROOTONBLDMACHPROG)
+install: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES)
clean:
$(RM) $(OBJS)
diff --git a/usr/src/tools/btxld/btxld.8 b/usr/src/tools/btxld/btxld.1onbld
index cfa4623e49..4cb423ba79 100644
--- a/usr/src/tools/btxld/btxld.8
+++ b/usr/src/tools/btxld/btxld.1onbld
@@ -22,10 +22,8 @@
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd September 12, 1998
-.Dt BTXLD 8
+.Dd Apr 20, 2017
+.Dt BTXLD 1ONBLD
.Os
.Sh NAME
.Nm btxld
@@ -93,6 +91,4 @@ combined .text and .data segments of the client image.
.Ex -std
.Sh SEE ALSO
.Xr ld 1 ,
-.Xr boot 8
-.Sh AUTHORS
-.An Robert Nordier Aq Mt rnordier@FreeBSD.org
+.Xr boot 1M