xref: /freebsd/stand/forth/loader.4th.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1ca987d46SWarner Losh.\" Copyright (c) 1999 Daniel C. Sobral
2ca987d46SWarner Losh.\" All rights reserved.
3ca987d46SWarner Losh.\"
4ca987d46SWarner Losh.\" Redistribution and use in source and binary forms, with or without
5ca987d46SWarner Losh.\" modification, are permitted provided that the following conditions
6ca987d46SWarner Losh.\" are met:
7ca987d46SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
8ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
9ca987d46SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
10ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
11ca987d46SWarner Losh.\"    documentation and/or other materials provided with the distribution.
12ca987d46SWarner Losh.\"
13ca987d46SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14ca987d46SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15ca987d46SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16ca987d46SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17ca987d46SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18ca987d46SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19ca987d46SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20ca987d46SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21ca987d46SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22ca987d46SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23ca987d46SWarner Losh.\" SUCH DAMAGE.
24ca987d46SWarner Losh.\"
25ca987d46SWarner Losh.Dd November 13, 2013
26ca987d46SWarner Losh.Dt LOADER.4TH 8
27ca987d46SWarner Losh.Os
28ca987d46SWarner Losh.Sh NAME
29ca987d46SWarner Losh.Nm loader.4th
30ca987d46SWarner Losh.Nd loader.conf processing tools
31ca987d46SWarner Losh.Sh DESCRIPTION
32ca987d46SWarner LoshThe file that goes by the name of
33ca987d46SWarner Losh.Nm
34ca987d46SWarner Loshis a set of commands designed to manipulate
35ca987d46SWarner Losh.Xr loader.conf 5
36ca987d46SWarner Loshfiles.
37ca987d46SWarner LoshThe default
38ca987d46SWarner Losh.Pa /boot/loader.rc
39ca987d46SWarner Loshincludes
40ca987d46SWarner Losh.Nm
41ca987d46SWarner Loshand uses one of its commands to automatically read and process
42ca987d46SWarner Loshthe standard
43ca987d46SWarner Losh.Xr loader.conf 5
44ca987d46SWarner Loshfiles.
45ca987d46SWarner LoshOther commands exists to help the user specify alternate
46ca987d46SWarner Loshconfigurations.
47ca987d46SWarner Losh.Pp
48ca987d46SWarner LoshThe commands of
49ca987d46SWarner Losh.Nm
50ca987d46SWarner Loshby themselves are not enough for most uses.
51ca987d46SWarner LoshPlease refer to the
52ca987d46SWarner Loshexamples below for the most common situations, and to
53ca987d46SWarner Losh.Xr loader 8
54ca987d46SWarner Loshfor additional commands.
55ca987d46SWarner Losh.Pp
56ca987d46SWarner LoshBefore using any of the commands provided in
57ca987d46SWarner Losh.Nm ,
58ca987d46SWarner Loshit must be included
59ca987d46SWarner Loshthrough the command:
60ca987d46SWarner Losh.Pp
61ca987d46SWarner Losh.Dl include loader.4th
62ca987d46SWarner Losh.Pp
63ca987d46SWarner LoshThis line is present in the default
64ca987d46SWarner Losh.Pa /boot/loader.rc
65ca987d46SWarner Loshfile, so it is not needed (and should not be re-issued) in a normal setup.
66ca987d46SWarner Losh.Pp
67ca987d46SWarner LoshThe commands provided by it are:
68ca987d46SWarner Losh.Bl -tag -width disable-module_module -compact -offset indent
69ca987d46SWarner Losh.It Ic boot
70ca987d46SWarner Losh.It Ic boot Ar kernelname Op Cm ...
71ca987d46SWarner Losh.It Ic boot Ar directory Op Cm ...
72ca987d46SWarner Losh.It Ic boot Fl flag Cm ...
73ca987d46SWarner LoshBoot as specified by the
74ca987d46SWarner Losh.Xr loader.conf 5
75ca987d46SWarner Loshfiles read.
76ca987d46SWarner Losh.Pp
77ca987d46SWarner LoshDepending on the arguments passed, it can override boot flags and
78ca987d46SWarner Losheither the kernel name or the search path for kernel and modules.
79ca987d46SWarner Losh.Pp
80ca987d46SWarner Losh.It Ic boot-conf
81ca987d46SWarner Losh.It Ic boot-conf Ar kernelname Op Cm ...
82ca987d46SWarner Losh.It Ic boot-conf Ar directory Op Cm ...
83ca987d46SWarner Losh.It Ic boot-conf Fl flag Cm ...
84ca987d46SWarner LoshWorks like
85ca987d46SWarner Losh.Ic boot
86ca987d46SWarner Loshdescribed above, but instead of booting immediately, uses
87ca987d46SWarner Losh.Ic autoboot ,
88ca987d46SWarner Loshso it can be stopped.
89ca987d46SWarner Losh.Pp
90ca987d46SWarner Losh.It Ic start
91ca987d46SWarner LoshReads
92ca987d46SWarner Losh.Pa /boot/defaults/loader.conf ,
93ca987d46SWarner Loshall other
94ca987d46SWarner Losh.Xr loader.conf 5
95ca987d46SWarner Loshfiles specified in it, then loads the desired kernel and modules
96ca987d46SWarner Losh.Pq if not already loaded .
97ca987d46SWarner LoshAfter which you can use the
98ca987d46SWarner Losh.Ic boot
99ca987d46SWarner Loshor
100ca987d46SWarner Losh.Ic autoboot
101*ad49d7c5SGordon Berglingcommands or simply exit (provided
102ca987d46SWarner Losh.Va autoboot_delay
103ca987d46SWarner Loshis not set to NO) to boot the system.
104ca987d46SWarner Losh.Ic start
105ca987d46SWarner Loshis the command used in the default
106ca987d46SWarner Losh.Pa /boot/loader.rc
107ca987d46SWarner Loshfile
108ca987d46SWarner Losh.Pq see Xr loader 8 .
109ca987d46SWarner Losh.Pp
110ca987d46SWarner Losh.It Ic initialize
111ca987d46SWarner LoshInitialize the support library so commands can be used without executing
112ca987d46SWarner Losh.Ic start
113ca987d46SWarner Loshfirst.
114ca987d46SWarner LoshLike
115ca987d46SWarner Losh.Ic start ,
116ca987d46SWarner Loshit reads
117ca987d46SWarner Losh.Pa /boot/defaults/loader.conf
118ca987d46SWarner Loshand all other
119ca987d46SWarner Losh.Xr loader.conf 5
120ca987d46SWarner Loshfiles specified in it
121ca987d46SWarner Losh.Pq but does not load kernel or modules .
122ca987d46SWarner LoshReturns a flag on the stack to indicate
123ca987d46SWarner Loshif any configuration files were successfully loaded.
124ca987d46SWarner Losh.Pp
125ca987d46SWarner Losh.It Ic read-conf Ar filename
126ca987d46SWarner LoshReads and processes a
127ca987d46SWarner Losh.Xr loader.conf 5
128ca987d46SWarner Loshfile.
129ca987d46SWarner LoshDoes not proceed to boot.
130ca987d46SWarner Losh.Pp
131ca987d46SWarner Losh.It Ic enable-module Ar module
132ca987d46SWarner LoshEnables the loading of
133ca987d46SWarner Losh.Ar module .
134ca987d46SWarner Losh.Pp
135ca987d46SWarner Losh.It Ic disable-module Ar module
136ca987d46SWarner LoshDisables the loading of
137ca987d46SWarner Losh.Ar module .
138ca987d46SWarner Losh.Pp
139ca987d46SWarner Losh.It Ic toggle-module Ar module
140ca987d46SWarner LoshToggles the loading of
141ca987d46SWarner Losh.Ar module
142ca987d46SWarner Loshon and off.
143ca987d46SWarner Losh.Pp
144ca987d46SWarner Losh.It Ic show-module Ar module
145ca987d46SWarner LoshShows the information gathered in the
146ca987d46SWarner Losh.Xr loader.conf 5
147ca987d46SWarner Loshfiles about the module
148ca987d46SWarner Losh.Ar module .
149ca987d46SWarner Losh.Pp
150ca987d46SWarner Losh.It Ic retry
151ca987d46SWarner LoshUsed inside
152ca987d46SWarner Losh.Xr loader.conf 5
153ca987d46SWarner Loshfiles to specify the action after a module loading fails.
154ca987d46SWarner Losh.Pp
155ca987d46SWarner Losh.It Ic ignore
156ca987d46SWarner LoshUsed inside
157ca987d46SWarner Losh.Xr loader.conf 5
158ca987d46SWarner Loshfiles to specify the action after a module loading fails.
159ca987d46SWarner Losh.It Ic try-include Ar file Op Ar
160ca987d46SWarner LoshProcess script files if they exist.
161ca987d46SWarner LoshEach file, in turn, is completely read into memory,
162ca987d46SWarner Loshand then each of its lines is passed to the command line interpreter.
163ca987d46SWarner LoshIf any error is returned by the interpreter, the try-include
164ca987d46SWarner Loshcommand aborts immediately, without reading any other files, and
165ca987d46SWarner Loshsilently returns without error.
166ca987d46SWarner Losh.El
167ca987d46SWarner Losh.Sh FILES
168ca987d46SWarner Losh.Bl -tag -width /boot/loader.4th -compact
169ca987d46SWarner Losh.It Pa /boot/loader
170ca987d46SWarner LoshThe
171ca987d46SWarner Losh.Xr loader 8 .
172ca987d46SWarner Losh.It Pa /boot/loader.4th
173ca987d46SWarner Losh.Nm
174ca987d46SWarner Loshitself.
175ca987d46SWarner Losh.It Pa /boot/loader.rc
176ca987d46SWarner Losh.Xr loader 8
177ca987d46SWarner Loshbootstrapping script.
178ca987d46SWarner Losh.It Pa /boot/defaults/loader.conf
179ca987d46SWarner LoshFile loaded by the
180ca987d46SWarner Losh.Ic start
181ca987d46SWarner Loshcommand.
182ca987d46SWarner Losh.El
183ca987d46SWarner Losh.Sh EXAMPLES
184ca987d46SWarner LoshStandard
185ca987d46SWarner Losh.Pa /boot/loader.rc :
186ca987d46SWarner Losh.Pp
187ca987d46SWarner Losh.Bd -literal -offset indent -compact
188ca987d46SWarner Loshinclude /boot/loader.4th
189ca987d46SWarner Loshstart
190ca987d46SWarner Losh.Ed
191ca987d46SWarner Losh.Pp
192ca987d46SWarner LoshLoad a different kernel with the standard configuration:
193ca987d46SWarner Losh.Pp
194ca987d46SWarner Losh.Bd -literal -offset indent -compact
195ca987d46SWarner Loshset kernel="kernel.old"
196ca987d46SWarner Loshunload
197ca987d46SWarner Loshboot-conf
198ca987d46SWarner Losh.Ed
199ca987d46SWarner Losh.Pp
200ca987d46SWarner LoshRead an additional configuration file and then proceed to boot:
201ca987d46SWarner Losh.Pp
202ca987d46SWarner Losh.Bd -literal -offset indent -compact
203ca987d46SWarner Loshunload
204ca987d46SWarner Loshread-conf /boot/special.conf
205ca987d46SWarner Loshboot-conf
206ca987d46SWarner Losh.Ed
207ca987d46SWarner Losh.Pp
208ca987d46SWarner LoshDisable the loading of the splash screen module and bitmap and then
209ca987d46SWarner Loshproceed to boot:
210ca987d46SWarner Losh.Pp
211ca987d46SWarner Losh.Bd -literal -offset indent -compact
212ca987d46SWarner Loshunload
213ca987d46SWarner Loshdisable-module splash_bmp
214ca987d46SWarner Loshdisable-module bitmap
215ca987d46SWarner Loshboot-conf
216ca987d46SWarner Losh.Ed
217ca987d46SWarner Losh.Sh SEE ALSO
218ca987d46SWarner Losh.Xr loader.conf 5 ,
219ca987d46SWarner Losh.Xr loader 8
220ca987d46SWarner Losh.Sh HISTORY
221ca987d46SWarner LoshThe
222ca987d46SWarner Losh.Nm
223ca987d46SWarner Loshset of commands first appeared in
224ca987d46SWarner Losh.Fx 3.2 .
225ca987d46SWarner Losh.Sh AUTHORS
226ca987d46SWarner LoshThe
227ca987d46SWarner Losh.Nm
228ca987d46SWarner Loshset of commands was written by
229ca987d46SWarner Losh.An Daniel C. Sobral Aq dcs@FreeBSD.org .
230ca987d46SWarner Losh.Sh BUGS
231ca987d46SWarner LoshA British espionage series.
232